---
title: SecretStore
summary: A Compute Secret Store.
url: https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/secret_store/struct.SecretStore/
---

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

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

A Compute Secret Store.

A secret store name has a maximum length of 255 bytes and must
contain only letters, numbers, dashes (-), underscores (_), and
periods (.).

## Methods

### contains

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/secret_store.rs#56

```rust
fn contains(&self, name: &str) -> Result<bool, LookupError>
```

Return true if the secret store contains a secret with the given
name.

**Parameters**

- `self`: `&Self`
- `name`: `&str`

**Returns**

`Result<bool, LookupError>`

### from_handle

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

```rust
fn from_handle(handle: SecretStoreHandle) -> Self
```

Create a `SecretStore` from a `SecretStoreHandle`.

**Parameters**

- `handle`: `SecretStoreHandle`

**Returns**

`Self`

### get

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/secret_store.rs#32

```rust
fn get(&self, name: &str) -> Option<Secret>
```

Lookup a [`Secret`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/secret_store/struct.Secret/) by name in this secret store.

Returns `Some(secret)` if the secret is found, and `None` if the secret was not found.

See [`try_get()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/secret_store/struct.SecretStore/#method-try_get) for a fallible equivalent of this method.

**Parameters**

- `self`: `&Self`
- `name`: `&str`

**Returns**

`Option<Secret>`

### open

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/secret_store.rs#23

```rust
fn open(name: &str) -> Result<Self, OpenError>
```

Open the Secret Store with the given name.

**Parameters**

- `name`: `&str`

**Returns**

`Result<Self, OpenError>`

### try_get

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/secret_store.rs#41

```rust
fn try_get(&self, name: &str) -> Result<Option<Secret>, LookupError>
```

Try to lookup a [`Secret`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/secret_store/struct.Secret/) by name in this secret store.

If successful, this method returns `Ok(Some(secret))` if the secret is found, or `Ok(None)`
if the secret was not found.

**Parameters**

- `self`: `&Self`
- `name`: `&str`

**Returns**

`Result<Option<Secret>, LookupError>`

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