Skip to main content

OpenReply

Struct OpenReply 

Source
#[repr(C, packed(1))]
pub struct OpenReply { pub status: u32, pub file_id: u64, pub size: u64, pub file_flags: u32, }
Expand description

Open reply.

Wire layout: status @ 0..4, file_id @ 4..12, size @ 12..20, file_flags @ 20..24.

§Wire-compatibility note

Earlier documentation wrongly claimed _pad0 @ 4..8, ino @ 8..16, size @ 16..24, file_flags @ 24..28 (32 bytes); no server ever produced that layout. The real layout above is what every scheme server (net, bus) emits and what the kernel VFS client parses.

Fields§

§status: u32

Status code: 0 = success.

§file_id: u64

Handle/id of the opened file.

§size: u64

File size in bytes (u64::MAX = size unknown).

§file_flags: u32

File flags (device, pipe, chunked read/write, directory…).

Implementations§

Source§

impl OpenReply

Source

pub const OFFSET: usize = 0

Byte at which this struct starts in a reply payload.

Source

pub fn parse(payload: &[u8]) -> Option<Self>

Parse an OPEN reply payload. Returns None if the reply is truncated.

Source

pub fn encode_into(&self, payload: &mut [u8])

Encode this reply into payload[0..24].

Trait Implementations§

Source§

impl Clone for OpenReply

Source§

fn clone(&self) -> OpenReply

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for OpenReply

Source§

impl Debug for OpenReply

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.