pub struct Header {
pub message_id: MessageId,
pub length: u32,
pub request_id: u32,
pub protocol_version: u8,
pub interface_version: u8,
pub message_type: MessageTypeField,
pub return_code: ReturnCode,
}Expand description
SOME/IP header
Fields§
§message_id: MessageIdMessage ID, encoding service ID and method ID
length: u32Length of the message in bytes, starting at the request Id Total length of the message is therefore length + 8
request_id: u32SOME/IP Request ID (4 bytes): Client ID [31:16] + Session ID [15:0].
protocol_version: u8§interface_version: u8§message_type: MessageTypeField§return_code: ReturnCodeImplementations§
Source§impl Header
impl Header
Sourcepub fn upper_header_bytes(&self) -> [u8; 8]
pub fn upper_header_bytes(&self) -> [u8; 8]
Return the 8-byte “upper header” used by E2E UPPER-HEADER-BITS-TO-SHIFT.
Layout (big-endian): request_id(4) + protocol_version(1) + interface_version(1)
+ message_type(1) + return_code(1)
Note: request_id is the full 4-byte SOME/IP Request ID field
(Client ID [31:16] + Session ID [15:0]), not just the 2-byte Session ID.
pub fn new_sd(request_id: u32, sd_header_size: usize) -> Self
pub const fn is_sd(&self) -> bool
pub const fn payload_size(&self) -> usize
pub fn set_request_id(&mut self, request_id: u32)
Trait Implementations§
Source§impl WireFormat for Header
impl WireFormat for Header
Source§fn decode<T: Read>(reader: &mut T) -> Result<Self, Error>
fn decode<T: Read>(reader: &mut T) -> Result<Self, Error>
Deserialize a value from a byte stream.
Returns Ok(
Some(value)) if the stream contains a complete value.
Returns Ok(None) if the stream is empty. Read moreSource§fn required_size(&self) -> usize
fn required_size(&self) -> usize
Returns the number of bytes required to serialize this value.
impl Eq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnsafeUnpin for Header
impl UnwindSafe for Header
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more