pub struct StringBlock { /* private fields */ }Expand description
Represents a string block in a DBC file
Implementations§
Source§impl StringBlock
impl StringBlock
Sourcepub fn parse<R: Read + Seek>(
reader: &mut R,
offset: u64,
size: u32,
) -> Result<Self>
pub fn parse<R: Read + Seek>( reader: &mut R, offset: u64, size: u32, ) -> Result<Self>
Parse a string block from a reader
Sourcepub fn get_string(&self, string_ref: StringRef) -> Result<&str>
pub fn get_string(&self, string_ref: StringRef) -> Result<&str>
Get a string from the string block using a string reference
Sourcepub fn is_string_start(&self, offset: u32) -> bool
pub fn is_string_start(&self, offset: u32) -> bool
Check if an offset is the start of a string in the block
A valid string start is either at offset 0 (beginning of block) or immediately after a NUL terminator (byte at offset-1 is 0).
Trait Implementations§
Source§impl Clone for StringBlock
impl Clone for StringBlock
Source§fn clone(&self) -> StringBlock
fn clone(&self) -> StringBlock
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StringBlock
impl RefUnwindSafe for StringBlock
impl Send for StringBlock
impl Sync for StringBlock
impl Unpin for StringBlock
impl UnwindSafe for StringBlock
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