pub struct SdHeader {
pub flags: SdHeaderFlags,
pub entries: Vec<SdEntry>,
pub options: Vec<SdOption>,
}Expand description
SOMEIP service discovery header
Fields§
§flags: SdHeaderFlags§entries: Vec<SdEntry>§options: Vec<SdOption>Implementations§
Source§impl SdHeader
impl SdHeader
pub fn new(reboot: bool, entries: Vec<SdEntry>, options: Vec<SdOption>) -> Self
pub fn read<T: Read + Seek>(reader: &mut T) -> Result<Self, SdReadError>
pub fn read_with_flag<T: Read + Seek>( reader: &mut T, discard_unknown_option: bool, ) -> Result<Self, SdReadError>
Sourcepub fn write<T: Write>(&self, writer: &mut T) -> Result<(), SdWriteError>
pub fn write<T: Write>(&self, writer: &mut T) -> Result<(), SdWriteError>
Writes the header to the given writer.
Sourcepub fn write_to_slice(&self, slice: &mut [u8]) -> Result<(), SdWriteError>
pub fn write_to_slice(&self, slice: &mut [u8]) -> Result<(), SdWriteError>
Writes the header to a slice.
Sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Length of the serialized header in bytes.
Sourcepub fn to_bytes_vec(&self) -> Result<Vec<u8>, SdValueError>
pub fn to_bytes_vec(&self) -> Result<Vec<u8>, SdValueError>
Writes the header to a slice without checking the slice length.
Trait Implementations§
impl Eq for SdHeader
impl StructuralPartialEq for SdHeader
Auto Trait Implementations§
impl Freeze for SdHeader
impl RefUnwindSafe for SdHeader
impl Send for SdHeader
impl Sync for SdHeader
impl Unpin for SdHeader
impl UnwindSafe for SdHeader
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)