Struct pango::AttrIterator[][src]

pub struct AttrIterator(_);
Expand description

The AttrIterator structure is used to represent an iterator through a AttrList. A new iterator is created with AttrList::iterator(). Once the iterator is created, it can be advanced through the style changes in the text using next(). At each style change, the range of the current style segment and the attributes currently in effect can be queried.

Implementations

Find the current attribute of a particular type at the iterator location. When multiple attributes of the same type overlap, the attribute whose range starts closest to the current location is used.

type_

the type of attribute to find.

Returns

the current attribute of the given type, or None if no attribute of that type applies to the current location.

Gets a list of all attributes at the current position of the iterator.

Returns

a list of all attributes for the current range. To free this value, call pango_attribute_destroy() on each value and g_slist_free() on the list.

Advance the iterator until the next change of style.

Returns

false if the iterator is at the end of the list, otherwise true

Get the range of the current segment. Note that the stored return values are signed, not unsigned like the values in Attribute. To deal with this API oversight, stored return values that wouldn’t fit into a signed integer are clamped to G_MAXINT.

Returns

start

location to store the start of the range

end

location to store the end of the range

Get the font and other attributes at the current iterator position.

desc

a FontDescription to fill in with the current values. The family name in this structure will be set using pango_font_description_set_family_static() using values from an attribute in the AttrList associated with the iterator, so if you plan to keep it around, you must call: <literal>pango_font_description_set_family (desc, pango_font_description_get_family (desc))</literal>.

language

if non-None, location to store language tag for item, or None if none is found.

extra_attrs

if non-None, location in which to store a list of non-font attributes at the the current position; only the highest priority value of each attribute will be added to this list. In order to free this value, you must call pango_attribute_destroy() on each member.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Returns the type identifier of Self.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

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.