Struct someip_parse::SomeipMsgSlice
source · 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>
impl<'a> SomeipMsgSlice<'a>
pub fn from_slice( slice: &'a [u8] ) -> Result<SomeipMsgSlice<'_>, SomeipSliceError>
sourcepub fn message_id(&self) -> u32
pub fn message_id(&self) -> u32
Returns the message id of the message.
sourcepub fn service_id(&self) -> u16
pub fn service_id(&self) -> u16
Returns the service id (first 16 bits of the message id)
sourcepub fn is_event(&self) -> bool
pub fn is_event(&self) -> bool
Returns true if the event or notification bit in the message id is set
sourcepub fn event_or_method_id(&self) -> u16
pub fn event_or_method_id(&self) -> u16
Return the event id or method id. This number includes the “event bit”.
sourcepub fn is_someip_sd(&self) -> bool
pub fn is_someip_sd(&self) -> bool
Returns true if the message has the message id of a some ip service discovery message.
sourcepub fn length(&self) -> u32
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).
sourcepub fn request_id(&self) -> u32
pub fn request_id(&self) -> u32
Returns the request id of the message.
sourcepub fn protocol_version(&self) -> u8
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).
sourcepub fn interface_version(&self) -> u8
pub fn interface_version(&self) -> u8
Returns the interface version field of the message.
sourcepub fn message_type(&self) -> MessageType
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).
sourcepub fn message_type_raw(&self) -> u8
pub fn message_type_raw(&self) -> u8
Returns the raw message type value (contains the tp flag).
sourcepub fn is_tp(&self) -> bool
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])
sourcepub fn return_code(&self) -> u8
pub fn return_code(&self) -> u8
Returns the return code of the message.
sourcepub fn payload(&self) -> &'a [u8] ⓘ
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.
sourcepub fn tp_header(&self) -> Option<TpHeader>
pub fn tp_header(&self) -> Option<TpHeader>
Returns the tp header if there should be one present.
sourcepub fn to_header(&self) -> SomeipHeader
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>
impl<'a> Clone for SomeipMsgSlice<'a>
source§fn clone(&self) -> SomeipMsgSlice<'a>
fn clone(&self) -> SomeipMsgSlice<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'a> Debug for SomeipMsgSlice<'a>
impl<'a> Debug for SomeipMsgSlice<'a>
source§impl<'a> Hash for SomeipMsgSlice<'a>
impl<'a> Hash for SomeipMsgSlice<'a>
source§impl<'a> Ord for SomeipMsgSlice<'a>
impl<'a> Ord for SomeipMsgSlice<'a>
source§fn cmp(&self, other: &SomeipMsgSlice<'a>) -> Ordering
fn cmp(&self, other: &SomeipMsgSlice<'a>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl<'a> PartialEq for SomeipMsgSlice<'a>
impl<'a> PartialEq for SomeipMsgSlice<'a>
source§fn eq(&self, other: &SomeipMsgSlice<'a>) -> bool
fn eq(&self, other: &SomeipMsgSlice<'a>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<'a> PartialOrd for SomeipMsgSlice<'a>
impl<'a> PartialOrd for SomeipMsgSlice<'a>
source§fn partial_cmp(&self, other: &SomeipMsgSlice<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &SomeipMsgSlice<'a>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more