Struct sourceview5::SearchContext
source · pub struct SearchContext { /* private fields */ }
Expand description
Search context.
A SearchContext
is used for the search and replace in a
Buffer
. The search settings are represented by a
SearchSettings
object. There can be a many-to-many relationship
between buffers and search settings, with the search contexts in-between: a
search settings object can be shared between several search contexts; and a
buffer can contain several search contexts at the same time.
The total number of search occurrences can be retrieved with
occurrences_count()
. To know the position of a
certain match, use occurrence_position()
.
The buffer is scanned asynchronously, so it doesn’t block the user interface. For each search, the buffer is scanned at most once. After that, navigating through the occurrences doesn’t require to re-scan the buffer entirely.
To search forward, use forward()
or
forward_async()
for the asynchronous version.
The backward search is done similarly. To replace a search match, or all
matches, use replace()
and
replace_all()
.
The search occurrences are highlighted by default. To disable it, use
set_highlight()
. You can enable the search
highlighting for several SearchContext
s attached to the
same buffer. Moreover, each of those SearchContext
s can
have a different text style associated. Use
set_match_style()
to specify the Style
to apply on search matches.
Note that the highlight
and
match-style
properties are in the
SearchContext
class, not SearchSettings
. Appearance
settings should be tied to one, and only one buffer, as different buffers can
have different style scheme associated (a SearchSettings
object
can be bound indirectly to several buffers).
The concept of “current match” doesn’t exist yet. A way to highlight differently the current match is to select it.
A search occurrence’s position doesn’t depend on the cursor position or other parameters. Take for instance the buffer “aaaa” with the search text “aa”. The two occurrences are at positions [0:2] and [2:4]. If you begin to search at position 1, you will get the occurrence [2:4], not [1:3]. This is a prerequisite for regular expression searches. The pattern “.*” matches the entire line. If the cursor is at the middle of the line, you don’t want the rest of the line as the occurrence, you want an entire line. (As a side note, regular expression searches can also match multiple lines.)
In the GtkSourceView source code, there is an example of how to use the search and replace API: see the tests/test-search.c file. It is a mini application for the search and replace, with a basic user interface.
§Properties
§buffer
The Buffer
associated to the search context.
Readable | Writeable | Construct Only
§highlight
Highlight the search occurrences.
Readable | Writeable | Construct
§match-style
A Style
, or None
for theme’s scheme default style.
Readable | Writeable | Construct
§occurrences-count
The total number of search occurrences. If the search is disabled, the value is 0. If the buffer is not already fully scanned, the value is -1.
Readable
§regex-error
If the regex search pattern doesn’t follow all the rules, this
#GError property will be set. If the pattern is valid, the value is
None
.
Free with GLib::Error::free()
.
Readable
§settings
The SearchSettings
associated to the search context.
This property is construct-only since version 4.0.
Readable | Writeable | Construct Only
§Implements
[trait@glib::ObjectExt
]
GLib type: GObject with reference counted clone semantics.
Implementations§
source§impl SearchContext
impl SearchContext
sourcepub fn new(
buffer: &impl IsA<Buffer>,
settings: Option<&impl IsA<SearchSettings>>,
) -> SearchContext
pub fn new( buffer: &impl IsA<Buffer>, settings: Option<&impl IsA<SearchSettings>>, ) -> SearchContext
Creates a new search context, associated with @buffer, and customized with @settings.
If @settings is None
, a new SearchSettings
object will
be created, that you can retrieve with settings()
.
§buffer
a #GtkSourceBuffer.
§settings
a #GtkSourceSearchSettings, or None
.
§Returns
a new search context.
sourcepub fn builder() -> SearchContextBuilder
pub fn builder() -> SearchContextBuilder
Creates a new builder-pattern struct instance to construct SearchContext
objects.
This method returns an instance of SearchContextBuilder
which can be used to create SearchContext
objects.
sourcepub fn backward(&self, iter: &TextIter) -> Option<(TextIter, TextIter, bool)>
pub fn backward(&self, iter: &TextIter) -> Option<(TextIter, TextIter, bool)>
Synchronous backward search.
It is recommended to use the asynchronous functions instead, to not block the user interface. However, if you are sure that the @buffer is small, this function is more convenient to use.
If the wrap-around
property is false
, this function
doesn’t try to wrap around.
The @has_wrapped_around out parameter is set independently of whether a match
is found. So if this function returns false
, @has_wrapped_around will have
the same value as the wrap-around
property.
§iter
start of search.
§Returns
whether a match was found.
§match_start
return location for start of match, or None
.
§match_end
return location for end of match, or None
.
§has_wrapped_around
return location to know whether the
search has wrapped around, or None
.
sourcepub fn backward_async<P: FnOnce(Result<(TextIter, TextIter, bool), Error>) + 'static>(
&self,
iter: &TextIter,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
pub fn backward_async<P: FnOnce(Result<(TextIter, TextIter, bool), Error>) + 'static>( &self, iter: &TextIter, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
The asynchronous version of backward()
.
See the Gio::AsyncResult
documentation to know how to use this function.
If the operation is cancelled, the @callback will only be called if
@cancellable was not None
. The method takes
ownership of @cancellable, so you can unref it after calling this function.
§iter
start of search.
§cancellable
a #GCancellable, or None
.
§callback
a #GAsyncReadyCallback to call when the operation is finished.
pub fn backward_future( &self, iter: &TextIter, ) -> Pin<Box_<dyn Future<Output = Result<(TextIter, TextIter, bool), Error>> + 'static>>
sourcepub fn forward(&self, iter: &TextIter) -> Option<(TextIter, TextIter, bool)>
pub fn forward(&self, iter: &TextIter) -> Option<(TextIter, TextIter, bool)>
Synchronous forward search.
It is recommended to use the asynchronous functions instead, to not block the user interface. However, if you are sure that the @buffer is small, this function is more convenient to use.
If the wrap-around
property is false
, this function
doesn’t try to wrap around.
The @has_wrapped_around out parameter is set independently of whether a match
is found. So if this function returns false
, @has_wrapped_around will have
the same value as the wrap-around
property.
§iter
start of search.
§Returns
whether a match was found.
§match_start
return location for start of match, or None
.
§match_end
return location for end of match, or None
.
§has_wrapped_around
return location to know whether the
search has wrapped around, or None
.
sourcepub fn forward_async<P: FnOnce(Result<(TextIter, TextIter, bool), Error>) + 'static>(
&self,
iter: &TextIter,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P,
)
pub fn forward_async<P: FnOnce(Result<(TextIter, TextIter, bool), Error>) + 'static>( &self, iter: &TextIter, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
The asynchronous version of forward()
.
See the Gio::AsyncResult
documentation to know how to use this function.
If the operation is cancelled, the @callback will only be called if
@cancellable was not None
. The method takes
ownership of @cancellable, so you can unref it after calling this function.
§iter
start of search.
§cancellable
a #GCancellable, or None
.
§callback
a #GAsyncReadyCallback to call when the operation is finished.
pub fn forward_future( &self, iter: &TextIter, ) -> Pin<Box_<dyn Future<Output = Result<(TextIter, TextIter, bool), Error>> + 'static>>
sourcepub fn is_highlight(&self) -> bool
pub fn is_highlight(&self) -> bool
§Returns
whether to highlight the search occurrences.
sourcepub fn match_style(&self) -> Style
pub fn match_style(&self) -> Style
§Returns
the #GtkSourceStyle to apply on search matches.
sourcepub fn occurrence_position(
&self,
match_start: &TextIter,
match_end: &TextIter,
) -> i32
pub fn occurrence_position( &self, match_start: &TextIter, match_end: &TextIter, ) -> i32
Gets the position of a search occurrence.
If the buffer is not already fully scanned, the position may be unknown, and -1 is returned. If 0 is returned, it means that this part of the buffer has already been scanned, and that @match_start and @match_end don’t delimit an occurrence.
§match_start
the start of the occurrence.
§match_end
the end of the occurrence.
§Returns
the position of the search occurrence. The first occurrence has the position 1 (not 0). Returns 0 if @match_start and @match_end don’t delimit an occurrence. Returns -1 if the position is not yet known.
sourcepub fn occurrences_count(&self) -> i32
pub fn occurrences_count(&self) -> i32
Gets the total number of search occurrences.
If the buffer is not already fully scanned, the total number of occurrences is unknown, and -1 is returned.
§Returns
the total number of search occurrences, or -1 if unknown.
sourcepub fn regex_error(&self) -> Option<Error>
pub fn regex_error(&self) -> Option<Error>
Regular expression patterns must follow certain rules. If
search-text
breaks a rule, the error can be
retrieved with this function.
The error domain is GLib::RegexError
.
Free the return value with GLib::Error::free()
.
§Returns
the #GError, or None
if the
pattern is valid.
sourcepub fn settings(&self) -> SearchSettings
pub fn settings(&self) -> SearchSettings
§Returns
the search settings.
sourcepub fn replace(
&self,
match_start: &mut TextIter,
match_end: &mut TextIter,
replace: &str,
) -> Result<(), Error>
pub fn replace( &self, match_start: &mut TextIter, match_end: &mut TextIter, replace: &str, ) -> Result<(), Error>
Replaces a search match by another text. If @match_start and @match_end
doesn’t correspond to a search match, false
is returned.
@match_start and @match_end iters are revalidated to point to the replacement text boundaries.
For a regular expression replacement, you can check if @replace is valid by
calling GLib::Regex::check_replacement()
. The @replace text can contain
backreferences.
§match_start
the start of the match to replace.
§match_end
the end of the match to replace.
§replace
the replacement text.
§replace_length
the length of @replace in bytes, or -1.
§Returns
whether the match has been replaced.
sourcepub fn set_highlight(&self, highlight: bool)
pub fn set_highlight(&self, highlight: bool)
sourcepub fn set_match_style(&self, match_style: Option<&Style>)
pub fn set_match_style(&self, match_style: Option<&Style>)
Set the style to apply on search matches.
If @match_style is None
, default theme’s scheme ‘match-style’ will be used.
To enable or disable the search highlighting, use set_highlight()
.
§match_style
a #GtkSourceStyle, or None
.
pub fn connect_highlight_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_match_style_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_occurrences_count_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
pub fn connect_regex_error_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
source§impl SearchContext
impl SearchContext
sourcepub fn replace_all(&self, replace: &str) -> Result<(), Error>
pub fn replace_all(&self, replace: &str) -> Result<(), Error>
Replaces all search matches by another text.
It is a synchronous function, so it can block the user interface.
For a regular expression replacement, you can check if @replace is valid by
calling GLib::Regex::check_replacement()
. The @replace text can contain
backreferences.
§replace
the replacement text.
§replace_length
the length of @replace in bytes, or -1.
§Returns
the number of replaced matches.
Trait Implementations§
source§impl Clone for SearchContext
impl Clone for SearchContext
source§impl Debug for SearchContext
impl Debug for SearchContext
source§impl Default for SearchContext
impl Default for SearchContext
source§impl HasParamSpec for SearchContext
impl HasParamSpec for SearchContext
type ParamSpec = ParamSpecObject
§type SetValue = SearchContext
type SetValue = SearchContext
type BuilderFn = fn(_: &str) -> ParamSpecObjectBuilder<'_, SearchContext>
fn param_spec_builder() -> Self::BuilderFn
source§impl Hash for SearchContext
impl Hash for SearchContext
source§impl Ord for SearchContext
impl Ord for SearchContext
source§fn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
Comparison for two GObjects.
Compares the memory addresses of the provided objects.
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl ParentClassIs for SearchContext
impl ParentClassIs for SearchContext
source§impl<OT: ObjectType> PartialEq<OT> for SearchContext
impl<OT: ObjectType> PartialEq<OT> for SearchContext
source§impl<OT: ObjectType> PartialOrd<OT> for SearchContext
impl<OT: ObjectType> PartialOrd<OT> for SearchContext
source§fn partial_cmp(&self, other: &OT) -> Option<Ordering>
fn partial_cmp(&self, other: &OT) -> Option<Ordering>
Partial comparison for two GObjects.
Compares the memory addresses of the provided objects.
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl StaticType for SearchContext
impl StaticType for SearchContext
source§fn static_type() -> Type
fn static_type() -> Type
Self
.impl Eq for SearchContext
Auto Trait Implementations§
impl Freeze for SearchContext
impl RefUnwindSafe for SearchContext
impl !Send for SearchContext
impl !Sync for SearchContext
impl Unpin for SearchContext
impl UnwindSafe for SearchContext
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Cast for Twhere
T: ObjectType,
impl<T> Cast for Twhere
T: ObjectType,
source§fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
T
. Read moresource§fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
T
. Read moresource§fn downcast<T>(self) -> Result<T, Self>where
T: ObjectType,
Self: MayDowncastTo<T>,
fn downcast<T>(self) -> Result<T, Self>where
T: ObjectType,
Self: MayDowncastTo<T>,
T
. Read moresource§fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: MayDowncastTo<T>,
fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: MayDowncastTo<T>,
T
. Read moresource§fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
T
. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while upcast
will do many checks at compile-time already. downcast
will
perform the same checks at runtime as dynamic_cast
, but will also ensure some amount of
compile-time safety. Read moresource§fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
T
. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while downcast
and upcast
will do many checks at compile-time already. Read moresource§unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
T
unconditionally. Read moresource§unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
&T
unconditionally. Read moresource§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *const GList) -> Vec<T>
unsafe fn from_glib_container_as_vec(_: *const GList) -> Vec<T>
unsafe fn from_glib_full_as_vec(_: *const GList) -> Vec<T>
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T>
unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T>
unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T>
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *const GSList) -> Vec<T>
unsafe fn from_glib_container_as_vec(_: *const GSList) -> Vec<T>
unsafe fn from_glib_full_as_vec(_: *const GSList) -> Vec<T>
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T>
unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T>
unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T>
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T>
unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T>
unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T>
source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T>
unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T>
unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T>
source§impl<O> GObjectPropertyExpressionExt for O
impl<O> GObjectPropertyExpressionExt for O
source§fn property_expression(&self, property_name: &str) -> PropertyExpression
fn property_expression(&self, property_name: &str) -> PropertyExpression
source§fn property_expression_weak(&self, property_name: &str) -> PropertyExpression
fn property_expression_weak(&self, property_name: &str) -> PropertyExpression
source§fn this_expression(property_name: &str) -> PropertyExpression
fn this_expression(property_name: &str) -> PropertyExpression
this
object.source§impl<T> IntoClosureReturnValue for T
impl<T> IntoClosureReturnValue for T
fn into_closure_return_value(self) -> Option<Value>
source§impl<U> IsSubclassableExt for Uwhere
U: IsClass + ParentClassIs,
impl<U> IsSubclassableExt for Uwhere
U: IsClass + ParentClassIs,
fn parent_class_init<T>(class: &mut Class<U>)
fn parent_instance_init<T>(instance: &mut InitializingObject<T>)
source§impl<T> ObjectExt for Twhere
T: ObjectType,
impl<T> ObjectExt for Twhere
T: ObjectType,
source§fn is<U>(&self) -> boolwhere
U: StaticType,
fn is<U>(&self) -> boolwhere
U: StaticType,
true
if the object is an instance of (can be cast to) T
.source§fn object_class(&self) -> &Class<Object>
fn object_class(&self) -> &Class<Object>
ObjectClass
of the object. Read moresource§fn class_of<U>(&self) -> Option<&Class<U>>where
U: IsClass,
fn class_of<U>(&self) -> Option<&Class<U>>where
U: IsClass,
T
. Read moresource§fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where
U: IsInterface,
fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where
U: IsInterface,
T
of the object. Read moresource§fn set_property_from_value(&self, property_name: &str, value: &Value)
fn set_property_from_value(&self, property_name: &str, value: &Value)
source§fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
source§fn set_properties_from_value(&self, property_values: &[(&str, Value)])
fn set_properties_from_value(&self, property_values: &[(&str, Value)])
source§fn property<V>(&self, property_name: &str) -> Vwhere
V: for<'b> FromValue<'b> + 'static,
fn property<V>(&self, property_name: &str) -> Vwhere
V: for<'b> FromValue<'b> + 'static,
property_name
of the object and cast it to the type V. Read moresource§fn property_value(&self, property_name: &str) -> Value
fn property_value(&self, property_name: &str) -> Value
property_name
of the object. Read moresource§fn property_type(&self, property_name: &str) -> Option<Type>
fn property_type(&self, property_name: &str) -> Option<Type>
property_name
of this object. Read moresource§fn find_property(&self, property_name: &str) -> Option<ParamSpec>
fn find_property(&self, property_name: &str) -> Option<ParamSpec>
ParamSpec
of the property property_name
of this object.source§fn list_properties(&self) -> PtrSlice<ParamSpec>
fn list_properties(&self) -> PtrSlice<ParamSpec>
ParamSpec
of the properties of this object.source§fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
source§unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)where
QD: 'static,
unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)where
QD: 'static,
key
. Read moresource§unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>where
QD: 'static,
unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>where
QD: 'static,
key
. Read moresource§unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>where
QD: 'static,
unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>where
QD: 'static,
key
. Read moresource§unsafe fn set_data<QD>(&self, key: &str, value: QD)where
QD: 'static,
unsafe fn set_data<QD>(&self, key: &str, value: QD)where
QD: 'static,
key
. Read moresource§unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>where
QD: 'static,
unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>where
QD: 'static,
key
. Read moresource§unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>where
QD: 'static,
unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>where
QD: 'static,
key
. Read moresource§fn block_signal(&self, handler_id: &SignalHandlerId)
fn block_signal(&self, handler_id: &SignalHandlerId)
source§fn unblock_signal(&self, handler_id: &SignalHandlerId)
fn unblock_signal(&self, handler_id: &SignalHandlerId)
source§fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
source§fn stop_signal_emission_by_name(&self, signal_name: &str)
fn stop_signal_emission_by_name(&self, signal_name: &str)
source§fn connect<F>(
&self,
signal_name: &str,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
signal_name
on this object. Read moresource§fn connect_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
signal_id
on this object. Read moresource§fn connect_local<F>(
&self,
signal_name: &str,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
signal_name
on this object. Read moresource§fn connect_local_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
signal_id
on this object. Read moresource§unsafe fn connect_unsafe<F>(
&self,
signal_name: &str,
after: bool,
callback: F,
) -> SignalHandlerId
unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
signal_name
on this object. Read moresource§unsafe fn connect_unsafe_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F,
) -> SignalHandlerId
unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
signal_id
on this object. Read moresource§fn connect_closure(
&self,
signal_name: &str,
after: bool,
closure: RustClosure,
) -> SignalHandlerId
fn connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure, ) -> SignalHandlerId
signal_name
on this object. Read moresource§fn connect_closure_id(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
closure: RustClosure,
) -> SignalHandlerId
fn connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure, ) -> SignalHandlerId
signal_id
on this object. Read moresource§fn watch_closure(&self, closure: &impl AsRef<Closure>)
fn watch_closure(&self, closure: &impl AsRef<Closure>)
closure
to the lifetime of the object. When
the object’s reference count drops to zero, the closure will be
invalidated. An invalidated closure will ignore any calls to
invoke_with_values
, or
invoke
when using Rust closures.source§fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
source§fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>
fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>
Self::emit
but takes Value
for the arguments.source§fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
source§fn emit_by_name_with_values(
&self,
signal_name: &str,
args: &[Value],
) -> Option<Value>
fn emit_by_name_with_values( &self, signal_name: &str, args: &[Value], ) -> Option<Value>
source§fn emit_by_name_with_details<R>(
&self,
signal_name: &str,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_by_name_with_details<R>(
&self,
signal_name: &str,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
source§fn emit_by_name_with_details_and_values(
&self,
signal_name: &str,
details: Quark,
args: &[Value],
) -> Option<Value>
fn emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value], ) -> Option<Value>
source§fn emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
source§fn emit_with_details_and_values(
&self,
signal_id: SignalId,
details: Quark,
args: &[Value],
) -> Option<Value>
fn emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value], ) -> Option<Value>
source§fn disconnect(&self, handler_id: SignalHandlerId)
fn disconnect(&self, handler_id: SignalHandlerId)
source§fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
notify
signal of the object. Read moresource§fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
notify
signal of the object. Read moresource§unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F,
) -> SignalHandlerId
unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F, ) -> SignalHandlerId
notify
signal of the object. Read more