Struct didcomm_rs::AttachmentDataBuilder
source · [−]pub struct AttachmentDataBuilder { /* private fields */ }
Expand description
Builder for AttachmentData
Implementations
sourceimpl AttachmentDataBuilder
impl AttachmentDataBuilder
sourcepub fn with_hash(self, hash: &str) -> Self
pub fn with_hash(self, hash: &str) -> Self
[optional] The hash of the content encoded in multi-hash format. Used as an integrity check for the attachment, and MUST be used if the data is referenced via the links data attribute.
Parameters
hash
- String of hash to be attached
sourcepub fn with_link(self, link: &str) -> Self
pub fn with_link(self, link: &str) -> Self
[optional] A list of zero or more locations at which the content may be fetched. Adds one link into list of links. No uniqueness is guarranteed.
Parameters
link
- String representation of where to fetch the attachment
sourcepub fn with_raw_payload(self, payload: impl AsRef<[u8]>) -> Self
pub fn with_raw_payload(self, payload: impl AsRef<[u8]>) -> Self
Raw bytes of the payload to be attached - will be BASE64URL encoded before attaching.
Parameters
payload
- set of bytes to be attached as payload
sourcepub fn with_encoded_payload(self, payload: &str) -> Self
pub fn with_encoded_payload(self, payload: &str) -> Self
Same as with_raw_payload
, but data is already encoded
Parameters
payload
- BASE64URL encoded bytes of payload
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for AttachmentDataBuilder
impl Send for AttachmentDataBuilder
impl Sync for AttachmentDataBuilder
impl Unpin for AttachmentDataBuilder
impl UnwindSafe for AttachmentDataBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more