pub struct LayerSet { /* private fields */ }Expand description
Per-render override of OCG visibility.
An OCG with no entry here falls back to its display-list-baked
default_visible. Entries are explicit bools so a consumer can
override a layer in either direction.
Implementations§
Source§impl LayerSet
impl LayerSet
Sourcepub fn get(&self, ocg_id: u32) -> Option<bool>
pub fn get(&self, ocg_id: u32) -> Option<bool>
Get the explicit override for an OCG, if any. None means the
renderer should fall back to default_visible.
Sourcepub fn evaluate(&self, vis: &OcgVisibility) -> bool
pub fn evaluate(&self, vis: &OcgVisibility) -> bool
Evaluate an OcgVisibility predicate.
Each variant’s default_visible is the renderer’s fallback
for the whole group when this LayerSet has no opinion on
any of its leaves. Specifically:
Single→ consult the LayerSet forocg_id; fall back todefault_visible.Membership/Expression→ if none of the relevant leaves are overridden by this LayerSet, returndefault_visibledirectly. This is the “consumer has no opinion at all” path and preserves byte-identity for OCMD defaults baked at parse time.- With at least one leaf overridden, evaluate the policy or
expression: overridden leaves use their override value,
missing leaves fall back to the variant’s
default_visible.
Sourcepub fn enforce_rb_group(&mut self, group: &[u32], newly_on: u32)
pub fn enforce_rb_group(&mut self, group: &[u32], newly_on: u32)
Apply a radio-button-group constraint: when one layer in the
group is turned ON, all the others get explicitly turned OFF.
newly_on is left ON.
Layers in group other than newly_on are explicitly forced
OFF (they get an entry in this set, not just a missing entry).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LayerSet
impl RefUnwindSafe for LayerSet
impl Send for LayerSet
impl Sync for LayerSet
impl Unpin for LayerSet
impl UnsafeUnpin for LayerSet
impl UnwindSafe for LayerSet
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more