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§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§impl<'a> PartialEq for SomeipMsgSlice<'a>
impl<'a> PartialEq for SomeipMsgSlice<'a>
Source§impl<'a> PartialOrd for SomeipMsgSlice<'a>
impl<'a> PartialOrd for SomeipMsgSlice<'a>
impl<'a> Eq for SomeipMsgSlice<'a>
impl<'a> StructuralPartialEq for SomeipMsgSlice<'a>
Auto Trait Implementations§
impl<'a> Freeze for SomeipMsgSlice<'a>
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§
§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
§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)
clone_to_uninit)