Struct rsvg::css::RsvgElement

source ·
pub struct RsvgElement(Node<NodeData>);
Expand description

Newtype wrapper around Node so we can implement [selectors::Element] for it.

Node is an alias for rctree::Node, so we can’t implement selectors::Element directly on it. We implement it on the RsvgElement wrapper instead.

Tuple Fields§

§0: Node<NodeData>

Trait Implementations§

source§

impl Clone for RsvgElement

source§

fn clone(&self) -> RsvgElement

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RsvgElement

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Element for RsvgElement

source§

fn opaque(&self) -> OpaqueElement

Converts self into an opaque representation.

source§

fn parent_node_is_shadow_root(&self) -> bool

Whether the parent node of this element is a shadow root.

source§

fn containing_shadow_host(&self) -> Option<Self>

The host of the containing shadow root, if any.

source§

fn is_pseudo_element(&self) -> bool

Whether we’re matching on a pseudo-element.

source§

fn prev_sibling_element(&self) -> Option<Self>

Skips non-element nodes

source§

fn next_sibling_element(&self) -> Option<Self>

Skips non-element nodes

source§

fn has_namespace(&self, ns: &Namespace) -> bool

Empty string for no namespace

source§

fn is_same_type(&self, other: &Self) -> bool

Whether this element and the other element have the same local name and namespace.

Whether this element is a link.

source§

fn is_html_slot_element(&self) -> bool

Returns whether the element is an HTML <slot> element.

source§

fn is_empty(&self) -> bool

Returns whether this element matches :empty.

That is, whether it does not contain any child element or any non-zero-length text node. See http://dev.w3.org/csswg/selectors-3/#empty-pseudo.

source§

fn is_root(&self) -> bool

Returns whether this element matches :root, i.e. whether it is the root element of a document.

Note: this can be false even if .parent_element() is None if the parent node is a DocumentFragment.

source§

fn first_element_child(&self) -> Option<Self>

Returns the first child element of this element.

source§

fn apply_selector_flags(&self, _: ElementSelectorFlags)

Applies the given selector flags to this element.

§

type Impl = Selector

source§

fn parent_element(&self) -> Option<Self>

source§

fn is_html_element_in_html_document(&self) -> bool

source§

fn has_local_name(&self, local_name: &LocalName) -> bool

source§

fn attr_matches( &self, ns: &NamespaceConstraint<&Namespace>, local_name: &LocalName, operation: &AttrSelectorOperation<&AttributeValue> ) -> bool

source§

fn match_non_ts_pseudo_class( &self, pc: &<Self::Impl as SelectorImpl>::NonTSPseudoClass, _context: &mut MatchingContext<'_, Self::Impl> ) -> bool

source§

fn match_pseudo_element( &self, _pe: &<Self::Impl as SelectorImpl>::PseudoElement, _context: &mut MatchingContext<'_, Self::Impl> ) -> bool

source§

fn has_id(&self, id: &Identifier, case_sensitivity: CaseSensitivity) -> bool

source§

fn has_class( &self, name: &Identifier, case_sensitivity: CaseSensitivity ) -> bool

source§

fn imported_part(&self, _name: &Identifier) -> Option<Identifier>

Returns the mapping from the exportparts attribute in the reverse direction, that is, in an outer-tree -> inner-tree direction.
source§

fn is_part(&self, _name: &Identifier) -> bool

§

fn pseudo_element_originating_element(&self) -> Option<Self>

The parent of a given pseudo-element, after matching a pseudo-element selector. Read more
§

fn has_attr_in_no_namespace( &self, local_name: &<Self::Impl as SelectorImpl>::LocalName ) -> bool

§

fn assigned_slot(&self) -> Option<Self>

Returns the assigned element this element is assigned to. Read more
§

fn ignores_nth_child_selectors(&self) -> bool

Returns whether this element should ignore matching nth child selector.
source§

impl From<Node<NodeData>> for RsvgElement

source§

fn from(n: Node<NodeData>) -> RsvgElement

Converts to this type from the input type.
source§

impl PartialEq for RsvgElement

source§

fn eq(&self, other: &RsvgElement) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for RsvgElement

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,