Skip to main content

OcState

Struct OcState 

Source
pub struct OcState { /* private fields */ }
Expand description

The document’s optional-content visibility under its default configuration (/OCProperties /D, ISO 32000-1 §8.11.4.3): the set of groups that configuration turns off. A group’s identity is its indirect reference — groups are shared by reference between the configuration, marked-content properties, and /OC entries (§8.11.2.1).

Everything here is lenient: an entry that is missing, malformed, or will not resolve leaves content visible, never hidden.

Implementations§

Source§

impl OcState

Source

pub async fn load_with<S: AsyncObjectSource>( src: &S, trailer: &Dict, ) -> Option<OcState>

Builds the state from the catalog’s /OCProperties, or None when the document declares none — no optional content, everything visible. The default /D configuration is applied in specification order: /BaseState (default ON), then /ON, then /OFF, so a group named in both /ON and /OFF ends up off.

Source

pub fn hidden(&self, group: ObjRef) -> bool

Whether the configuration turns group off.

Source

pub async fn visible_with<S: AsyncObjectSource>( &self, src: &S, value: &Object, ) -> bool

Whether content gated by value — the operand of a stream or annotation dictionary’s /OC entry — is visible: a group reference is visible unless the group is off; a membership dictionary follows its /VE visibility expression, else its /P policy over /OCGs. A direct group dictionary has no reference identity to be turned off by, and anything malformed is left visible.

Source

pub async fn props_visible_with<S: AsyncObjectSource>( &self, src: &S, chain: &[Arc<Dict>], props: &Object, ) -> bool

Whether a BDC /OC span is visible: props is the operator’s properties operand — an inline dictionary, or a name looked up in the resource chain’s /Properties category. The lookup keeps the value unresolved, because a group’s on/off identity is its indirect reference; resolving first would read every named group as visible.

Trait Implementations§

Source§

impl Clone for OcState

Source§

fn clone(&self) -> OcState

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 OcState

Source§

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

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

impl Default for OcState

Source§

fn default() -> OcState

Returns the “default value” for a type. Read more
Source§

impl Eq for OcState

Source§

impl PartialEq for OcState

Source§

fn eq(&self, other: &OcState) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for OcState

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> 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.