Struct foundationdb::Subspace

source ·
pub struct Subspace { /* private fields */ }
Expand description

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§

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

from_bytes returns a new Subspace from the provided bytes.

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

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

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

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.

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

range returns first and last key of given Subspace

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.