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

source

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>

source

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”.
source

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.

source

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.

source

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>

source

pub fn read<T: Read + Seek>(reader: &mut T) -> Result<Self, SdReadError>

source

pub fn read_service( _type: SdServiceEntryType, entry_bytes: [u8; 16] ) -> Result<Self, SdReadError>

Read a service entry from a byte array.

source

pub fn read_entry_group( _type: SdEventGroupEntryType, entry_bytes: [u8; 16] ) -> Result<Self, SdReadError>

Read an entry group from byte array.

source

pub fn write<T: Write>(&self, writer: &mut T) -> Result<(), SdWriteError>

Writes the eventgroup entry to the given writer.

source

pub fn to_bytes(&self) -> [u8; 16]

Writes the eventgroup entry to a slice without checking the slice length.

source

pub fn header_len(&self) -> usize

Length of the serialized header in bytes.

Trait Implementations§

source§

impl Clone for SdEntry

source§

fn clone(&self) -> SdEntry

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SdEntry

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<EventgroupEntry> for SdEntry

source§

fn from(o: EventgroupEntry) -> Self

Converts to this type from the input type.
source§

impl From<ServiceEntry> for SdEntry

source§

fn from(e: ServiceEntry) -> Self

Converts to this type from the input type.
source§

impl PartialEq for SdEntry

source§

fn eq(&self, other: &SdEntry) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for SdEntry

source§

impl StructuralEq for SdEntry

source§

impl StructuralPartialEq for SdEntry

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.