Struct ethcore_light::net::buffer_flow::FlowParams [] [src]

pub struct FlowParams { /* fields omitted */ }

A buffer-flow manager handles costs, recharge, limits

Methods

impl FlowParams
[src]

Create new flow parameters from a request cost table, buffer limit, and (minimum) rate of recharge.

Create effectively infinite flow params.

Get a reference to the buffer limit.

Get a reference to the cost table.

Get a reference to the recharge rate.

Compute the actual cost of a request, given the kind of request and number of requests made.

Compute the maximum number of costs of a specific kind which can be made with the given buffer. Saturates at usize::max(). This is not a problem in practice because this amount of requests is already prohibitively large.

Create initial buffer parameter.

Recharge the buffer based on time passed since last update.

Refund some buffer which was previously deducted. Does not update the recharge timestamp.

Trait Implementations

impl Debug for FlowParams
[src]

Formats the value using the given formatter.

impl Clone for FlowParams
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for FlowParams
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Default for FlowParams
[src]

Returns the "default value" for a type. Read more