Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
parity-scale-codec
Commits
33cb920b
Unverified
Commit
33cb920b
authored
Jan 25, 2021
by
Bastian Köcher
Committed by
GitHub
Jan 25, 2021
Browse files
Fix some docs (#246)
parent
5f7145db
Pipeline
#121630
failed with stages
in 17 minutes and 18 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
src/decode_all.rs
View file @
33cb920b
...
...
@@ -20,8 +20,9 @@ pub(crate) const DECODE_ALL_ERR_MSG: &str = "Input buffer has still data left af
/// Extension trait to [`Decode`] that ensures that the given input data is consumed completly while
/// decoding.
pub
trait
DecodeAll
:
Sized
{
/// Decode `Self` and consume all of the given input data. If not all data is consumed, an error
/// is returned.
/// Decode `Self` and consume all of the given input data.
///
/// If not all data is consumed, an error is returned.
fn
decode_all
(
input
:
&
[
u8
])
->
Result
<
Self
,
Error
>
;
}
...
...
src/depth_limit.rs
View file @
33cb920b
...
...
@@ -17,14 +17,16 @@ use crate::codec::{Error, Decode, Input};
/// The error message returned when depth limit is reached.
const
DECODE_MAX_DEPTH_MSG
:
&
str
=
"Maximum recursion depth reached when decoding"
;
/// Extension trait to [`Decode`] that ensures that the given input data is consumed completly while
/// decoding.
/// Extension trait to [`Decode`] for decoding with a maximum recursion depth.
pub
trait
DecodeLimit
:
Sized
{
/// Decode `Self` with given maximum recursion depth.
/// is returned.
/// Decode `Self` with the given maximum recursion depth.
///
/// If `limit` is hit, an error is returned.
fn
decode_with_depth_limit
(
limit
:
u32
,
input
:
&
[
u8
])
->
Result
<
Self
,
Error
>
;
/// Decode `Self` and consume all of the given input data. If not all data is consumed, an error
/// is returned.
/// Decode `Self` and consume all of the given input data.
///
/// If not all data is consumed or `limit` is hit, an error is returned.
fn
decode_all_with_depth_limit
(
limit
:
u32
,
input
:
&
[
u8
])
->
Result
<
Self
,
Error
>
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment