pub struct File { /* private fields */ }
Expand description
Metadata of a file stored in B2.
Implementations§
Source§impl 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>>
pub fn has_legal_hold<E>(&self) -> Result<Option<bool>, Error<E>>
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.