Skip to main content

AnnotationSubtype

Enum AnnotationSubtype 

Source
#[non_exhaustive]
pub enum AnnotationSubtype { Link { target: Option<AnnotationTarget>, highlight: Option<LinkHighlight>, }, Text { open: bool, icon: TextAnnotationIcon, }, FreeText { default_appearance: Option<String>, quadding: Option<u32>, }, Widget(WidgetAnnotation), }
Expand description

Per-subtype annotation payload. Each variant carries the keys specific to that subtype; shared keys (rect, color, border, title, contents, page) live on the parent AnnotationRecord.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

/Subtype /Link — clickable region. Target is an action, explicit page+view, or a named destination; exactly one of the three is expected.

Fields

§highlight: Option<LinkHighlight>

/H highlight mode: /N (none), /I (invert), /O (outline), /P (push). Optional.

§

Text

/Subtype /Text — sticky-note annotation.

Fields

§open: bool

/Open (boolean, default false).

§icon: TextAnnotationIcon

/Name icon — /Comment, /Note (default), /Key, /Help, /NewParagraph, /Paragraph, /Insert.

§

FreeText

/Subtype /FreeText — free-floating text annotation rendered directly on the page.

Fields

§default_appearance: Option<String>

/DA default appearance string. Optional but most viewers require it to render anything; if absent, stet emits a sane default (0 0 0 rg /Helv 10 Tf).

§quadding: Option<u32>

/Q quadding: 0=left, 1=center, 2=right. Optional.

§

Widget(WidgetAnnotation)

/Subtype /Widget — interactive form field. Author-only: stet doesn’t render or run forms interactively, but it emits the PDF AcroForm structure so downstream viewers (Acrobat, Okular, pdf.js) can. The widget annotation and its leaf field dict are merged into a single PDF object — common when a field has exactly one widget — and the field-tree builder in crates/stet-pdf/src/form_fields.rs handles the multi-widget (radio group) and dotted-name parent cases.

Trait Implementations§

Source§

impl Clone for AnnotationSubtype

Source§

fn clone(&self) -> AnnotationSubtype

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AnnotationSubtype

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.