[]Struct gtk::CssSection

pub struct CssSection(_);

Defines a part of a CSS document. Because sections are nested into one another, you can use CssSection::get_parent to get the containing region.

Implementations

impl CssSection[src]

pub fn get_end_line(&self) -> u32[src]

Returns the line in the CSS document where this section end. The line number is 0-indexed, so the first line of the document will return 0. This value may change in future invocations of this function if self is not yet parsed completely. This will for example happen in the CssProvider::parsing-error signal. The end position and line may be identical to the start position and line for sections which failed to parse anything successfully.

Returns

the line number

pub fn get_end_position(&self) -> u32[src]

Returns the offset in bytes from the start of the current line returned via CssSection::get_end_line. This value may change in future invocations of this function if self is not yet parsed completely. This will for example happen in the CssProvider::parsing-error signal. The end position and line may be identical to the start position and line for sections which failed to parse anything successfully.

Returns

the offset in bytes from the start of the line.

pub fn get_file(&self) -> Option<File>[src]

Gets the file that self was parsed from. If no such file exists, for example because the CSS was loaded via CssProviderExt::load_from_data(), then None is returned.

Returns

the gio::File that self was parsed from or None if self was parsed from other data

pub fn get_parent(&self) -> Option<CssSection>[src]

Gets the parent section for the given self. The parent section is the section that contains this self. A special case are sections of type CssSectionType::Document. Their parent will either be None if they are the original CSS document that was loaded by CssProviderExt::load_from_file or a section of type CssSectionType::Import if it was loaded with an import rule from a different file.

Returns

the parent section or None if none

pub fn get_section_type(&self) -> CssSectionType[src]

Gets the type of information that self describes.

Returns

the type of self

pub fn get_start_line(&self) -> u32[src]

Returns the line in the CSS document where this section starts. The line number is 0-indexed, so the first line of the document will return 0.

Returns

the line number

pub fn get_start_position(&self) -> u32[src]

Returns the offset in bytes from the start of the current line returned via CssSection::get_start_line.

Returns

the offset in bytes from the start of the line.

Trait Implementations

impl Clone for CssSection

impl Debug for CssSection[src]

impl Eq for CssSection[src]

impl Hash for CssSection[src]

impl Ord for CssSection[src]

impl PartialEq<CssSection> for CssSection[src]

impl PartialOrd<CssSection> for CssSection[src]

impl StaticType for CssSection

impl StructuralEq for CssSection[src]

impl StructuralPartialEq for CssSection[src]

Auto Trait Implementations

impl RefUnwindSafe for CssSection

impl !Send for CssSection

impl !Sync for CssSection

impl Unpin for CssSection

impl UnwindSafe for CssSection

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<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

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.