#[repr(C, packed(1))]pub struct CreateRequest {
pub mode: u32,
pub path_len: u16,
}Expand description
Create request (file or directory).
Wire layout:
mode @ 0..4, path_len @ 4..6, path @ 6...
§Wire-compatibility note
Same raw u16 length prefix as OpenRequest (no InlineBlobHeader).
Fields§
§mode: u32Permission mode (e.g. 0o644 for files, 0o755 for directories).
path_len: u16Length in bytes of the UTF-8 path starting at offset 6.
Implementations§
Source§impl CreateRequest
impl CreateRequest
Sourcepub const PATH_OFFSET: usize = 6
pub const PATH_OFFSET: usize = 6
Byte offset at which the inline path starts.
Sourcepub fn parse(payload: &[u8]) -> Option<(u32, &str)>
pub fn parse(payload: &[u8]) -> Option<(u32, &str)>
Parse a CREATE request payload: (mode, path).
Sourcepub fn encode(msg_type: u32, mode: u32, path: &str) -> Option<IpcMessage>
pub fn encode(msg_type: u32, mode: u32, path: &str) -> Option<IpcMessage>
Encode a CREATE request into a fresh IpcMessage.
Returns None if the path does not fit the inline capacity.
Trait Implementations§
Source§impl Clone for CreateRequest
impl Clone for CreateRequest
Source§fn clone(&self) -> CreateRequest
fn clone(&self) -> CreateRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CreateRequest
Auto Trait Implementations§
impl Freeze for CreateRequest
impl RefUnwindSafe for CreateRequest
impl Send for CreateRequest
impl Sync for CreateRequest
impl Unpin for CreateRequest
impl UnsafeUnpin for CreateRequest
impl UnwindSafe for CreateRequest
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