Struct rsvg::text::Chars

source ·
pub struct Chars {
    string: RefCell<String>,
    space_normalized: RefCell<Option<String>>,
}
Expand description

In SVG text elements, we use Chars to store character data. For example, an element like <text>Foo Bar</text> will be a Text with a single child, and the child will be a Chars with “Foo Bar” for its contents.

Text elements can contain <tspan> sub-elements. In this case, those tspan nodes will also contain Chars children.

A text or tspan element can contain more than one Chars child, for example, if there is an XML comment that splits the character contents in two:

<text>
  This sentence will create a Chars.
  <!-- this comment is ignored -->
  This sentence will cretea another Chars.
</text>

When rendering a text element, it will take care of concatenating the strings in its Chars children as appropriate, depending on the xml:space="preserve" attribute. A Chars stores the characters verbatim as they come out of the XML parser, after ensuring that they are valid UTF-8.

Fields§

§string: RefCell<String>§space_normalized: RefCell<Option<String>>

Implementations§

Trait Implementations§

Returns the “default value” for a type. Read more

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.