pub struct CreateOptions { /* private fields */ }Expand description
Options for a safe first commit with DocumentFile::create_atomic.
Implementations§
Source§impl CreateOptions
impl CreateOptions
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Create with no-clobber semantics and unix mode 0o600 for a new file.
Replacing an existing target preserves that target’s mode unless
unix_mode asks for a specific one.
Sourcepub const fn unix_mode(self, unix_mode: u32) -> Self
pub const fn unix_mode(self, unix_mode: u32) -> Self
Set the target’s unix permission bits.
The value must contain only the low 0o777 permission bits. It is
ignored on non-unix platforms. Setting it explicitly also applies the
mode when replacing an existing file, which otherwise keeps its own.
Sourcepub const fn replace(self) -> Self
pub const fn replace(self) -> Self
Explicitly allow an existing target to be atomically replaced.
Sourcepub const fn mode(&self) -> CreateMode
pub const fn mode(&self) -> CreateMode
The configured target-existence behavior.
Sourcepub const fn configured_unix_mode(&self) -> Option<u32>
pub const fn configured_unix_mode(&self) -> Option<u32>
The explicitly configured unix permission bits, if any.
None means “0o600 when creating, and keep the existing mode when
replacing”.
Trait Implementations§
Source§impl Clone for CreateOptions
impl Clone for CreateOptions
Source§fn clone(&self) -> CreateOptions
fn clone(&self) -> CreateOptions
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 CreateOptions
Source§impl Debug for CreateOptions
impl Debug for CreateOptions
Source§impl Default for CreateOptions
impl Default for CreateOptions
impl Eq for CreateOptions
Source§impl PartialEq for CreateOptions
impl PartialEq for CreateOptions
impl StructuralPartialEq for CreateOptions
Auto Trait Implementations§
impl Freeze for CreateOptions
impl RefUnwindSafe for CreateOptions
impl Send for CreateOptions
impl Sync for CreateOptions
impl Unpin for CreateOptions
impl UnsafeUnpin for CreateOptions
impl UnwindSafe for CreateOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.