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 more