pub struct AttachmentOptionsBuilder(/* private fields */);Expand description
Builds an AttachmentOptions a setting at a time.
The way to change one field from outside this crate: the type is
#[non_exhaustive], so struct-update syntax is a same-crate spelling.
Each method takes an impl Into<String>, so the Some(…into()) the
fields need is written once here rather than at every call site.
use pdfrum_edit::AttachmentOptions;
let options = AttachmentOptions::builder()
.description("The source data")
.mime_type("text/csv")
.build();
assert_eq!(options.description.as_deref(), Some("The source data"));
assert!(options.modified.is_none());Implementations§
Source§impl AttachmentOptionsBuilder
impl AttachmentOptionsBuilder
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
The text a viewer shows beside the name —
AttachmentOptions::description.
let options = pdfrum::AttachmentOptions::builder().description("notes").build();
assert_eq!(options.description.as_deref(), Some("notes"));Sourcepub fn mime_type(self, mime_type: impl Into<String>) -> Self
pub fn mime_type(self, mime_type: impl Into<String>) -> Self
The embedded file’s MIME type — AttachmentOptions::mime_type.
let options = pdfrum::AttachmentOptions::builder().mime_type("text/csv").build();
assert_eq!(options.mime_type.as_deref(), Some("text/csv"));Sourcepub fn modified(self, modified: impl Into<String>) -> Self
pub fn modified(self, modified: impl Into<String>) -> Self
The file’s modification time as a PDF date string —
AttachmentOptions::modified. pdf_date spells
a SystemTime that way.
let options = pdfrum::AttachmentOptions::builder()
.modified("D:20260906120000Z")
.build();
assert!(options.modified.is_some());Sourcepub fn build(self) -> AttachmentOptions
pub fn build(self) -> AttachmentOptions
The options as built.
let options = pdfrum::AttachmentOptions::builder().build();
assert_eq!(options, pdfrum::AttachmentOptions::default());Trait Implementations§
Source§impl Clone for AttachmentOptionsBuilder
impl Clone for AttachmentOptionsBuilder
Source§fn clone(&self) -> AttachmentOptionsBuilder
fn clone(&self) -> AttachmentOptionsBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AttachmentOptionsBuilder
impl Debug for AttachmentOptionsBuilder
Source§impl Default for AttachmentOptionsBuilder
impl Default for AttachmentOptionsBuilder
Source§fn default() -> AttachmentOptionsBuilder
fn default() -> AttachmentOptionsBuilder
Returns the “default value” for a type. Read more
impl Eq for AttachmentOptionsBuilder
Source§impl PartialEq for AttachmentOptionsBuilder
impl PartialEq for AttachmentOptionsBuilder
impl StructuralPartialEq for AttachmentOptionsBuilder
Auto Trait Implementations§
impl Freeze for AttachmentOptionsBuilder
impl RefUnwindSafe for AttachmentOptionsBuilder
impl Send for AttachmentOptionsBuilder
impl Sync for AttachmentOptionsBuilder
impl Unpin for AttachmentOptionsBuilder
impl UnsafeUnpin for AttachmentOptionsBuilder
impl UnwindSafe for AttachmentOptionsBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more