#[repr(C)]pub struct IpcHandshake {
pub magic: u32,
pub protocol_version: u16,
pub _reserved: u16,
pub client_abi_major: u16,
pub client_abi_minor: u16,
pub nonce: u32,
pub flags: u32,
}Expand description
First message a client sends after ipc_connect to negotiate protocol.
Fields§
§magic: u32§protocol_version: u16§_reserved: u16§client_abi_major: u16§client_abi_minor: u16§nonce: u32§flags: u32Implementations§
Source§impl IpcHandshake
impl IpcHandshake
Sourcepub const fn new_with_nonce(nonce: u32) -> Self
pub const fn new_with_nonce(nonce: u32) -> Self
Build a handshake with a caller-provided nonce.
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Return true when the message carries the expected handshake magic.
Sourcepub fn is_compatible(&self) -> bool
pub fn is_compatible(&self) -> bool
Return true when magic and protocol version match this ABI.
Trait Implementations§
Source§impl Clone for IpcHandshake
impl Clone for IpcHandshake
Source§fn clone(&self) -> IpcHandshake
fn clone(&self) -> IpcHandshake
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IpcHandshake
impl Debug for IpcHandshake
Source§impl FromBytes for IpcHandshake
impl FromBytes for IpcHandshake
Source§impl FromZeros for IpcHandshake
impl FromZeros for IpcHandshake
Source§impl IntoBytes for IpcHandshake
impl IntoBytes for IpcHandshake
§fn as_mut_bytes(&mut self) -> &mut [u8]where
Self: FromBytes,
fn as_mut_bytes(&mut self) -> &mut [u8]where
Self: FromBytes,
Gets the bytes of this value mutably. Read more
Source§impl TryFromBytes for IpcHandshake
impl TryFromBytes for IpcHandshake
§fn try_read_from_bytes(
source: &[u8],
) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_bytes(
source: &[u8],
) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
§fn try_read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
§fn try_read_from_suffix(
source: &[u8],
) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_suffix(
source: &[u8],
) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
impl Copy for IpcHandshake
Auto Trait Implementations§
impl Freeze for IpcHandshake
impl RefUnwindSafe for IpcHandshake
impl Send for IpcHandshake
impl Sync for IpcHandshake
impl Unpin for IpcHandshake
impl UnsafeUnpin for IpcHandshake
impl UnwindSafe for IpcHandshake
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