[][src]Trait libtls::error::LastError

pub trait LastError {
    fn last_error(&self) -> Result<String>;

    fn to_error<T>(errstr: String) -> Result<T> { ... }
}

Returns the last API error.

The Tls and Config structs both provide a way to return the last error as a String from the underlying API.

Required methods

fn last_error(&self) -> Result<String>

Return the last error of the underlying API.

The last_error method returns an error if no error occurred at all, or if memory allocation failed while trying to assemble the string describing the most recent error related to config.

Loading content...

Provided methods

fn to_error<T>(errstr: String) -> Result<T>

Returns the error string as an error object.

Loading content...

Implementors

impl LastError for Config[src]

fn last_error(&self) -> Result<String>[src]

Returns the configuration last error.

The last_error method returns an error if no error occurred with config at all, or if memory allocation failed while trying to assemble the string describing the most recent error related to config.

See also

tls_config_error(3)

impl LastError for Tls[src]

fn last_error(&self) -> Result<String>[src]

Returns the last error of the TLS context.

The last_error method returns an error if no error occurred with the TLS context during or since the last call to tls_handshake, tls_read, tls_write, tls_close, or reset involving the context, or if memory allocation failed while trying to assemble the string describing the most recent error related to the context.

See also

tls_error(3)

Loading content...