Struct Handle

Source
pub struct Handle<S, R>
where S: Send, R: Send,
{ /* private fields */ }
Expand description

A handle for the Flower

Implementations§

Source§

impl<S, R> Handle<S, R>
where S: Send, R: Send,

Source

pub fn id(&self) -> usize

Get ID of the Flower.

Source

pub fn activate(&self)

Activate current Flower

Source

pub fn is_active(&self) -> bool

Check if the current Flower is active

Source

pub fn should_cancel(&self) -> bool

Check if the current Flower should be canceled

Source

pub fn send(&self, s: S)

Send current progress value

Source

pub async fn send_async(&self, s: S)

Send current progress value asynchronously.

Source

pub fn set_result(&self, r: Result<R, Box<dyn Error>>)

Set Result value with verboser error message.

(for more easier to keep in track with the real cause of the error)

Source

pub fn set_result_no_verbose(&self, r: Result<R, Box<dyn Error>>)

Set Result value with no verbose (simpler error message)

Source

pub fn success(&self, r: R)

Set the Ok value of the Result.

Source

pub fn error(&self, e: impl ToString)

Set the Err value of the Result.

Source

pub fn error_verbose(&self, e: Box<dyn Error>)

Set the Err value of the Result with more verboser error message.

Trait Implementations§

Source§

impl<S, R> Debug for Handle<S, R>
where S: Send + Debug, R: Send + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S, R> Drop for Handle<S, R>
where S: Send, R: Send,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<S, R> Freeze for Handle<S, R>

§

impl<S, R> RefUnwindSafe for Handle<S, R>

§

impl<S, R> Send for Handle<S, R>

§

impl<S, R> Sync for Handle<S, R>

§

impl<S, R> Unpin for Handle<S, R>

§

impl<S, R> UnwindSafe for Handle<S, R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.