pub struct WriteOptions {
pub block_size: Option<u64>,
pub replication: Option<u32>,
pub permission: u32,
pub overwrite: bool,
pub create_parent: bool,
}
Fields§
§block_size: Option<u64>
Block size. Default is retrieved from the server.
replication: Option<u32>
Replication factor. Default is retrieved from the server.
permission: u32
Unix file permission, defaults to 0o644, which is “rw-r–r–” as a Unix permission. This is the raw octal value represented in base 10.
overwrite: bool
Whether to overwrite the file, defaults to false. If true and the file does not exist, it will result in an error.
create_parent: bool
Whether to create any missing parent directories, defaults to true. If false and the parent directory does not exist, an error will be returned.
Implementations§
Source§impl WriteOptions
impl WriteOptions
Sourcepub fn block_size(self, block_size: u64) -> Self
pub fn block_size(self, block_size: u64) -> Self
Set the block_size for the new file
Sourcepub fn replication(self, replication: u32) -> Self
pub fn replication(self, replication: u32) -> Self
Set the replication for the new file
Sourcepub fn permission(self, permission: u32) -> Self
pub fn permission(self, permission: u32) -> Self
Set the raw octal permission value for the new file
Sourcepub fn create_parent(self, create_parent: bool) -> Self
pub fn create_parent(self, create_parent: bool) -> Self
Set whether to create all missing parent directories
Trait Implementations§
Source§impl AsRef<WriteOptions> for WriteOptions
impl AsRef<WriteOptions> for WriteOptions
Source§fn as_ref(&self) -> &WriteOptions
fn as_ref(&self) -> &WriteOptions
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for WriteOptions
impl Clone for WriteOptions
Source§fn clone(&self) -> WriteOptions
fn clone(&self) -> WriteOptions
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for WriteOptions
impl RefUnwindSafe for WriteOptions
impl Send for WriteOptions
impl Sync for WriteOptions
impl Unpin for WriteOptions
impl UnwindSafe for WriteOptions
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)