Trait rsvg::element::ElementTrait

source ·
pub trait ElementTrait {
    // Provided methods
    fn set_attributes(&mut self, _attributes: &Attributes, _session: &Session) { ... }
    fn draw(
        &self,
        _node: &Node<NodeData>,
        _acquired_nodes: &mut AcquiredNodes<'_>,
        _cascaded: &CascadedValues<'_>,
        _viewport: &Viewport,
        draw_ctx: &mut DrawingCtx,
        _clipping: bool,
    ) -> Result<BoundingBox, InternalRenderingError> { ... }
    fn layout(
        &self,
        _node: &Node<NodeData>,
        _acquired_nodes: &mut AcquiredNodes<'_>,
        _cascaded: &CascadedValues<'_>,
        _viewport: &Viewport,
        _draw_ctx: &mut DrawingCtx,
        _clipping: bool,
    ) -> Result<Option<Layer>, InternalRenderingError> { ... }
}

Provided Methods§

source

fn set_attributes(&mut self, _attributes: &Attributes, _session: &Session)

Sets per-element attributes.

Each element is supposed to iterate the attributes, and parse any ones it needs. SVG specifies that unknown attributes should be ignored, and known attributes with invalid values should be ignored so that the attribute ends up with its “initial value”.

You can use the set_attribute function to do that.

source

fn draw( &self, _node: &Node<NodeData>, _acquired_nodes: &mut AcquiredNodes<'_>, _cascaded: &CascadedValues<'_>, _viewport: &Viewport, draw_ctx: &mut DrawingCtx, _clipping: bool, ) -> Result<BoundingBox, InternalRenderingError>

Draw an element.

Each element is supposed to draw itself as needed.

source

fn layout( &self, _node: &Node<NodeData>, _acquired_nodes: &mut AcquiredNodes<'_>, _cascaded: &CascadedValues<'_>, _viewport: &Viewport, _draw_ctx: &mut DrawingCtx, _clipping: bool, ) -> Result<Option<Layer>, InternalRenderingError>

Create a layout object for the current element.

This resolves property values, coordinates, lengths, etc. and produces a layout item for rendering.

Implementors§

source§

impl ElementTrait for Filter

source§

impl ElementTrait for FeBlend

source§

impl ElementTrait for FeColorMatrix

source§

impl ElementTrait for FeComponentTransfer

source§

impl ElementTrait for FeFuncA

source§

impl ElementTrait for FeFuncB

source§

impl ElementTrait for FeFuncG

source§

impl ElementTrait for FeFuncR

source§

impl ElementTrait for FeComposite

source§

impl ElementTrait for FeConvolveMatrix

source§

impl ElementTrait for FeDisplacementMap

source§

impl ElementTrait for FeDropShadow

source§

impl ElementTrait for FeFlood

source§

impl ElementTrait for FeGaussianBlur

source§

impl ElementTrait for FeImage

source§

impl ElementTrait for FeDiffuseLighting

source§

impl ElementTrait for FeDistantLight

source§

impl ElementTrait for FePointLight

source§

impl ElementTrait for FeSpecularLighting

source§

impl ElementTrait for FeSpotLight

source§

impl ElementTrait for FeMerge

source§

impl ElementTrait for FeMergeNode

source§

impl ElementTrait for FeMorphology

source§

impl ElementTrait for FeOffset

source§

impl ElementTrait for FeTile

source§

impl ElementTrait for FeTurbulence

source§

impl ElementTrait for LinearGradient

source§

impl ElementTrait for RadialGradient

source§

impl ElementTrait for Stop

source§

impl ElementTrait for Image

source§

impl ElementTrait for Marker

source§

impl ElementTrait for Pattern

source§

impl ElementTrait for Circle

source§

impl ElementTrait for Ellipse

source§

impl ElementTrait for Line

source§

impl ElementTrait for Path

source§

impl ElementTrait for Polygon

source§

impl ElementTrait for Polyline

source§

impl ElementTrait for Rect

source§

impl ElementTrait for ClipPath

source§

impl ElementTrait for Group

source§

impl ElementTrait for Mask

source§

impl ElementTrait for NonRendering

source§

impl ElementTrait for Svg

source§

impl ElementTrait for Switch

source§

impl ElementTrait for Symbol

source§

impl ElementTrait for Use

source§

impl ElementTrait for Style

source§

impl ElementTrait for TRef

source§

impl ElementTrait for TSpan

source§

impl ElementTrait for Text