pub struct Header<B> { /* private fields */ }Implementations§
Source§impl<B> Header<B>
impl<B> Header<B>
Sourcepub fn map_buffer<C>(self, f: impl FnOnce(B) -> C) -> Header<C>
pub fn map_buffer<C>(self, f: impl FnOnce(B) -> C) -> Header<C>
Convert the buffer type without re-parsing the offset table.
Source§impl<B: AsRef<[u8]>> Header<B>
impl<B: AsRef<[u8]>> Header<B>
pub fn from_cdr(buf: B) -> Result<Self, CdrError>
pub fn stamp(&self) -> Time
pub fn frame_id(&self) -> &str
Sourcepub fn end_offset(&self) -> usize
pub fn end_offset(&self) -> usize
Byte position after the last field (useful for composite types).
pub fn as_cdr(&self) -> &[u8] ⓘ
pub fn cdr_size(&self) -> usize
pub fn to_cdr(&self) -> Vec<u8> ⓘ
Source§impl Header<Vec<u8>>
impl Header<Vec<u8>>
pub fn new(stamp: Time, frame_id: &str) -> Result<Self, CdrError>
👎Deprecated since 3.2.0:
use Header::builder() for allocation-free buffer reuse; Header::new will be removed in 4.0
pub fn into_cdr(self) -> Vec<u8> ⓘ
Sourcepub fn builder<'a>() -> HeaderBuilder<'a>
pub fn builder<'a>() -> HeaderBuilder<'a>
Start a new HeaderBuilder with zero-valued defaults.
Returned with a generic lifetime parameter 'a so the compiler
infers it from subsequent setter calls — .frame_id(&local_str)
binds 'a to the caller’s scope without forcing 'static.
Auto Trait Implementations§
impl<B> Freeze for Header<B>where
B: Freeze,
impl<B> RefUnwindSafe for Header<B>where
B: RefUnwindSafe,
impl<B> Send for Header<B>where
B: Send,
impl<B> Sync for Header<B>where
B: Sync,
impl<B> Unpin for Header<B>where
B: Unpin,
impl<B> UnsafeUnpin for Header<B>where
B: UnsafeUnpin,
impl<B> UnwindSafe for Header<B>where
B: UnwindSafe,
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