pub struct SomeipMsgSlice<'a> { /* private fields */ }
Expand description

A slice containing an some ip header & payload of that message.

Implementations§

source§

impl<'a> SomeipMsgSlice<'a>

source

pub fn from_slice( slice: &'a [u8] ) -> Result<SomeipMsgSlice<'_>, SomeipSliceError>

source

pub fn slice(&self) -> &'a [u8]

Return the slice that contains the someip header

source

pub fn message_id(&self) -> u32

Returns the message id of the message.

source

pub fn service_id(&self) -> u16

Returns the service id (first 16 bits of the message id)

source

pub fn is_event(&self) -> bool

Returns true if the event or notification bit in the message id is set

source

pub fn event_or_method_id(&self) -> u16

Return the event id or method id. This number includes the “event bit”.

source

pub fn event_id(&self) -> Option<u16>

Return the event id. None if event bit is not set.

source

pub fn method_id(&self) -> Option<u16>

Return the method id. None if event bit is set.

source

pub fn is_someip_sd(&self) -> bool

Returns true if the message has the message id of a some ip service discovery message.

source

pub fn length(&self) -> u32

Returns the length contained in the header. WARNING: the length paritally contains the header and partially the payload, use the payload() method instead if you want to access the payload slice).

source

pub fn request_id(&self) -> u32

Returns the request id of the message.

source

pub fn protocol_version(&self) -> u8

Return the value of the protocol version field of the message (must match SOMEIP_PROTOCOL_VERSION, unless something dark and unsafe is beeing done).

source

pub fn interface_version(&self) -> u8

Returns the interface version field of the message.

source

pub fn message_type(&self) -> MessageType

Return the message type (does not contain the tp flag, use the message_type_tp method for checking if this is a tp message).

source

pub fn message_type_raw(&self) -> u8

Returns the raw message type value (contains the tp flag).

source

pub fn is_tp(&self) -> bool

Returns true if the tp flag in the message type is set (Transporting large SOME/IP messages of UDP [SOME/IP-TP])

source

pub fn return_code(&self) -> u8

Returns the return code of the message.

source

pub fn payload(&self) -> &'a [u8]

Return a slice to the payload of the someip header.

If the there is tp header present the memory after the tp header is returned.

source

pub fn tp_header(&self) -> Option<TpHeader>

Returns the tp header if there should be one present.

source

pub fn to_header(&self) -> SomeipHeader

Decode all the fields and copy the results to a SomeIpHeader struct

Trait Implementations§

source§

impl<'a> Clone for SomeipMsgSlice<'a>

source§

fn clone(&self) -> SomeipMsgSlice<'a>

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<'a> Debug for SomeipMsgSlice<'a>

source§

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

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

impl<'a> Hash for SomeipMsgSlice<'a>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'a> Ord for SomeipMsgSlice<'a>

source§

fn cmp(&self, other: &SomeipMsgSlice<'a>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<'a> PartialEq for SomeipMsgSlice<'a>

source§

fn eq(&self, other: &SomeipMsgSlice<'a>) -> 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<'a> PartialOrd for SomeipMsgSlice<'a>

source§

fn partial_cmp(&self, other: &SomeipMsgSlice<'a>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<'a> Eq for SomeipMsgSlice<'a>

source§

impl<'a> StructuralEq for SomeipMsgSlice<'a>

source§

impl<'a> StructuralPartialEq for SomeipMsgSlice<'a>

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for SomeipMsgSlice<'a>

§

impl<'a> Send for SomeipMsgSlice<'a>

§

impl<'a> Sync for SomeipMsgSlice<'a>

§

impl<'a> Unpin for SomeipMsgSlice<'a>

§

impl<'a> UnwindSafe for SomeipMsgSlice<'a>

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.