pub struct SequentialText {
pub header: Vec<u8>,
pub text: Vec<u8>,
}Expand description
Structured representation of text files on disk. There is a page structure that we do not put into the structure. As a result the decoder must pass over nulls, the encoder must insert them.
Fields§
§header: Vec<u8>§text: Vec<u8>Trait Implementations§
Source§impl DiskStruct for SequentialText
impl DiskStruct for SequentialText
Source§fn from_bytes(dat: &[u8]) -> Result<Self, DiskStructError>
fn from_bytes(dat: &[u8]) -> Result<Self, DiskStructError>
Create structure using flattened bytes (typically from disk) Due to the pagination, we must keep all the nulls.
Source§fn update_from_bytes(&mut self, dat: &[u8]) -> Result<(), DiskStructError>
fn update_from_bytes(&mut self, dat: &[u8]) -> Result<(), DiskStructError>
Update with flattened bytes (useful mostly as a crutch within a2kit_macro)
Source§fn from_bytes_adv(
bytes: &[u8],
ptr: &mut usize,
) -> Result<Self, DiskStructError>where
Self: Sized,
fn from_bytes_adv(
bytes: &[u8],
ptr: &mut usize,
) -> Result<Self, DiskStructError>where
Self: Sized,
convenience function to call
from_bytes and increment ptr by len()Source§impl Display for SequentialText
Allows the text to be displayed to the console using println!. This also
derives to_string, so the structure can be converted to String.
impl Display for SequentialText
Allows the text to be displayed to the console using println!. This also
derives to_string, so the structure can be converted to String.
Source§impl FromStr for SequentialText
Allows the structure to be created from string slices using from_str.
impl FromStr for SequentialText
Allows the structure to be created from string slices using from_str.
Auto Trait Implementations§
impl Freeze for SequentialText
impl RefUnwindSafe for SequentialText
impl Send for SequentialText
impl Sync for SequentialText
impl Unpin for SequentialText
impl UnwindSafe for SequentialText
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