Enum iroh_blobs::store::ImportMode
source · pub enum ImportMode {
Copy,
TryReference,
}
Expand description
The import mode describes how files will be imported.
This is a hint to the import trait method. For some implementations, this
does not make any sense. E.g. an in memory implementation will always have
to copy the file into memory. Also, a disk based implementation might choose
to copy small files even if the mode is Reference
.
Variants§
Copy
This mode will copy the file into the database before hashing.
This is the safe default because the file can not be accidentally modified after it has been imported.
TryReference
This mode will try to reference the file in place and assume it is unchanged after import.
This has a large performance and storage benefit, but it is less safe since the file might be modified after it has been imported.
Stores are allowed to ignore this mode and always copy the file, e.g. if the file is very small or if the store does not support referencing files.
Trait Implementations§
source§impl Clone for ImportMode
impl Clone for ImportMode
source§fn clone(&self) -> ImportMode
fn clone(&self) -> ImportMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ImportMode
impl Debug for ImportMode
source§impl Default for ImportMode
impl Default for ImportMode
source§fn default() -> ImportMode
fn default() -> ImportMode
source§impl<'de> Deserialize<'de> for ImportMode
impl<'de> Deserialize<'de> for ImportMode
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>,
source§impl PartialEq for ImportMode
impl PartialEq for ImportMode
source§fn eq(&self, other: &ImportMode) -> bool
fn eq(&self, other: &ImportMode) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for ImportMode
impl Serialize for ImportMode
impl Copy for ImportMode
impl Eq for ImportMode
impl StructuralPartialEq for ImportMode
Auto Trait Implementations§
impl Freeze for ImportMode
impl RefUnwindSafe for ImportMode
impl Send for ImportMode
impl Sync for ImportMode
impl Unpin for ImportMode
impl UnwindSafe for ImportMode
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.