Struct jammdb::BucketData[][src]

pub struct BucketData { /* fields omitted */ }

Nested bucket placeholder

This data type signifies that a given key is associated with a nested bucket.alloc You can access the key using the name function. The bucket's name can be used to retreive the bucket using the get_bucket function.

Examples

use jammdb::{DB, Data};

let db = DB::open("my.db")?;
let mut tx = db.tx(true)?;
let bucket = tx.create_bucket("my-bucket")?;

bucket.create_bucket("my-nested-bucket")?;
if let Some(data) = bucket.get("my-nested-bucket") {
    if let Data::Bucket(b) = &*data {
        let name: &[u8] = b.name();
        assert_eq!(name, b"my-nested-bucket");
        let nested_bucket = bucket.get_bucket(b.name()).unwrap();
    }
}

Implementations

impl BucketData[src]

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

Returns the name of the bucket as a byte slice.

Trait Implementations

impl Clone for BucketData[src]

impl Debug for BucketData[src]

impl PartialEq<BucketData> for BucketData[src]

impl StructuralPartialEq for BucketData[src]

Auto Trait Implementations

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> Same<T> for T

type Output = T

Should always be Self

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.