Struct glib::MainContext
source · pub struct MainContext(_);
Implementations
sourceimpl MainContext
impl MainContext
pub fn new() -> MainContext
pub fn acquire(&self) -> bool
pub fn dispatch(&self)
pub fn is_owner(&self) -> bool
pub fn iteration(&self, may_block: bool) -> bool
pub fn pending(&self) -> bool
pub fn pop_thread_default(&self)
pub fn push_thread_default(&self)
pub fn release(&self)
pub fn wakeup(&self)
pub fn default() -> MainContext
pub fn get_thread_default() -> Option<MainContext>
pub fn ref_thread_default() -> MainContext
sourceimpl MainContext
impl MainContext
pub fn prepare(&self) -> (bool, i32)
pub fn find_source_by_id(&self, source_id: &SourceId) -> Option<Source>
pub fn invoke<F>(&self, func: F)where
F: FnOnce() + Send + 'static,
pub fn invoke_with_priority<F>(&self, priority: Priority, func: F)where
F: FnOnce() + Send + 'static,
sourcepub fn with_thread_default<R, F: Sized>(&self, func: F) -> Rwhere
F: FnOnce() -> R,
pub fn with_thread_default<R, F: Sized>(&self, func: F) -> Rwhere
F: FnOnce() -> R,
Calls closure with context configured as the thread default one.
Thread default context is changed in panic-safe manner by calling
push_thread_default
before calling closure
and pop_thread_default
afterwards regardless
of whether closure panicked or not.
Trait Implementations
sourceimpl Clone for MainContext
impl Clone for MainContext
sourcefn clone(&self) -> MainContext
fn clone(&self) -> MainContext
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for MainContext
impl Debug for MainContext
sourceimpl Default for MainContext
impl Default for MainContext
sourceimpl Hash for MainContext
impl Hash for MainContext
sourceimpl Ord for MainContext
impl Ord for MainContext
sourcefn cmp(&self, other: &MainContext) -> Ordering
fn cmp(&self, other: &MainContext) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<MainContext> for MainContext
impl PartialEq<MainContext> for MainContext
sourcefn eq(&self, other: &MainContext) -> bool
fn eq(&self, other: &MainContext) -> bool
sourceimpl PartialOrd<MainContext> for MainContext
impl PartialOrd<MainContext> for MainContext
sourcefn partial_cmp(&self, other: &MainContext) -> Option<Ordering>
fn partial_cmp(&self, other: &MainContext) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl StaticType for MainContext
impl StaticType for MainContext
sourcefn static_type() -> Type
fn static_type() -> Type
Returns the type identifier of
Self
.impl Eq for MainContext
impl Send for MainContext
impl StructuralEq for MainContext
impl StructuralPartialEq for MainContext
impl Sync for MainContext
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToSendValue for Twhere
T: SetValue + Send + ToValue + ?Sized,
impl<T> ToSendValue for Twhere
T: SetValue + Send + ToValue + ?Sized,
sourcefn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
Returns a
SendValue
clone of self
.