Enum someip_parse::SdEntry
source · pub enum SdEntry {
Service(ServiceEntry),
Eventgroup(EventgroupEntry),
}
Variants§
Service(ServiceEntry)
SOMEIP service discovery entry for a service.
Eventgroup(EventgroupEntry)
SOMEIP service discovery entry for an eventgroup.
Implementations§
source§impl SdEntry
impl SdEntry
pub fn new_service_entry( _type: SdServiceEntryType, index_first_option_run: u8, index_second_option_run: u8, number_of_options_1: u8, number_of_options_2: u8, service_id: u16, instance_id: u16, major_version: u8, ttl: u32, minor_version: u32 ) -> Result<Self, SdValueError>
sourcepub fn new_find_service_entry(
index_first_option_run: u8,
index_second_option_run: u8,
number_of_options_1: u8,
number_of_options_2: u8,
service_id: u16,
instance_id: u16,
major_version: u8,
ttl: u32,
minor_version: u32
) -> Result<Self, SdValueError>
pub fn new_find_service_entry( index_first_option_run: u8, index_second_option_run: u8, number_of_options_1: u8, number_of_options_2: u8, service_id: u16, instance_id: u16, major_version: u8, ttl: u32, minor_version: u32 ) -> Result<Self, SdValueError>
Find service instances. Only use when the state of the given service is unknown.
service_id
- Set to 0xFFFF if all service instances should be returned.instance_id
- Set to 0xFFFF if all instances should be returned.major_version
- Set to 0xFF if any version should be returned.minor_version
- Set to 0xFFFF_FFFF if any version should be returned.ttl
- Must not be 0 as this indicates a “stop offering”.
sourcepub fn new_offer_service_entry(
index_first_option_run: u8,
index_second_option_run: u8,
number_of_options_1: u8,
number_of_options_2: u8,
service_id: u16,
instance_id: u16,
major_version: u8,
ttl: u32,
minor_version: u32
) -> Result<Self, SdValueError>
pub fn new_offer_service_entry( index_first_option_run: u8, index_second_option_run: u8, number_of_options_1: u8, number_of_options_2: u8, service_id: u16, instance_id: u16, major_version: u8, ttl: u32, minor_version: u32 ) -> Result<Self, SdValueError>
Createa a service offer entry.
Errors:
ttl
must not be 0 as this indicates a “stop offering”. If ttl
0 is passed SdValueError::TtlZeroIndicatesStopOffering
as an error
is returned.
sourcepub fn new_stop_offer_service_entry(
index_first_option_run: u8,
index_second_option_run: u8,
number_of_options_1: u8,
number_of_options_2: u8,
service_id: u16,
instance_id: u16,
major_version: u8,
minor_version: u32
) -> Result<Self, SdValueError>
pub fn new_stop_offer_service_entry( index_first_option_run: u8, index_second_option_run: u8, number_of_options_1: u8, number_of_options_2: u8, service_id: u16, instance_id: u16, major_version: u8, minor_version: u32 ) -> Result<Self, SdValueError>
Stop offering a given service.
pub fn new_eventgroup( _type: SdEventGroupEntryType, index_first_option_run: u8, index_second_option_run: u8, number_of_options_1: u8, number_of_options_2: u8, service_id: u16, instance_id: u16, major_version: u8, ttl: u32, initial_data_requested: bool, counter: u8, eventgroup_id: u16 ) -> Result<Self, SdValueError>
pub fn read<T: Read + Seek>(reader: &mut T) -> Result<Self, SdReadError>
sourcepub fn read_service(
_type: SdServiceEntryType,
entry_bytes: [u8; 16]
) -> Result<Self, SdReadError>
pub fn read_service( _type: SdServiceEntryType, entry_bytes: [u8; 16] ) -> Result<Self, SdReadError>
Read a service entry from a byte array.
sourcepub fn read_entry_group(
_type: SdEventGroupEntryType,
entry_bytes: [u8; 16]
) -> Result<Self, SdReadError>
pub fn read_entry_group( _type: SdEventGroupEntryType, entry_bytes: [u8; 16] ) -> Result<Self, SdReadError>
Read an entry group from byte array.
sourcepub fn write<T: Write>(&self, writer: &mut T) -> Result<(), SdWriteError>
pub fn write<T: Write>(&self, writer: &mut T) -> Result<(), SdWriteError>
Writes the eventgroup entry to the given writer.
sourcepub fn to_bytes(&self) -> [u8; 16]
pub fn to_bytes(&self) -> [u8; 16]
Writes the eventgroup entry to a slice without checking the slice length.
sourcepub fn header_len(&self) -> usize
pub fn header_len(&self) -> usize
Length of the serialized header in bytes.
Trait Implementations§
source§impl From<EventgroupEntry> for SdEntry
impl From<EventgroupEntry> for SdEntry
source§fn from(o: EventgroupEntry) -> Self
fn from(o: EventgroupEntry) -> Self
Converts to this type from the input type.
source§impl From<ServiceEntry> for SdEntry
impl From<ServiceEntry> for SdEntry
source§fn from(e: ServiceEntry) -> Self
fn from(e: ServiceEntry) -> Self
Converts to this type from the input type.
source§impl PartialEq for SdEntry
impl PartialEq for SdEntry
impl Eq for SdEntry
impl StructuralEq for SdEntry
impl StructuralPartialEq for SdEntry
Auto Trait Implementations§
impl RefUnwindSafe for SdEntry
impl Send for SdEntry
impl Sync for SdEntry
impl Unpin for SdEntry
impl UnwindSafe for SdEntry
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