pub struct OpenOptions {
pub read: bool,
pub write: bool,
pub create: bool,
pub create_new: bool,
pub truncate: bool,
pub mode: u32,
}Expand description
FFI-compatible open options. Defaults are false and mode 420 (0o644).
Append is exposed as crate::Client::append.
Fields§
§read: boolOpen for reading.
write: boolOpen for writing.
create: boolOpen-or-create. Not a single wire op: composed as open, falling back to exclusive create, retrying on race.
create_new: boolFail with AlreadyExists unless this call creates the file. This is
the atomic primitive (server creates are natively exclusive).
truncate: boolTruncate to zero length on open. Existing-file truncation is a separate, non-atomic setattr request.
mode: u32Permission bits when the open creates the file. Default 0o644.
Implementations§
Source§impl OpenOptions
impl OpenOptions
Sourcepub fn write_only() -> Self
pub fn write_only() -> Self
write only.
Sourcepub fn read_write() -> Self
pub fn read_write() -> Self
read + write.
Sourcepub fn create_new(self, yes: bool) -> Self
pub fn create_new(self, yes: bool) -> Self
Builder-style toggle for create_new.
Trait Implementations§
Source§impl Clone for OpenOptions
impl Clone for OpenOptions
Source§fn clone(&self) -> OpenOptions
fn clone(&self) -> OpenOptions
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 OpenOptions
Source§impl Debug for OpenOptions
impl Debug for OpenOptions
Source§impl Default for OpenOptions
impl Default for OpenOptions
Source§impl<'de> Deserialize<'de> for OpenOptions
impl<'de> Deserialize<'de> for OpenOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for OpenOptions
impl RefUnwindSafe for OpenOptions
impl Send for OpenOptions
impl Sync for OpenOptions
impl Unpin for OpenOptions
impl UnsafeUnpin for OpenOptions
impl UnwindSafe for OpenOptions
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