[][src]Struct libpulse_binding::operation::Operation

pub struct Operation<ClosureProto: ?Sized> { /* fields omitted */ }

An asynchronous operation object.

Note: Saves a copy of active multi-use closure callbacks, which it frees on drop.

Methods

impl<ClosureProto: ?Sized> Operation<ClosureProto>[src]

pub fn cancel(&mut self)[src]

Cancel the operation.

Beware! This will not necessarily cancel the execution of the operation on the server side. However it will make sure that the callback associated with this operation will not be called any more, effectively disabling the operation from the client side’s view.

Warning, you should never attempt to use this to cancel a callback from within the execution of that callback itself. This should go without saying, since it makes absolutely no sense to try and do this, but be aware that this is not supported by the C API and will break things.

pub fn get_state(&self) -> State[src]

Return the current status of the operation

pub fn set_state_callback(
    &mut self,
    callback: Option<Box<dyn FnMut() + 'static>>
)
[src]

Set the callback function that is called when the operation state changes.

Usually this is not necessary, since the functions that create Operation objects already take a callback that is called when the operation finishes. Registering a state change callback is mainly useful, if you want to get called back also if the operation gets cancelled.

Trait Implementations

impl<ClosureProto: ?Sized> Drop for Operation<ClosureProto>[src]

impl<ClosureProto: ?Sized> Sync for Operation<ClosureProto>[src]

impl<ClosureProto: ?Sized> Send for Operation<ClosureProto>[src]

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]