---
title: SecretStoreHandle
summary: A low-level interface to Secret Store.
url: https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/secret_store/struct.SecretStoreHandle/
---

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

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

A low-level interface to Secret Store.

Methods here are typically exposed as the `try_*` APIs on
[`crate::secret_store::SecretStore`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/secret_store/struct.SecretStore/) and should not be needed directly.

## Constants

### INVALID

**Type:** `Self`  
**Flags:** read-only  
**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/secret_store/handle.rs#27

An invalid secret store handle.

## Methods

### contains

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

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

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

```rust
unsafe fn from_u32(handle: u32) -> 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`

**Returns**

`Self`

### get

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

```rust
fn get(&self, secret_name: &str) -> Result<Option<SecretHandle>, LookupError>
```

Lookup a secret in this Secret Store, and return a handle to it.

If successful, this function returns `Ok(Some(_))` if a secret was found, or `Ok(None)` if
no secret with the given name was found. If the lookup failed, a [`LookupError`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/secret_store/enum.LookupError/) will be
returned.

**Parameters**

- `self`: `&Self`
- `secret_name`: `&str`

**Returns**

`Result<Option<SecretHandle>, LookupError>`

### open

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

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

Acquire a handle to a Secret Store.

If a handle could not be acquired, an [`OpenError`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/secret_store/enum.OpenError/) will be returned.

**Parameters**

- `secret_store_name`: `&str`

**Returns**

`Result<Self, OpenError>`

## Trait implementations

### impl Debug for SecretStoreHandle

#### fmt

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

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

**Parameters**

- `self`: `&Self`
- `f`: `&mut $crate::fmt::Formatter`

**Returns**

`$crate::fmt::Result`

### impl Hash for SecretStoreHandle

#### hash

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

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

**Parameters**

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

### impl PartialEq for SecretStoreHandle

#### eq

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

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

**Parameters**

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

**Returns**

`bool`

## Auto trait implementations

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

## Blanket implementations

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