Struct fidl::encoding::TransactionHeader
source · #[repr(C)]pub struct TransactionHeader {
pub tx_id: u32,
pub at_rest_flags: [u8; 2],
pub dynamic_flags: u8,
pub magic_number: u8,
pub ordinal: u64,
}
Expand description
Header for transactional FIDL messages
Fields§
§tx_id: u32
Transaction ID which identifies a request-response pair
at_rest_flags: [u8; 2]
Flags set for this message. MUST NOT be validated by bindings. Usually temporarily during migrations.
dynamic_flags: u8
Flags used for dynamically interpreting the request if it is unknown to the receiver.
magic_number: u8
Magic number indicating the message’s wire format. Two sides with different magic numbers are incompatible with each other.
ordinal: u64
Ordinal which identifies the FIDL method
Implementations§
source§impl TransactionHeader
impl TransactionHeader
sourcepub fn is_compatible(&self) -> bool
pub fn is_compatible(&self) -> bool
Returns whether the message containing this TransactionHeader is in a compatible wire format
source§impl TransactionHeader
impl TransactionHeader
sourcepub fn new(tx_id: u32, ordinal: u64, dynamic_flags: DynamicFlags) -> Self
pub fn new(tx_id: u32, ordinal: u64, dynamic_flags: DynamicFlags) -> Self
Creates a new transaction header with the default encode context and magic number.
sourcepub fn new_full(
tx_id: u32,
ordinal: u64,
context: Context,
dynamic_flags: DynamicFlags,
magic_number: u8,
) -> Self
pub fn new_full( tx_id: u32, ordinal: u64, context: Context, dynamic_flags: DynamicFlags, magic_number: u8, ) -> Self
Creates a new transaction header with a specific context and magic number.
sourcepub fn is_epitaph(&self) -> bool
pub fn is_epitaph(&self) -> bool
Returns true if the header is for an epitaph message.
sourcepub fn validate_wire_format(&self) -> Result<()>
pub fn validate_wire_format(&self) -> Result<()>
Returns an error if this header has an incompatible wire format.
sourcepub fn validate_request_tx_id(&self, method_type: MethodType) -> Result<()>
pub fn validate_request_tx_id(&self, method_type: MethodType) -> Result<()>
Returns an error if this request header has an incorrect transaction id for the given method type.
sourcepub fn at_rest_flags(&self) -> AtRestFlags
pub fn at_rest_flags(&self) -> AtRestFlags
Returns the header’s migration flags as a AtRestFlags
value.
sourcepub fn dynamic_flags(&self) -> DynamicFlags
pub fn dynamic_flags(&self) -> DynamicFlags
Returns the header’s dynamic flags as a DynamicFlags
value.
sourcepub fn decoding_context(&self) -> Context
pub fn decoding_context(&self) -> Context
Returns the context to use for decoding the message body associated with
this header. During migrations, this is dependent on self.flags()
and
controls dynamic behavior in the read path.
Trait Implementations§
source§impl Clone for TransactionHeader
impl Clone for TransactionHeader
source§fn clone(&self) -> TransactionHeader
fn clone(&self) -> TransactionHeader
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TransactionHeader
impl Debug for TransactionHeader
source§impl<D: ResourceDialect> Decode<TransactionHeader, D> for TransactionHeader
impl<D: ResourceDialect> Decode<TransactionHeader, D> for TransactionHeader
source§impl<D: ResourceDialect> Encode<TransactionHeader, D> for &TransactionHeader
impl<D: ResourceDialect> Encode<TransactionHeader, D> for &TransactionHeader
source§impl PartialEq for TransactionHeader
impl PartialEq for TransactionHeader
source§fn eq(&self, other: &TransactionHeader) -> bool
fn eq(&self, other: &TransactionHeader) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl TypeMarker for TransactionHeader
impl TypeMarker for TransactionHeader
§type Owned = TransactionHeader
type Owned = TransactionHeader
source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read moresource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.source§impl ValueTypeMarker for TransactionHeader
impl ValueTypeMarker for TransactionHeader
impl Copy for TransactionHeader
impl Eq for TransactionHeader
impl StructuralPartialEq for TransactionHeader
Auto Trait Implementations§
impl Freeze for TransactionHeader
impl RefUnwindSafe for TransactionHeader
impl Send for TransactionHeader
impl Sync for TransactionHeader
impl Unpin for TransactionHeader
impl UnwindSafe for TransactionHeader
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)