pub trait RegionExt: IsA<Region> + Sealed + 'static {
    // Provided methods
    fn add_region(&self, region_to_add: Option<&impl IsA<Region>>) { ... }
    fn add_subregion(&self, _start: &TextIter, _end: &TextIter) { ... }
    fn bounds(&self) -> Option<(TextIter, TextIter)> { ... }
    fn buffer(&self) -> Option<TextBuffer> { ... }
    fn intersect_region(
        &self,
        region2: Option<&impl IsA<Region>>
    ) -> Option<Region> { ... }
    fn intersect_subregion(
        &self,
        _start: &TextIter,
        _end: &TextIter
    ) -> Option<Region> { ... }
    fn is_empty(&self) -> bool { ... }
    fn subtract_region(&self, region_to_subtract: Option<&impl IsA<Region>>) { ... }
    fn subtract_subregion(&self, _start: &TextIter, _end: &TextIter) { ... }
    fn to_str(&self) -> GString { ... }
}
Expand description

Trait containing all Region methods.

Implementors

Region

Provided Methods§

source

fn add_region(&self, region_to_add: Option<&impl IsA<Region>>)

Adds region_to_add to self. region_to_add is not modified.

region_to_add

the Region to add to self, or None.

source

fn add_subregion(&self, _start: &TextIter, _end: &TextIter)

Adds the subregion delimited by _start and _end to self.

_start

the start of the subregion.

_end

the end of the subregion.

source

fn bounds(&self) -> Option<(TextIter, TextIter)>

Gets the start and end bounds of the self.

Returns

true if start and end have been set successfully (if non-None), or false if the self is empty.

start

iterator to initialize with the start of self, or None.

end

iterator to initialize with the end of self, or None.

source

fn buffer(&self) -> Option<TextBuffer>

source

fn intersect_region(&self, region2: Option<&impl IsA<Region>>) -> Option<Region>

Returns the intersection between self and region2. self and region2 are not modified.

region2

a Region, or None.

Returns

the intersection as a Region object.

source

fn intersect_subregion( &self, _start: &TextIter, _end: &TextIter ) -> Option<Region>

Returns the intersection between self and the subregion delimited by _start and _end. self is not modified.

_start

the start of the subregion.

_end

the end of the subregion.

Returns

the intersection as a new Region.

source

fn is_empty(&self) -> bool

Returns whether the self is empty. A None self is considered empty.

Returns

whether the self is empty.

source

fn subtract_region(&self, region_to_subtract: Option<&impl IsA<Region>>)

Subtracts region_to_subtract from self. region_to_subtract is not modified.

region_to_subtract

the Region to subtract from self, or None.

source

fn subtract_subregion(&self, _start: &TextIter, _end: &TextIter)

Subtracts the subregion delimited by _start and _end from self.

_start

the start of the subregion.

_end

the end of the subregion.

source

fn to_str(&self) -> GString

Gets a string represention of self, for debugging purposes.

The returned string contains the character offsets of the subregions. It doesn’t include a newline character at the end of the string.

Returns

a string represention of self. Free with g_free() when no longer needed.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<O: IsA<Region>> RegionExt for O