Struct glib::MainContext [−][src]
pub struct MainContext(_);
Methods
impl MainContext
[src]
impl MainContext
pub fn new() -> MainContext
[src]
pub fn new() -> MainContext
pub fn acquire(&self) -> bool
[src]
pub fn acquire(&self) -> bool
pub fn dispatch(&self)
[src]
pub fn dispatch(&self)
pub fn is_owner(&self) -> bool
[src]
pub fn is_owner(&self) -> bool
pub fn iteration(&self, may_block: bool) -> bool
[src]
pub fn iteration(&self, may_block: bool) -> bool
pub fn pending(&self) -> bool
[src]
pub fn pending(&self) -> bool
pub fn pop_thread_default(&self)
[src]
pub fn pop_thread_default(&self)
pub fn push_thread_default(&self)
[src]
pub fn push_thread_default(&self)
pub fn release(&self)
[src]
pub fn release(&self)
pub fn wakeup(&self)
[src]
pub fn wakeup(&self)
pub fn default() -> MainContext
[src]
pub fn default() -> MainContext
pub fn get_thread_default() -> Option<MainContext>
[src]
pub fn get_thread_default() -> Option<MainContext>
pub fn ref_thread_default() -> MainContext
[src]
pub fn ref_thread_default() -> MainContext
impl MainContext
[src]
impl MainContext
pub fn prepare(&self) -> (bool, i32)
[src]
pub fn prepare(&self) -> (bool, i32)
pub fn find_source_by_id(&self, source_id: &SourceId) -> Option<Source>
[src]
pub fn find_source_by_id(&self, source_id: &SourceId) -> Option<Source>
pub fn invoke<F>(&self, func: F) where
F: FnOnce() + Send + 'static,
[src]
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,
[src]
pub fn invoke_with_priority<F>(&self, priority: Priority, func: F) where
F: FnOnce() + Send + 'static,
pub fn with_thread_default<R, F: Sized>(&self, func: F) -> R where
F: FnOnce() -> R,
[src]
pub fn with_thread_default<R, F: Sized>(&self, func: F) -> R where
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.
impl MainContext
[src]
impl MainContext
pub fn spawn<F: Future<Item = (), Error = Never> + Send + 'static>(&self, f: F)
[src]
pub fn spawn<F: Future<Item = (), Error = Never> + Send + 'static>(&self, f: F)
Spawn a new infallible Future
on the main context.
This can be called from any thread and will execute the future from the thread
where main context is running, e.g. via a MainLoop
.
pub fn spawn_local<F: Future<Item = (), Error = Never> + 'static>(&self, f: F)
[src]
pub fn spawn_local<F: Future<Item = (), Error = Never> + 'static>(&self, f: F)
Spawn a new infallible Future
on the main context.
The given Future
does not have to be Send
.
This can be called only from the thread where the main context is running, e.g.
from any other Future
that is executed on this main context, or after calling
push_thread_default
or acquire
on the main context.
pub fn spawn_with_priority<F: Future<Item = (), Error = Never> + Send + 'static>(
&self,
priority: Priority,
f: F
)
[src]
pub fn spawn_with_priority<F: Future<Item = (), Error = Never> + Send + 'static>(
&self,
priority: Priority,
f: F
)
Spawn a new infallible Future
on the main context, with a non-default priority.
This can be called from any thread and will execute the future from the thread
where main context is running, e.g. via a MainLoop
.
pub fn spawn_local_with_priority<F: Future<Item = (), Error = Never> + 'static>(
&self,
priority: Priority,
f: F
)
[src]
pub fn spawn_local_with_priority<F: Future<Item = (), Error = Never> + 'static>(
&self,
priority: Priority,
f: F
)
Spawn a new infallible Future
on the main context, with a non-default priority.
The given Future
does not have to be Send
.
This can be called only from the thread where the main context is running, e.g.
from any other Future
that is executed on this main context, or after calling
push_thread_default
or acquire
on the main context.
pub fn block_on<F: Future>(&self, f: F) -> Result<F::Item, F::Error>
[src]
pub fn block_on<F: Future>(&self, f: F) -> Result<F::Item, F::Error>
Runs a new, infallible Future
on the main context and block until it finished, returning
the result of the Future
.
The given Future
does not have to be Send
or 'static
.
This must only be called if no MainLoop
or anything else is running on this specific main
context.
Trait Implementations
impl Debug for MainContext
[src]
impl Debug for MainContext
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for MainContext
[src]
impl PartialEq for MainContext
fn eq(&self, other: &MainContext) -> bool
[src]
fn eq(&self, other: &MainContext) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &MainContext) -> bool
[src]
fn ne(&self, other: &MainContext) -> bool
This method tests for !=
.
impl Eq for MainContext
[src]
impl Eq for MainContext
impl PartialOrd for MainContext
[src]
impl PartialOrd for MainContext
fn partial_cmp(&self, other: &MainContext) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &MainContext) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &MainContext) -> bool
[src]
fn lt(&self, other: &MainContext) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &MainContext) -> bool
[src]
fn le(&self, other: &MainContext) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &MainContext) -> bool
[src]
fn gt(&self, other: &MainContext) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &MainContext) -> bool
[src]
fn ge(&self, other: &MainContext) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for MainContext
[src]
impl Ord for MainContext
fn cmp(&self, other: &MainContext) -> Ordering
[src]
fn cmp(&self, other: &MainContext) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Hash for MainContext
[src]
impl Hash for MainContext
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Clone for MainContext
[src]
impl Clone for MainContext
fn clone(&self) -> MainContext
[src]
fn clone(&self) -> MainContext
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl StaticType for MainContext
[src]
impl StaticType for MainContext
fn static_type() -> Type
[src]
fn static_type() -> Type
Returns the type identifier of Self
.
impl Default for MainContext
[src]
impl Default for MainContext
impl Send for MainContext
[src]
impl Send for MainContext
impl Sync for MainContext
[src]
impl Sync for MainContext
impl Executor for MainContext
[src]
impl Executor for MainContext