#[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§impl TypeMarker for TransactionHeader
impl TypeMarker for TransactionHeader
Source§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
Source§type Borrowed<'a> = &'a TransactionHeader
type Borrowed<'a> = &'a TransactionHeader
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreimpl 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)