pub trait ChunkedClient: ExtensionClient<ChunkedExtension> + FilesystemClient {
// Provided methods
fn start_chunked_write(
&mut self,
location: Location,
path: PathBuf,
user_attribute: Option<UserAttribute>,
) -> ChunkedResult<'_, StartChunkedWrite, Self> { ... }
fn start_encrypted_chunked_write(
&mut self,
location: Location,
path: PathBuf,
key: KeyId,
nonce: Option<ByteArray<CHACHA8_STREAM_NONCE_LEN>>,
user_attribute: Option<UserAttribute>,
) -> ChunkedResult<'_, StartEncryptedChunkedWrite, Self> { ... }
fn start_chunked_read(
&mut self,
location: Location,
path: PathBuf,
) -> ChunkedResult<'_, StartChunkedRead, Self> { ... }
fn start_encrypted_chunked_read(
&mut self,
location: Location,
path: PathBuf,
key: KeyId,
) -> ChunkedResult<'_, StartEncryptedChunkedRead, Self> { ... }
fn write_file_chunk(
&mut self,
data: Message,
) -> ChunkedResult<'_, WriteChunk, Self> { ... }
fn abort_chunked_write(
&mut self,
) -> ChunkedResult<'_, AbortChunkedWrite, Self> { ... }
fn read_file_chunk(&mut self) -> ChunkedResult<'_, ReadChunk, Self> { ... }
fn partial_read_file(
&mut self,
location: Location,
path: PathBuf,
offset: usize,
length: usize,
) -> ChunkedResult<'_, PartialReadFile, Self> { ... }
fn append_file(
&mut self,
location: Location,
path: PathBuf,
data: Message,
) -> ChunkedResult<'_, AppendFile, Self> { ... }
}Provided Methods§
Sourcefn start_chunked_write(
&mut self,
location: Location,
path: PathBuf,
user_attribute: Option<UserAttribute>,
) -> ChunkedResult<'_, StartChunkedWrite, Self>
fn start_chunked_write( &mut self, location: Location, path: PathBuf, user_attribute: Option<UserAttribute>, ) -> ChunkedResult<'_, StartChunkedWrite, Self>
Begin writing a file that can be larger than 1KiB
More chunks can be written with write_file_chunk.
The data is flushed and becomes readable when a chunk smaller than the maximum capacity of a Message is transfered.
Sourcefn start_encrypted_chunked_write(
&mut self,
location: Location,
path: PathBuf,
key: KeyId,
nonce: Option<ByteArray<CHACHA8_STREAM_NONCE_LEN>>,
user_attribute: Option<UserAttribute>,
) -> ChunkedResult<'_, StartEncryptedChunkedWrite, Self>
fn start_encrypted_chunked_write( &mut self, location: Location, path: PathBuf, key: KeyId, nonce: Option<ByteArray<CHACHA8_STREAM_NONCE_LEN>>, user_attribute: Option<UserAttribute>, ) -> ChunkedResult<'_, StartEncryptedChunkedWrite, Self>
Begin writing an encrypted file that can be larger than 1KiB
More chunks can be written with write_file_chunk.
The data is flushed and becomes readable when a chunk smaller than the maximum capacity of a Message is transfered.
Sourcefn start_chunked_read(
&mut self,
location: Location,
path: PathBuf,
) -> ChunkedResult<'_, StartChunkedRead, Self>
fn start_chunked_read( &mut self, location: Location, path: PathBuf, ) -> ChunkedResult<'_, StartChunkedRead, Self>
Begin reading a file that can be larger than 1KiB
More chunks can be read with read_file_chunk.
The read is over once a chunk of size smaller than the maximum capacity of a Message is transfered.
Sourcefn start_encrypted_chunked_read(
&mut self,
location: Location,
path: PathBuf,
key: KeyId,
) -> ChunkedResult<'_, StartEncryptedChunkedRead, Self>
fn start_encrypted_chunked_read( &mut self, location: Location, path: PathBuf, key: KeyId, ) -> ChunkedResult<'_, StartEncryptedChunkedRead, Self>
Begin reading an encrypted file that can be larger than 1KiB
More chunks can be read with read_file_chunk.
The read is over once a chunk of size smaller than the maximum capacity of a Message is transfered.
Only once the entire file has been read does the data have been properly authenticated.
Sourcefn write_file_chunk(
&mut self,
data: Message,
) -> ChunkedResult<'_, WriteChunk, Self>
fn write_file_chunk( &mut self, data: Message, ) -> ChunkedResult<'_, WriteChunk, Self>
Write part of a file
See start_chunked_write.
Sourcefn abort_chunked_write(&mut self) -> ChunkedResult<'_, AbortChunkedWrite, Self>
fn abort_chunked_write(&mut self) -> ChunkedResult<'_, AbortChunkedWrite, Self>
Abort writes to a file opened with start_chunked_write.
fn read_file_chunk(&mut self) -> ChunkedResult<'_, ReadChunk, Self>
Sourcefn partial_read_file(
&mut self,
location: Location,
path: PathBuf,
offset: usize,
length: usize,
) -> ChunkedResult<'_, PartialReadFile, Self>
fn partial_read_file( &mut self, location: Location, path: PathBuf, offset: usize, length: usize, ) -> ChunkedResult<'_, PartialReadFile, Self>
Partially read a file from a given offset, returning a chunk of the given length and the total file size.
If the length is greater than trussed_core::config::MAX_MESSAGE_LENGTH or if the offset is
greater than the file size, an error is returned.
Sourcefn append_file(
&mut self,
location: Location,
path: PathBuf,
data: Message,
) -> ChunkedResult<'_, AppendFile, Self>
fn append_file( &mut self, location: Location, path: PathBuf, data: Message, ) -> ChunkedResult<'_, AppendFile, Self>
Append data to an existing file and return the size of the file after the write.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.