ChunkedClient

Trait ChunkedClient 

Source
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§

Source

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.

Source

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.

Source

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.

Source

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.

Source

fn write_file_chunk( &mut self, data: Message, ) -> ChunkedResult<'_, WriteChunk, Self>

Write part of a file

See start_chunked_write.

Source

fn abort_chunked_write(&mut self) -> ChunkedResult<'_, AbortChunkedWrite, Self>

Abort writes to a file opened with start_chunked_write.

Source

fn read_file_chunk(&mut self) -> ChunkedResult<'_, ReadChunk, Self>

Source

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.

Source

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.

Implementors§