pub struct Visibility { /* private fields */ }Expand description
Which of a page’s objects optional content hides, shaped like the page.
§Why a tree and not a set of ids
A page object has no id. The graph is Vec<PageObject> with a form’s
children nested inside it, so the only thing that names an object is its
position — and that is exactly what this mirrors: hidden[i] answers for
objects[i], and a form’s children answer for that form’s own list.
Walking the two together costs one index per object and needs no identity
the page graph does not have.
An empty tree means nothing is hidden, which is what a document with no
/OCProperties produces and what Visibility::shows_everything reports,
so a renderer can skip the descent entirely.
Implementations§
Source§impl Visibility
impl Visibility
Sourcepub fn all_visible() -> Self
pub fn all_visible() -> Self
Nothing hidden, for a document with no optional content.
Sourcepub fn shows_everything(&self) -> bool
pub fn shows_everything(&self) -> bool
Whether this tree hides nothing anywhere beneath it.
A renderer can take this as licence to stop descending: an empty tree
is the answer for a page with no optional content at all, and
Self::visible already reports an absent entry as visible.
Sourcepub fn visible(&self, index: usize) -> bool
pub fn visible(&self, index: usize) -> bool
Whether the object at index is drawn.
An index this tree does not cover is visible. That is not
permissiveness for its own sake: it is what makes all_visible() an
empty tree rather than a vector of true, and it means a caller
whose object list has grown since the pre-pass ran draws the new
objects rather than silently dropping them.
Trait Implementations§
Source§impl Clone for Visibility
impl Clone for Visibility
Source§fn clone(&self) -> Visibility
fn clone(&self) -> Visibility
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more