Enum dropbox_sdk::files::WriteMode
source · [−]pub enum WriteMode {
Add,
Overwrite,
Update(Rev),
}
dbx_files
only.Expand description
Your intent when writing a file to some path. This is used to determine what constitutes a conflict and what the autorename strategy is. In some situations, the conflict behavior is identical: (a) If the target path doesn’t refer to anything, the file is always written; no conflict. (b) If the target path refers to a folder, it’s always a conflict. (c) If the target path refers to a file with identical contents, nothing gets written; no conflict. The conflict checking differs in the case where there’s a file at the target path with contents different from the contents you’re trying to write.
Variants
Add
Do not overwrite an existing file if there is a conflict. The autorename strategy is to append a number to the file name. For example, “document.txt” might become “document (2).txt”.
Overwrite
Always overwrite the existing file. The autorename strategy is the same as it is for
Add
.
Update(Rev)
Overwrite if the given “rev” matches the existing file’s “rev”. The supplied value should be
the latest known “rev” of the file, for example, from FileMetadata
, from
when the file was last downloaded by the app. This will cause the file on the Dropbox
servers to be overwritten if the given “rev” matches the existing file’s current “rev” on
the Dropbox servers. The autorename strategy is to append the string “conflicted copy” to
the file name. For example, “document.txt” might become “document (conflicted copy).txt” or
“document (Panda’s conflicted copy).txt”.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for WriteMode
impl<'de> Deserialize<'de> for WriteMode
sourcefn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for WriteMode
Auto Trait Implementations
impl RefUnwindSafe for WriteMode
impl Send for WriteMode
impl Sync for WriteMode
impl Unpin for WriteMode
impl UnwindSafe for WriteMode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more