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§impl Debug for AttachmentOptionsBuilder
impl Debug for AttachmentOptionsBuilder
Source§impl Default for AttachmentOptionsBuilder
impl Default for AttachmentOptionsBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.