pub struct Content<T> {
pub object: T,
pub state: GraphicsState,
pub marks: ContentMarks,
pub content_stream: Option<usize>,
pub dirty: bool,
pub active: bool,
}Expand description
A page object with the state and marks it was created under.
Fields§
§object: TThe object itself.
state: GraphicsStateThe graphics state in force at its creation.
marks: ContentMarksThe marked-content sequence enclosing it.
content_stream: Option<usize>Which /Contents element it came from, for the editor, or None for
an object that was created rather than parsed.
None sorts before Some(0) — Option’s own Ord — which is what
gives a brand-new object the lowest free /Contents index in the
regenerator’s ordered walk rather than one past the end.
dirty: boolWhether the object has been changed since it was parsed, so its
content stream must be written again on save
(see PageObject::set_active).
active: boolWhether the object is painted. An inactive object keeps its place in the list but contributes nothing to a regenerated stream.
Implementations§
Source§impl<T> Content<T>
impl<T> Content<T>
Sourcepub fn new(object: T, state: GraphicsState) -> Self
pub fn new(object: T, state: GraphicsState) -> Self
A newly created object, under state and enclosed by no marks.
It arrives dirty and streamless, which is what a created object is: it describes no bytes yet, so the stream it lands in has to be written for it to exist at all. An object the interpreter produced from bytes is built field-by-field instead, because it is neither.