[][src]Struct foundationdb::tuple::Subspace

pub struct Subspace { /* fields omitted */ }

Represents a well-defined region of keyspace in a FoundationDB database

It provides a convenient way to use FoundationDB tuples to define namespaces for different categories of data. The namespace is specified by a prefix tuple which is prepended to all tuples packed by the subspace. When unpacking a key with the subspace, the prefix tuple will be removed from the result.

As a best practice, API clients should use at least one subspace for application data. For general guidance on subspace usage, see the Subspaces section of the Developer Guide.

Implementations

impl Subspace[src]

pub fn all() -> Subspace[src]

all returns the Subspace corresponding to all keys in a FoundationDB database.

pub fn from_bytes(bytes: &[u8]) -> Self[src]

from_bytes returns a new Subspace from the provided bytes.

pub fn subspace<T: TuplePack>(&self, t: &T) -> Self[src]

Returns a new Subspace whose prefix extends this Subspace with a given tuple encodable.

pub fn bytes(&self) -> &[u8][src]

bytes returns the literal bytes of the prefix of this Subspace.

pub fn pack<T: TuplePack>(&self, t: &T) -> Vec<u8>[src]

Returns the key encoding the specified Tuple with the prefix of this Subspace prepended.

pub fn unpack<'de, T: TupleUnpack<'de>>(&self, key: &'de [u8]) -> PackResult<T>[src]

unpack returns the Tuple encoded by the given key with the prefix of this Subspace removed. unpack will return an error if the key is not in this Subspace or does not encode a well-formed Tuple.

pub fn is_start_of(&self, key: &[u8]) -> bool[src]

is_start_of returns true if the provided key starts with the prefix of this Subspace, indicating that the Subspace logically contains the key.

pub fn range(&self) -> (Vec<u8>, Vec<u8>)[src]

range returns first and last key of given Subspace

Trait Implementations

impl Clone for Subspace[src]

impl Debug for Subspace[src]

impl<'a> From<&'a Subspace> for RangeOption<'static>[src]

impl<E: TuplePack> From<E> for Subspace[src]

Auto Trait Implementations

impl RefUnwindSafe for Subspace

impl Send for Subspace

impl Sync for Subspace

impl Unpin for Subspace

impl UnwindSafe for Subspace

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,