Struct sourceview5::Snippet[][src]

pub struct Snippet(_);

Implementations

impl Snippet[src]

pub fn new(trigger: Option<&str>, language_id: Option<&str>) -> Snippet[src]

Creates a new Snippet

Feature: v5_0

trigger

the trigger word

language_id

the source language

Returns

A new Snippet

pub fn add_chunk(&self, chunk: &SnippetChunk)[src]

Appends chunk to the self.

This may only be called before the snippet has been expanded.

Feature: v5_0

chunk

a SnippetChunk

pub fn copy(&self) -> Option<Snippet>[src]

Does a deep copy of the snippet.

Feature: v5_0

Returns

A new Snippet

pub fn get_context(&self) -> Option<SnippetContext>[src]

Gets the context used for expanding the snippet.

Feature: v5_0

Returns

an SnippetContext

pub fn get_description(&self) -> Option<GString>[src]

Gets the description for the snippet.

Feature: v5_0

pub fn get_focus_position(&self) -> i32[src]

Gets the current focus for the snippet. This is changed as the user tabs through focus locations.

Feature: v5_0

Returns

The focus position, or -1 if unset.

pub fn get_language_id(&self) -> Option<GString>[src]

Gets the language-id used for the source snippet.

The language identifier should be one that matches a source language Language:id property.

Feature: v5_0

Returns

the language identifier

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

Gets the number of chunks in the snippet.

Note that not all chunks are editable.

Feature: v5_0

Returns

The number of chunks.

pub fn get_name(&self) -> Option<GString>[src]

Gets the name for the snippet.

Feature: v5_0

pub fn get_nth_chunk(&self, nth: u32) -> Option<SnippetChunk>[src]

Gets the chunk at nth.

Feature: v5_0

nth

the nth chunk to get

Returns

an SnippetChunk

pub fn get_trigger(&self) -> Option<GString>[src]

Gets the trigger for the source snippet. A trigger is a word that can be expanded into the full snippet when the user presses Tab.

Feature: v5_0

Returns

A string or None

pub fn set_description(&self, description: &str)[src]

Sets the description for the snippet.

Feature: v5_0

description

the snippet description

pub fn set_language_id(&self, language_id: &str)[src]

Sets the language identifier for the snippet.

This should match the Language:id identifier.

Feature: v5_0

language_id

the language identifier for the snippet

pub fn set_name(&self, name: &str)[src]

Sets the name for the snippet.

Feature: v5_0

name

the snippet name

pub fn set_trigger(&self, trigger: &str)[src]

Sets the trigger for the snippet.

Feature: v5_0

trigger

the trigger word

pub fn get_property_buffer(&self) -> Option<TextBuffer>[src]

pub fn get_property_description(&self) -> Option<GString>[src]

pub fn set_property_description(&self, description: Option<&str>)[src]

pub fn get_property_focus_position(&self) -> i32[src]

pub fn get_property_language_id(&self) -> Option<GString>[src]

pub fn set_property_language_id(&self, language_id: Option<&str>)[src]

pub fn get_property_name(&self) -> Option<GString>[src]

pub fn set_property_name(&self, name: Option<&str>)[src]

pub fn get_property_trigger(&self) -> Option<GString>[src]

pub fn set_property_trigger(&self, trigger: Option<&str>)[src]

pub fn connect_property_buffer_notify<F: Fn(&Snippet) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

pub fn connect_property_description_notify<F: Fn(&Snippet) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

pub fn connect_property_focus_position_notify<F: Fn(&Snippet) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

pub fn connect_property_language_id_notify<F: Fn(&Snippet) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

pub fn connect_property_name_notify<F: Fn(&Snippet) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

pub fn connect_property_trigger_notify<F: Fn(&Snippet) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Trait Implementations

impl Clone for Snippet[src]

impl Debug for Snippet[src]

impl Display for Snippet[src]

impl Eq for Snippet[src]

impl Hash for Snippet[src]

impl Ord for Snippet[src]

impl ParentClassIs for Snippet[src]

type Parent = Object

impl<T: ObjectType> PartialEq<T> for Snippet[src]

impl<T: ObjectType> PartialOrd<T> for Snippet[src]

impl StaticType for Snippet[src]

impl StructuralEq for Snippet[src]

Auto Trait Implementations

impl RefUnwindSafe for Snippet

impl !Send for Snippet

impl !Sync for Snippet

impl Unpin for Snippet

impl UnwindSafe for Snippet

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<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

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

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

impl<T> ObjectExt for T where
    T: ObjectType, 

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: SetValue + Send + ToValue + ?Sized

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.