---
title: Prefix
summary: Smart pointer returned by Body::getprefixmut().
url: https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/body/struct.Prefix/
---

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

```rust
pub struct Prefix<'a> { /* private fields */ }
```

Smart pointer returned by [`Body::get_prefix_mut()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/body/struct.Body/#method-get_prefix_mut).

## Methods

### take

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/body.rs#463

```rust
fn take(self) -> Vec<u8>
```

Return the prefix as a byte vector without writing it back to the `Body` from which it came.

**Parameters**

- `self`: `Self`

**Returns**

`Vec<u8>`

## Trait implementations

### impl Debug for Prefix

#### fmt

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/body.rs#447

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

**Parameters**

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

**Returns**

`std::fmt::Result`

### impl Deref for Prefix

#### deref

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/body.rs#471

```rust
fn deref(&self) -> &Self::Target
```

**Parameters**

- `self`: `&Self`

**Returns**

`&Self::Target`

### impl DerefMut for Prefix

#### deref_mut

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/body.rs#477

```rust
fn deref_mut(&mut self) -> &mut Self::Target
```

**Parameters**

- `self`: `&mut Self`

**Returns**

`&mut Self::Target`

### impl Drop for Prefix

#### drop

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/body.rs#483

```rust
fn drop(&mut self)
```

**Parameters**

- `self`: `&mut 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`
- `Receiver`
- `Same`
- `TryFrom<U>`
- `TryInto<U>`
