Struct async_speed_limit::limiter::Resource[][src]

pub struct Resource<R, C: Clock> { /* fields omitted */ }
Expand description

A speed-limited wrapper of a byte stream.

The Resource can be used to limit speed of

Just like Limiter, the delay is inserted after the data are sent or received, in which we know the exact amount of bytes transferred to give an accurate delay. The instantaneous speed can exceed the limit if many read/write tasks are started simultaneously. Therefore, restricting the concurrency is also important to avoid breaching the constraint.

Implementations

Creates a new speed-limited resource.

To make the resouce have unlimited speed, set the speed of Limiter to infinity.

Unwraps this value, returns the underlying resource.

Gets a reference to the underlying resource.

It is inadvisable to directly operate the underlying resource.

Gets a mutable reference to the underlying resource.

It is inadvisable to directly operate the underlying resource.

Gets a pinned reference to the underlying resource.

It is inadvisable to directly operate the underlying resource.

Gets a pinned mutable reference to the underlying resource.

It is inadvisable to directly operate the underlying resource.

Trait Implementations

Determines if this AsyncReader can work with buffers of uninitialized memory. Read more

Attempt to read from the AsyncRead into buf. Read more

Attempt to read from the AsyncRead into bufs using vectored IO operations. Read more

Attempt to write bytes from buf into the object. Read more

Attempt to write bytes from bufs into the object using vectored IO operations. Read more

Attempt to flush the object, ensuring that any buffered data reach their destination. Read more

Attempt to close the object. 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

Performs the conversion.

Performs the conversion.

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.