pub struct Amf0Limits {
pub max_depth: usize,
pub max_values: usize,
}Expand description
The two bounds AMF0 decoding needs, both chosen by the caller: the crate supplies neither.
max_depth bounds container nesting (Object/ECMA Array/Strict Array) so a pathologically
nested input returns RtmpError::Amf0DepthExceeded instead of overflowing the native call
stack; the guard is checked on entering each nested container. max_values bounds width:
millions of one-byte nulls inside a Strict Array, or three-byte empty-key pairs inside an
Object, otherwise expand into millions of Amf0Values from a single message; a decode past it
returns RtmpError::Amf0TooManyValues.
Fields§
§max_depth: usizeDeepest container nesting a decode descends into.
max_values: usizeMost values one byte sequence may decode into, at any nesting level.
Implementations§
Source§impl Amf0Limits
impl Amf0Limits
Sourcepub fn for_profile(profile: Profile) -> Self
pub fn for_profile(profile: Profile) -> Self
The Profile preset, replaceable through its with_* setters.
Sourcepub fn with_max_depth(self, value: usize) -> Self
pub fn with_max_depth(self, value: usize) -> Self
Replace Self::max_depth.
Sourcepub fn with_max_values(self, value: usize) -> Self
pub fn with_max_values(self, value: usize) -> Self
Replace Self::max_values.
Trait Implementations§
Source§impl Clone for Amf0Limits
impl Clone for Amf0Limits
impl Copy for Amf0Limits
Source§impl Debug for Amf0Limits
impl Debug for Amf0Limits
Source§impl<'de> Deserialize<'de> for Amf0Limits
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Amf0Limits
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Amf0Limits
Source§impl PartialEq for Amf0Limits
impl PartialEq for Amf0Limits
Source§impl Serialize for Amf0Limits
Available on crate feature serde only.
impl Serialize for Amf0Limits
serde only.