pub struct AttachmentBuilder<'a> { /* private fields */ }Expand description
A Type that knows how to construct an Attachment.
Implementations§
Source§impl<'a> AttachmentBuilder<'a>
impl<'a> AttachmentBuilder<'a>
Sourcepub fn usage_type(self, val: &'a str) -> Result<Self, DataError>
pub fn usage_type(self, val: &'a str) -> Result<Self, DataError>
Set the usage_type field.
Raise DataError if the input string is empty or when parsed as an IRI yields an invalid value.
Sourcepub fn display(
self,
tag: &MyLanguageTag,
label: &str,
) -> Result<Self, DataError>
pub fn display( self, tag: &MyLanguageTag, label: &str, ) -> Result<Self, DataError>
Add label tagged by the language tag to the display dictionary.
Raise DataError if the tag was empty or invalid.
Sourcepub fn with_display(self, map: LanguageMap) -> Result<Self, DataError>
pub fn with_display(self, map: LanguageMap) -> Result<Self, DataError>
Set (as in replace) the display property for the instance being built
w/ the one passed as argument.
Sourcepub fn description(
self,
tag: &MyLanguageTag,
label: &str,
) -> Result<Self, DataError>
pub fn description( self, tag: &MyLanguageTag, label: &str, ) -> Result<Self, DataError>
Add label tagged by the language tag to the description dictionary.
Raise DataError if the tag was empty or invalid.
Sourcepub fn with_description(self, map: LanguageMap) -> Result<Self, DataError>
pub fn with_description(self, map: LanguageMap) -> Result<Self, DataError>
Set (as in replace) the description property for the instance being built
w/ the one passed as argument.
Sourcepub fn content_type(self, val: &str) -> Result<Self, DataError>
pub fn content_type(self, val: &str) -> Result<Self, DataError>
Set the content_type field.
Raise DataError if the input string is empty, or is not a valid MIME type string.
Sourcepub fn sha2(self, val: &'a str) -> Result<Self, DataError>
pub fn sha2(self, val: &'a str) -> Result<Self, DataError>
Set the sha2 field.
Raise DataError if the input string is empty, has the wrong number of characters, or contains non-hexadecimal characters.
Sourcepub fn file_url(self, val: &'a str) -> Result<Self, DataError>
pub fn file_url(self, val: &'a str) -> Result<Self, DataError>
Set the file_url field.
Raise DataError if the input string is empty, an error occurs while parsing it as an IRI, or the resulting IRI is an invalid URL.
Sourcepub fn build(&self) -> Result<Attachment, DataError>
pub fn build(&self) -> Result<Attachment, DataError>
Create an Attachment instance from set field values.
Raise a DataError if any required field is missing.