pub enum Layer<'a> {
Tag01(Layer01<'a>),
Unknown(Unknown<'a>),
}Expand description
A layer that can be one of the known types, or an unknown
Variants§
Tag01(Layer01<'a>)
MVT-compatible layer (tag = 1)
Unknown(Unknown<'a>)
Unknown layer with tag, size, and value
Implementations§
Source§impl<'a> Layer<'a>
impl<'a> Layer<'a>
Sourcepub fn as_layer01(&self) -> Option<&Layer01<'a>>
pub fn as_layer01(&self) -> Option<&Layer01<'a>>
Returns the inner Layer01 if this is a Tag01 layer, or None otherwise.
Sourcepub fn as_layer01_mut(&mut self) -> Option<&mut Layer01<'a>>
pub fn as_layer01_mut(&mut self) -> Option<&mut Layer01<'a>>
Returns the inner Layer01 if this is a Tag01 layer, or None otherwise.
pub fn decoded_layer01_mut( &mut self, dec: &mut Decoder, ) -> Result<&mut Layer01<'a>, MltError>
Sourcepub fn from_bytes(
input: &'a [u8],
parser: &mut Parser,
) -> MltRefResult<'a, Layer<'a>>
pub fn from_bytes( input: &'a [u8], parser: &mut Parser, ) -> MltRefResult<'a, Layer<'a>>
Parse a single tuple that consists of size (varint), tag (varint), and value (bytes).
Reserves memory for decoded data against the parser’s budget.
pub fn decode_all(&mut self, dec: &mut Decoder) -> MltResult<()>
Trait Implementations§
Source§impl PartialEq<Layer<'_>> for StagedLayer
impl PartialEq<Layer<'_>> for StagedLayer
Source§impl PartialEq<StagedLayer> for Layer<'_>
impl PartialEq<StagedLayer> for Layer<'_>
impl<'a> StructuralPartialEq for Layer<'a>
Auto Trait Implementations§
impl<'a> Freeze for Layer<'a>
impl<'a> RefUnwindSafe for Layer<'a>
impl<'a> Send for Layer<'a>
impl<'a> Sync for Layer<'a>
impl<'a> Unpin for Layer<'a>
impl<'a> UnsafeUnpin for Layer<'a>
impl<'a> UnwindSafe for Layer<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more