#[repr(transparent)]
pub struct TabArray { /* private fields */ }
Expand description

A TabArray contains an array of tab stops.

TabArray can be used to set tab stops in a Layout. Each tab stop has an alignment, a position, and optionally a character to use as decimal point.

Implementations

Creates an array of @initial_size tab stops.

Tab stops are specified in pixel units if @positions_in_pixels is true, otherwise in Pango units. All stops are initially at position 0.

initial_size

Initial number of tab stops to allocate, can be 0

positions_in_pixels

whether positions are in pixel units

Returns

the newly allocated TabArray, which should be freed with Pango::TabArray::free().

Available on crate feature v1_50 only.

Gets the Unicode character to use as decimal point.

This is only relevant for tabs with TabAlign::Decimal alignment, which align content at the first occurrence of the decimal point character.

The default value of 0 means that Pango will use the decimal point according to the current locale.

tab_index

the index of a tab stop

Returns true if the tab positions are in pixels, false if they are in Pango units.

Returns

whether positions are in pixels.

Gets the number of tab stops in @self.

Returns

the number of tab stops in the array.

Gets the alignment and position of a tab stop.

tab_index

tab stop index

Returns
alignment

location to store alignment

location

location to store tab position

Resizes a tab array.

You must subsequently initialize any tabs that were added as a result of growing the array.

new_size

new size of the array

Available on crate feature v1_50 only.

Sets the Unicode character to use as decimal point.

This is only relevant for tabs with TabAlign::Decimal alignment, which align content at the first occurrence of the decimal point character.

By default, Pango uses the decimal point according to the current locale.

tab_index

the index of a tab stop

decimal_point

the decimal point to use

Available on crate feature v1_50 only.

Sets whether positions in this array are specified in pixels.

positions_in_pixels

whether positions are in pixels

Sets the alignment and location of a tab stop.

tab_index

the index of a tab stop

alignment

tab alignment

location

tab location in Pango units

Available on crate feature v1_50 only.

Utility function to ensure that the tab stops are in increasing order.

Available on crate feature v1_50 only.

Serializes a TabArray to a string.

No guarantees are made about the format of the string, it may change between Pango versions.

The intended use of this function is testing and debugging. The format is not meant as a permanent storage format.

Returns

a newly allocated string

Available on crate feature v1_50 only.

Deserializes a TabArray from a string.

This is the counterpart to to_str(). See that functions for details about the format.

text

a string

Returns

a new TabArray

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
Formats the value using the given formatter. Read more
The associated error which can be returned from parsing.
Parses a string s to return a value of this type. 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 !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
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

Returns the argument unchanged.

Calls U::from(self).

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

Ensures that the type has been registered with the type system.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Returns a SendValue clone of self.
Converts the given value to a String. 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.