---
title: Endpoint
summary: A Fastly logging endpoint.
url: https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/log/struct.Endpoint/
---

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

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

A Fastly logging endpoint.

Most applications should use the high-level interface provided by
[`log-fastly`](https://docs.rs/log-fastly) rather than writing to this interface directly.

To write to this endpoint, use the [`std::io::Write`](https://doc.rust-lang.org/stable/core/io/write/trait.Write.html) interface. For example:

```rust
use std::io::Write;
let mut endpoint = Endpoint::from_name("my_endpoint");
writeln!(endpoint, "Hello from the edge!")?;
```

## Methods

### from_name

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/log.rs#125

```rust
fn from_name(name: &str) -> Self
```

Get an `Endpoint` by name.

#### Panics

If the endpoint name is not valid, this function will panic.

**Parameters**

- `name`: `&str`

**Returns**

`Self`

### from_u32

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/log.rs#171

```rust
unsafe fn from_u32(handle: u32, name: String) -> Self
```

Make a handle from its underlying representation.

This should only be used when calling the raw ABI directly, and care should be taken not to
reuse or alias handle values.

**Parameters**

- `handle`: `u32`
- `name`: `String`

**Returns**

`Self`

### name

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/log.rs#116

```rust
fn name(&self) -> &str
```

Get the name of an `Endpoint`.

**Parameters**

- `self`: `&Self`

**Returns**

`&str`

### try_from_name

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/log.rs#138

```rust
fn try_from_name(name: &str) -> Result<Self, LogError>
```

Try to get an `Endpoint` by name.

Currently, the conditions on an endpoint name are:

- It must not be empty

- It must not contain newlines (`\n`) or colons (`:`)

- It must not be `stdout` or `stderr`, which are reserved for debugging.

**Parameters**

- `name`: `&str`

**Returns**

`Result<Self, LogError>`

## Trait implementations

### impl Clone for Endpoint

#### clone

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/log.rs#36

```rust
fn clone(&self) -> Self
```

**Parameters**

- `self`: `&Self`

**Returns**

`Self`

### impl Debug for Endpoint

#### fmt

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/log.rs#45

```rust
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result
```

**Parameters**

- `self`: `&Self`
- `fmt`: `&mut std::fmt::Formatter`

**Returns**

`std::fmt::Result`

### impl Hash for Endpoint

#### hash

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/log.rs#37

```rust
fn hash<__H: Hasher>(&self, state: &mut __H)
```

**Parameters**

- `self`: `&Self`
- `state`: `&mut __H`

### impl PartialEq for Endpoint

#### eq

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/log.rs#37

```rust
fn eq(&self, other: &Self) -> bool
```

**Parameters**

- `self`: `&Self`
- `other`: `&Self`

**Returns**

`bool`

### impl TryFrom<&str> for Endpoint

#### try_from

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/log.rs#69

```rust
fn try_from(name: &str) -> Result<Self, Self::Error>
```

**Parameters**

- `name`: `&str`

**Returns**

`Result<Self, Self::Error>`

### impl TryFrom<String> for Endpoint

#### try_from

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/log.rs#77

```rust
fn try_from(name: String) -> Result<Self, Self::Error>
```

**Parameters**

- `name`: `String`

**Returns**

`Result<Self, Self::Error>`

### impl Write for Endpoint

#### flush

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/log.rs#105

```rust
fn flush(&mut self) -> Result<()>
```

**Parameters**

- `self`: `&mut Self`

**Returns**

`std::io::Result<()>`

#### write

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/log.rs#83

```rust
fn write(&mut self, buf: &[u8]) -> Result<usize>
```

**Parameters**

- `self`: `&mut Self`
- `buf`: `&[u8]`

**Returns**

`std::io::Result<usize>`

## Auto trait implementations

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

## Blanket implementations

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