pub struct NestedView;
Expand description

Use this as a marker type for using this layout as a nested field within another layout.

Example

use binary_layout::prelude::*;

define_layout!(icmp_header, BigEndian, {
  packet_type: u8,
  code: u8,
  checksum: u16,
  rest_of_header: [u8; 4],
});
define_layout!(icmp_packet, BigEndian, {
  header: icmp_header::NestedView,
  data_section: [u8], // open ended byte array, matches until the end of the packet
});

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.