Skip to main content

Crate xmtp_attachments

Crate xmtp_attachments 

Source
Expand description

Streaming remote attachment primitives.

Structs§

AttachmentDecoder
Parses a protobuf envelope across arbitrary chunk boundaries.
AttachmentError
An attachment failure with a stable cause.
AttachmentOptions
Transfer limits. The caller supplies the snapshot default in get.
DecodedMeta
Metadata of an attachment envelope.
GcmDecryptor
Decrypts chunks while retaining the final 16 bytes as the tag.
GcmEncryptor
Encrypts chunks and returns the tag after the final chunk.
KeyMaterial
The random values used by the attachment encryption scheme.
NativeStore
Files below one native attachments directory.
StagedFile
A staged file that can be uploaded without loading it into memory.
StoreFile
A file found during attachment storage reconciliation.
StoreRemoveError
A directory removal that failed.
StoreWriter
A writable file used as the sink for a download.
Transfer
Native HTTP transfer. Downloads check each connected address.
UploadRequest
Values from the backend’s signed upload response.

Enums§

AttachmentFailureCause
Stable cause of an attachment failure.
ContentChunk
Content events returned by the streaming attachment decoder.
PutOutcome
StoreMoveError
The result of a move that must not replace an existing file.

Traits§

DownloadSink
LocalStore

Functions§

attachment_key
Hash all key material to name the local attachment directory.
check_content_url
Check a published content URL without DNS or transfer policy.
ciphertext_len
create_private_directory
Create missing directory components with private permissions. Existing directories keep their permissions.
download_cap
Compute the bound before a download starts.
download_url
Append a ciphertext digest to the configured base URL.
encoded_prefix
Encode the protobuf fields before the attachment content.
local_file_name
Apply the file name table to an optional remote name.
plaintext_rel_path
Derive the relative plaintext path without reading storage or a network.
remote_attachment
Build the metadata published for a staged ciphertext.
retained_fields_fit
Check the fields that the streaming decoder keeps before content bytes. This uses the same envelope as encoded_prefix and the decoder’s limit.
sanitize_path_component
Apply steps 2 to 8 of the file name table to a path component.
sanitize_path_component_with_limit
Apply the file name table with a caller-selected UTF-8 byte limit.
staged_path
A path for staged ciphertext. It cannot collide with an attachment key.
temporary_path
A path for a temporary file. Temporary files never sit under key directories.