Struct curl::multi::Message

source ·
pub struct Message<'multi> { /* private fields */ }
Expand description

Message from the messages function of a multi handle.

Currently only indicates whether a transfer is done.

Implementations§

source§

impl<'multi> Message<'multi>

source

pub fn result(&self) -> Option<Result<(), Error>>

If this message indicates that a transfer has finished, returns the result of the transfer in Some.

If the message doesn’t indicate that a transfer has finished, then None is returned.

Note that the result*_for methods below should be preferred as they provide better error messages as the associated error data on the handle can be associated with the error type.

source

pub fn result_for(&self, handle: &EasyHandle) -> Option<Result<(), Error>>

Same as result, except only returns Some for the specified handle.

Note that this function produces better error messages than result as it uses take_error_buf to associate error information with the returned error.

source

pub fn result_for2<H>( &self, handle: &Easy2Handle<H> ) -> Option<Result<(), Error>>

Same as result, except only returns Some for the specified handle.

Note that this function produces better error messages than result as it uses take_error_buf to associate error information with the returned error.

source

pub fn is_for(&self, handle: &EasyHandle) -> bool

Returns whether this easy message was for the specified easy handle or not.

source

pub fn is_for2<H>(&self, handle: &Easy2Handle<H>) -> bool

Same as is_for, but for Easy2Handle.

source

pub fn token(&self) -> Result<usize, Error>

Returns the token associated with the easy handle that this message represents a completion for.

This function will return the token assigned with EasyHandle::set_token. This reads the CURLINFO_PRIVATE field of the underlying *mut CURL.

Trait Implementations§

source§

impl<'a> Debug for Message<'a>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'multi> !RefUnwindSafe for Message<'multi>

§

impl<'multi> !Send for Message<'multi>

§

impl<'multi> !Sync for Message<'multi>

§

impl<'multi> Unpin for Message<'multi>

§

impl<'multi> !UnwindSafe for Message<'multi>

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>,

§

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>,

§

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.