[]Struct pango::AttrIterator

pub struct AttrIterator(_);

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

Implementations

impl AttrIterator[src]

pub fn get(&mut self, type_: AttrType) -> Option<Attribute>[src]

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.

pub fn get_attrs(&mut self) -> Vec<Attribute>[src]

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 Attribute::destroy on each value and glib::SList::free on the list.

pub fn next(&mut self) -> bool[src]

Advance the iterator until the next change of style.

Returns

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

pub fn range(&mut self) -> (i32, i32)[src]

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.

start

location to store the start of the range

end

location to store the end of the range

impl AttrIterator[src]

pub fn get_font(
    &mut self,
    desc: &mut FontDescription,
    language: Option<&Language>,
    extra_attrs: &[&Attribute]
)
[src]

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 FontDescription::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 Attribute::destroy on each member.

Trait Implementations

impl Clone for AttrIterator

impl Debug for AttrIterator[src]

impl Eq for AttrIterator[src]

impl Hash for AttrIterator[src]

impl Ord for AttrIterator[src]

impl PartialEq<AttrIterator> for AttrIterator[src]

impl PartialOrd<AttrIterator> for AttrIterator[src]

impl StaticType for AttrIterator

impl StructuralEq for AttrIterator[src]

impl StructuralPartialEq for AttrIterator[src]

Auto Trait Implementations

impl RefUnwindSafe for AttrIterator

impl !Send for AttrIterator

impl !Sync for AttrIterator

impl Unpin for AttrIterator

impl UnwindSafe for AttrIterator

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.