Skip to main content

WidgetAnnotation

Struct WidgetAnnotation 

Source
pub struct WidgetAnnotation {
    pub field_name: String,
    pub field_type: Option<FieldType>,
    pub value: Option<FieldValue>,
    pub default_value: Option<FieldValue>,
    pub flags: Option<i32>,
    pub max_len: Option<i32>,
    pub options: Option<Vec<ChoiceOption>>,
    pub quadding: Option<i32>,
    pub default_appearance: Option<String>,
}
Expand description

/Widget annotation payload — also acts as the field dict when the widget is a single-leaf field (the common case). Multiple widgets sharing the same dotted field_name become /Kids of an implicit parent field at write time (radio groups).

Fields§

§field_name: String

/T — fully qualified field name. Dot-separated segments imply nesting (order.shipping.street → parents orderorder.shipping and a leaf street). The PDF emitter renders only the last segment as /T; PDF resolves the full name by walking the /Parent chain.

§field_type: Option<FieldType>

/FT field type. Optional — when absent the field inherits its type from the parent. Required on root fields.

§value: Option<FieldValue>

/V field value — variant shape depends on /FT. Optional.

§default_value: Option<FieldValue>

/DV default value — same shape rules as value.

§flags: Option<i32>

/Ff field flags (PDF 1.7 spec § 12.7.3.1). Bit semantics vary by /FT; passed through verbatim.

§max_len: Option<i32>

/MaxLen — text-field-only character limit.

§options: Option<Vec<ChoiceOption>>

/Opt — choice-field options. Each entry is either a single display string (export = display) or [export display] pair.

§quadding: Option<i32>

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

§default_appearance: Option<String>

/DA default appearance string. Falls back to the form-level /DA (or 0 0 0 rg /Helv 10 Tf when neither is set) at write time.

Trait Implementations§

Source§

impl Clone for WidgetAnnotation

Source§

fn clone(&self) -> WidgetAnnotation

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 WidgetAnnotation

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for WidgetAnnotation

Source§

fn default() -> WidgetAnnotation

Returns the “default value” for a type. 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.