pub struct TimeoutExtension(_);
Expand description

请求超时时长扩展

Implementations§

新建请求超时时长扩展

获取请求超时时长扩展的值

Examples found in repository?
src/client.rs (line 133)
129
130
131
132
133
134
135
136
137
fn add_extensions_to_request_builder(request: &RequestParts, mut request_builder: UreqRequest) -> UreqRequest {
    use super::extensions::TimeoutExtension;

    if let Some(extension) = request.extensions().get::<TimeoutExtension>() {
        request_builder = request_builder.timeout(extension.get());
    }

    request_builder
}

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.