Struct someip_parse::SomeIpHeader [−][src]
pub struct SomeIpHeader { pub message_id: u32, pub request_id: u32, pub interface_version: u8, pub message_type: MessageType, pub message_type_tp: bool, pub return_code: u8, // some fields omitted }
Fields
message_id: u32
request_id: u32
interface_version: u8
message_type: MessageType
message_type_tp: bool
If true the tp flag in the message type is set (Transporting large SOME/IP messages of UDP [SOME/IP-TP])
return_code: u8
Methods
impl SomeIpHeader
[src]
impl SomeIpHeader
pub fn payload_len(&self) -> u32
[src]
pub fn payload_len(&self) -> u32
Return the length of the payload based on the length field in the header.
pub fn set_payload_len(&mut self, value: u32) -> Result<(), ValueError>
[src]
pub fn set_payload_len(&mut self, value: u32) -> Result<(), ValueError>
Set the length of the payload (automatically adds 8 bytes).
Returns an error if the given value is bigger then SOMEIP_MAX_PAYLOAD_LEN.
pub fn service_id(&self) -> u16
[src]
pub fn service_id(&self) -> u16
Returns the service id (first 16 bits of the message id)
pub fn set_service_id(&mut self, service_id: u16)
[src]
pub fn set_service_id(&mut self, service_id: u16)
Set the servide id (first 16 bits of the message id)
pub fn set_event_id(&mut self, event_id: u16)
[src]
pub fn set_event_id(&mut self, event_id: u16)
Set the event id + the event bit.
pub fn set_method_id(&mut self, method_id: u16)
[src]
pub fn set_method_id(&mut self, method_id: u16)
Set the event id + the event bit to 0. Asserting method_id <= 0x7FFF (otherwise the )
pub fn set_method_or_event_id(&mut self, method_id: u16)
[src]
pub fn set_method_or_event_id(&mut self, method_id: u16)
Sets the event id or method id. This number mjust include the "event bit".
pub fn is_someip_sd(&self) -> bool
[src]
pub fn is_someip_sd(&self) -> bool
Returns true if the message has the message id of a some ip service discovery message.
pub fn is_event(&self) -> bool
[src]
pub fn is_event(&self) -> bool
Returns true if the event or notification bit in the message id is set
pub fn event_or_method_id(&self) -> u16
[src]
pub fn event_or_method_id(&self) -> u16
Return the event id or method id. This number includes the "event bit".
pub fn write<T: Write>(&self, writer: &mut T) -> Result<(), Error>
[src]
pub fn write<T: Write>(&self, writer: &mut T) -> Result<(), Error>
Serialize the header.
pub fn read<T: Read>(reader: &mut T) -> Result<SomeIpHeader, ReadError>
[src]
pub fn read<T: Read>(reader: &mut T) -> Result<SomeIpHeader, ReadError>
Read a header from a byte stream.
Trait Implementations
impl Clone for SomeIpHeader
[src]
impl Clone for SomeIpHeader
fn clone(&self) -> SomeIpHeader
[src]
fn clone(&self) -> SomeIpHeader
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for SomeIpHeader
[src]
impl Debug for SomeIpHeader
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Eq for SomeIpHeader
[src]
impl Eq for SomeIpHeader
impl PartialEq for SomeIpHeader
[src]
impl PartialEq for SomeIpHeader
fn eq(&self, other: &SomeIpHeader) -> bool
[src]
fn eq(&self, other: &SomeIpHeader) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &SomeIpHeader) -> bool
[src]
fn ne(&self, other: &SomeIpHeader) -> bool
This method tests for !=
.
impl Default for SomeIpHeader
[src]
impl Default for SomeIpHeader
fn default() -> SomeIpHeader
[src]
fn default() -> SomeIpHeader
Returns the "default value" for a type. Read more
Auto Trait Implementations
impl Send for SomeIpHeader
impl Send for SomeIpHeader
impl Sync for SomeIpHeader
impl Sync for SomeIpHeader