Penaltybox

Structin erlfastly 0.13.1View source
pub struct Penaltybox { /* private fields */ }

A penaltybox that can be used with the edge rate limiter or stand alone for adding and checking if some entry is in the data set.

Methods

fn add(&self, entry: &str, ttl: Duration) -> Result<(), ERLError>

Add entry to a the penaltybox for the duration of ttl. Valid ttl span is 1m to 1h and TTL value is truncated to the nearest minute.

Parameters

self: &Self
entry: &str
ttl: Duration

Returns

fn has(&self, entry: &str) -> Result<bool, ERLError>

Check if entry is in the penaltybox.

Parameters

self: &Self
entry: &str

Returns

fn open(penaltybox_name: &str) -> Self

Open a Penaltybox identified by the given name.

Parameters

penaltybox_name: &str

Returns

Self

Auto trait implementations

Blanket implementations