Struct gnunet_sys::GNUNET_BANDWIDTH_Tracker[][src]

#[repr(C)]pub struct GNUNET_BANDWIDTH_Tracker {
    pub update_cb_cls: *mut c_void,
    pub update_cb: GNUNET_BANDWIDTH_TrackerUpdateCallback,
    pub excess_cb_cls: *mut c_void,
    pub excess_cb: GNUNET_BANDWIDTH_ExcessNotificationCallback,
    pub consumption_since_last_update__: i64,
    pub excess_task: *mut GNUNET_SCHEDULER_Task,
    pub last_update__: GNUNET_TIME_Absolute,
    pub available_bytes_per_s__: u32,
    pub max_carry_s__: u32,
}

Struct to track available bandwidth. Combines a time stamp with a number of bytes transmitted, a quota and a maximum amount that carries over. Not opaque so that it can be inlined into data structures (reducing malloc-ing); however, values should not be accessed directly by clients (hence the ‘__’).

Fields

update_cb_cls: *mut c_void

Closure for @e update_cb.

update_cb: GNUNET_BANDWIDTH_TrackerUpdateCallback

Function we call if the tracker’s bandwidth is increased and a previously returned timeout might now expire earlier.

excess_cb_cls: *mut c_void

Closure for @e excess_cb.

excess_cb: GNUNET_BANDWIDTH_ExcessNotificationCallback

Function we call if the tracker is about to throw away bandwidth due to excess (max carry exceeded).

consumption_since_last_update__: i64

Number of bytes consumed since we last updated the tracker.

excess_task: *mut GNUNET_SCHEDULER_Task

Task scheduled to call the @e excess_cb once we have reached the maximum bandwidth the tracker can hold.

last_update__: GNUNET_TIME_Absolute

Time when we last updated the tracker.

available_bytes_per_s__: u32

Bandwidth limit to enforce in bytes per second.

max_carry_s__: u32

Maximum number of seconds over which bandwidth may “accumulate”. Note that additionally, we also always allow at least #GNUNET_MAX_MESSAGE_SIZE to accumulate.

Trait Implementations

impl Clone for GNUNET_BANDWIDTH_Tracker[src]

impl Copy for GNUNET_BANDWIDTH_Tracker[src]

impl Debug for GNUNET_BANDWIDTH_Tracker[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.