ConfigStoreHandle

Structin config_storefastly 0.13.1View source
pub struct ConfigStoreHandle { /* private fields */ }

A low-level interface to Config Store.

Methods here are typically exposed as the try_* APIs on crate::config_store::ConfigStore and should not be needed directly. Additionally, the get() method allows the caller to configure the size of the buffer used to receive lookup results from the host. The size of this buffer is typically managed by APIs exposed in crate::config_store::ConfigStore.

Constants

INVALID

Selfread-onlyView source

An invalid handle.

Methods

contains

View source
fn contains(&self, key: &str) -> Result<bool, LookupError>

Return true if the config store contains an entry with the given key.

Parameters

self: &Self
key: &str

Returns

from_u32

View source
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
fn get(&self, key: &str, initial_buf_len: usize) -> Result<Option<String>, LookupError>

Lookup a value in this config store.

If successful, this function returns Ok(Some(_)) if an entry was found, or Ok(None) if no entry with the given key was found. If the lookup failed, a LookupError will be returned.

Parameters

self: &Self
key: &str
initial_buf_len: usize

Returns

is_invalid

View source
fn is_invalid(&self) -> bool

Return true if the crate::config_store::ConfigStore handle is invalid.

Parameters

self: &Self

Returns

bool

is_valid

View source
fn is_valid(&self) -> bool

Return true if the crate::config_store::ConfigStore handle is valid.

Parameters

self: &Self

Returns

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

Acquire a handle to an Config Store.

If a handle could not be acquired, an OpenError will be returned.

Parameters

name: &str

Returns

Trait implementations

impl Debug for ConfigStoreHandle

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

Parameters

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

Returns

$crate::fmt::Result

impl Hash for ConfigStoreHandle

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

Parameters

self: &Self
state: &mut __H

impl PartialEq for ConfigStoreHandle

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

Parameters

self: &Self
other: &Self

Returns

bool

Auto trait implementations

Blanket implementations