---
title: ERL
summary: An edge rate limiter which includes a ratecounter and a penaltybox.
url: https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/erl/struct.ERL/
---

**Kind:** Struct  
**Module:** [erl](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/erl/)  
**Package:** fastly 0.13.1  
**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/erl.rs#12

```rust
pub struct ERL { /* private fields */ }
```

An edge rate limiter which includes a ratecounter and a penaltybox.

## Methods

### check_rate

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/erl.rs#71

```rust
fn check_rate(&self, entry: &str, delta: u32, window: RateWindow, limit: u32, ttl: Duration) -> Result<bool, ERLError>
```

Increment an entry in a rate counter and check if the client has exceeded some average number of requests per second (RPS) over the window.
If the client is over the rps limit for the window, add to the penaltybox for ttl.
Valid ttl span is 1m to 1h and TTL value is truncated to the nearest minute.

**Parameters**

- `self`: `&Self`
- `entry`: `&str`
- `delta`: `u32`
- `window`: `RateWindow`
- `limit`: `u32`
- `ttl`: `Duration`

**Returns**

`Result<bool, ERLError>`

### open

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/erl.rs#61

```rust
fn open(ratecounter: RateCounter, penaltybox: Penaltybox) -> Self
```

Open a ERL with the given ratecounter and penaltybox.

**Parameters**

- `ratecounter`: `RateCounter`
- `penaltybox`: `Penaltybox`

**Returns**

`Self`

## Auto trait implementations

- `Freeze`
- `RefUnwindSafe`
- `Send`
- `Sync`
- `Unpin`
- `UnsafeUnpin`
- `UnwindSafe`

## Blanket implementations

- `Any`
- `Borrow<T>`
- `BorrowMut<T>`
- `Downcast`
- `DowncastSync`
- `ErasedDestructor`
- `From<T>`
- `Into<U>`
- `IntoEither`
- `Same`
- `TryFrom<U>`
- `TryInto<U>`
