pub struct Block {
pub offset: usize,
pub size: usize,
pub flags: u8,
pub data: Vec<u8>,
}Expand description
A raw block from a size-prefixed stream.
Fields§
§offset: usizeOffset in the stream where this block starts
size: usizeSize of the data (excluding header)
flags: u8Flags from the high byte of the size field
data: Vec<u8>Raw block data
Implementations§
Source§impl Block
impl Block
Sourcepub fn is_binary(&self) -> bool
pub fn is_binary(&self) -> bool
Returns true if the binary flag (0x01) is set.
In schematic files, this indicates a binary record rather than a pipe-delimited parameter string.
Sourcepub fn as_params(&self) -> Option<ParameterCollection>
pub fn as_params(&self) -> Option<ParameterCollection>
Try to parse the block as a ParameterCollection.
Returns None if the block appears to be binary or parsing fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Block
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnwindSafe for Block
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more