pub struct File { /* private fields */ }Expand description
Metadata of a file stored in B2.
Implementations
sourceimpl File
impl File
sourcepub fn action(&self) -> FileAction
pub fn action(&self) -> FileAction
The action taken to result in this File.
sourcepub fn content_length(&self) -> Option<u64>
pub fn content_length(&self) -> Option<u64>
The number of bytes stored in the file.
Only meaningful when the action is FileAction::Upload
or FileAction::Copy; otherwise the value is None.
sourcepub fn sha1_checksum(&self) -> Option<&String>
pub fn sha1_checksum(&self) -> Option<&String>
The SHA-1 checksum of the bytes in the file.
There is no checksum for large files or when the action is FileAction::Hide or FileAction::Folder.
sourcepub fn md5_checksum(&self) -> Option<&String>
pub fn md5_checksum(&self) -> Option<&String>
The MD5 checksum of the bytes in the file.
There is no checksum for large files or when the action is FileAction::Hide or FileAction::Folder.
sourcepub fn content_type(&self) -> Option<&String>
pub fn content_type(&self) -> Option<&String>
When action is FileAction::Upload, FileAction::Start, or FileAction::Copy, the file’s MIME type.
sourcepub fn file_retention(&self) -> Option<&FileRetention>
pub fn file_retention(&self) -> Option<&FileRetention>
The file’s retention policy.
sourcepub fn has_legal_hold<E>(&self) -> Result<Option<bool>, Error<E>> where
E: Debug + Display,
pub fn has_legal_hold<E>(&self) -> Result<Option<bool>, Error<E>> where
E: Debug + Display,
See if there is a legal hold on this file.
Returns an error if the Authorization does not have Capability::ReadFileLegalHolds.
Returns None if a legal hold is not valid for the file type (e.g., the
action is hide or folder).
sourcepub fn encryption_settings(&self) -> Option<&ServerSideEncryption>
pub fn encryption_settings(&self) -> Option<&ServerSideEncryption>
The encryption settings for the file.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for File
impl<'de> Deserialize<'de> for File
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnwindSafe for File
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