Struct rsvg::document::Document

source ·
pub struct Document {
    tree: Node<NodeData>,
    session: Session,
    ids: HashMap<String, Node<NodeData>>,
    externs: RefCell<Resources>,
    images: RefCell<Images>,
    load_options: Arc<LoadOptions>,
    stylesheets: Vec<Stylesheet>,
}
Expand description

A loaded SVG file and its derived data.

Fields§

§tree: Node<NodeData>

Tree of nodes; the root is guaranteed to be an <svg> element.

§session: Session

Metadata about the SVG handle.

§ids: HashMap<String, Node<NodeData>>

Mapping from id attributes to nodes.

§externs: RefCell<Resources>

SVG documents referenced from this document.

§images: RefCell<Images>

Image resources referenced from this document.

§load_options: Arc<LoadOptions>

Used to load referenced resources.

§stylesheets: Vec<Stylesheet>

Stylesheets defined in the document.

Implementations§

Constructs a Document by loading it from a stream.

Gets the root node. This is guaranteed to be an <svg> element.

Looks up a node in this document or one of its resources by its id attribute.

Looks up a node in this document by its id attribute.

Loads an image by URL, or returns a pre-loaded one.

Runs the CSS cascade on the document tree

This uses the default UserAgent stylesheet, the document’s internal stylesheets, plus an extra set of stylesheets supplied by the caller.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Checks if self is actually part of its subset T (and can be converted to it).
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
The inclusion map: converts self to the equivalent element of its superset.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.