pub enum FileContent {
Embedded {
name: String,
mime: String,
buffer: SecretBox<Vec<u8>>,
checksum: [u8; 32],
},
External {
name: String,
mime: String,
checksum: [u8; 32],
size: u64,
path: Option<PathBuf>,
},
}Expand description
Variants for embedded and external file secrets.
Variants§
Embedded
Embedded file buffer.
Fields
checksum: [u8; 32]The SHA-256 digest of the buffer.
Using the SHA-256 digest allows the checksum to be computed using the Javascript SubtleCrypto API and in Dart using the crypto package.
This is used primarily during the public migration export to identify files that have been extracted to another location in the archive rather than embedding the binary data.
External
Encrypted data is stored in an external file.
Fields
checksum: [u8; 32]The SHA-256 digest of the buffer.
Using the SHA-256 digest allows the checksum to be computed using the Javascript SubtleCrypto API and in Dart using the crypto package.
This is used primarily during the public migration export to identify files that have been extracted to another location in the archive rather than embedding the binary data.
Implementations§
Trait Implementations§
Source§impl Clone for FileContent
impl Clone for FileContent
Source§fn clone(&self) -> FileContent
fn clone(&self) -> FileContent
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Decodable for FileContent
impl Decodable for FileContent
Source§fn decode<'life0, 'life1, 'async_trait, R>(
&'life0 mut self,
reader: &'life1 mut BinaryReader<R>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
R: 'async_trait + AsyncRead + AsyncSeek + Unpin + Send,
FileContent: 'async_trait,
fn decode<'life0, 'life1, 'async_trait, R>(
&'life0 mut self,
reader: &'life1 mut BinaryReader<R>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
R: 'async_trait + AsyncRead + AsyncSeek + Unpin + Send,
FileContent: 'async_trait,
Source§impl Default for FileContent
impl Default for FileContent
Source§fn default() -> FileContent
fn default() -> FileContent
Source§impl<'de> Deserialize<'de> for FileContent
impl<'de> Deserialize<'de> for FileContent
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FileContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FileContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Encodable for FileContent
impl Encodable for FileContent
Source§fn encode<'life0, 'life1, 'async_trait, W>(
&'life0 self,
writer: &'life1 mut BinaryWriter<W>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
W: 'async_trait + AsyncWrite + AsyncSeek + Unpin + Send,
FileContent: 'async_trait,
fn encode<'life0, 'life1, 'async_trait, W>(
&'life0 self,
writer: &'life1 mut BinaryWriter<W>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
W: 'async_trait + AsyncWrite + AsyncSeek + Unpin + Send,
FileContent: 'async_trait,
Source§impl PartialEq for FileContent
impl PartialEq for FileContent
Source§impl Serialize for FileContent
impl Serialize for FileContent
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for FileContent
impl RefUnwindSafe for FileContent
impl Send for FileContent
impl Sync for FileContent
impl Unpin for FileContent
impl UnwindSafe for FileContent
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more