---
title: LookupResponse
summary: A response from a KV Store Lookup operation.
url: https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/kv_store/struct.LookupResponse/
---

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

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

A response from a KV Store Lookup operation.

This type holds the [`Body`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/body/struct.Body/), metadata, and generation of found key.

## Methods

### current_generation

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/kv_store.rs#79

```rust
fn current_generation(&self) -> u64
```

Read the current generation of the KVStore item.

Returns the current generation in a `u64`

**Parameters**

- `self`: `&Self`

**Returns**

`u64`

### generation

**Flags:** deprecated  
**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/kv_store.rs#72

> **DEPRECATED:** `generation` has a bug in this version of the SDK, and will always return 0

```rust
fn generation(&self) -> u32
```

Read the generation of the KVStore item.

Returns the generation in a `u32`

**Parameters**

- `self`: `&Self`

**Returns**

`u32`

### metadata

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

```rust
fn metadata(&self) -> Option<Bytes>
```

Read the metadata of the KVStore item.

Returns the metadata in a `Option<bytes::Bytes>`

**Parameters**

- `self`: `&Self`

**Returns**

`Option<bytes::Bytes>`

### take_body

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

```rust
fn take_body(&mut self) -> Body
```

Return the `Body` from a `LookupResponse`.

Returns the body contents in a `Body`

**Parameters**

- `self`: `&mut Self`

**Returns**

`Body`

### take_body_bytes

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/kv_store.rs#50

```rust
fn take_body_bytes(&mut self) -> Vec<u8>
```

Convert the `LookupResponse` body into a byte vector.

Returns the body contents in a `Vec<u8>`

**Parameters**

- `self`: `&mut Self`

**Returns**

`Vec<u8>`

### try_take_body

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/kv_store.rs#43

```rust
fn try_take_body(&mut self) -> Option<Body>
```

Take and return the body from this response if it has one, otherwise return `None`.

After calling this method, this response will no longer have a body.

**Parameters**

- `self`: `&mut Self`

**Returns**

`Option<Body>`

## 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>`
