[][src]Trait libanu::pristine::TxnT

pub trait TxnT: Sized {
    fn hash_from_prefix(&self, prefix: &str) -> Result<(Hash, ChangeId), Error>;
fn hash_from_prefix_remote(
        &self,
        remote: &RemoteRef<Self>,
        prefix: &str
    ) -> Result<Hash, Error>;
fn load_channel(&self, name: &str) -> Option<ChannelRef<Self>>;
fn load_remote(&self, name: &str) -> Option<RemoteRef<Self>>;
fn iter_channels<'txn>(
        &'txn self,
        start: &str
    ) -> ChannelIterator<'txn, Self>

Notable traits for ChannelIterator<'txn, T>

impl<'txn, T: TxnT> Iterator for ChannelIterator<'txn, T> type Item = ChannelRef<T>;
;
fn iter_rev_remote<'txn>(
        &'txn self,
        remote: &Self::Remote,
        k: Option<u64>
    ) -> RevCursor<Self, &'txn Self, Self::RemoteCursor, u64, (Hash, Merkle)>;
fn get_remote(&mut self, name: &str) -> Option<RemoteRef<Self>>;
fn last_remote(
        &self,
        remote: &Self::Remote
    ) -> Option<(u64, (Hash, Merkle))>;
fn get_remote_state(
        &self,
        remote: &Self::Remote,
        n: u64
    ) -> Option<(u64, (Hash, Merkle))>;
fn remote_has_change(&self, remote: &RemoteRef<Self>, hash: Hash) -> bool;
fn remote_has_state(&self, remote: &RemoteRef<Self>, hash: Merkle) -> bool;
fn channel_has_state(
        &self,
        channel: &ChannelRef<Self>,
        hash: Merkle
    ) -> bool; fn tree_path(&self, v: Position<ChangeId>) -> Option<String> { ... }
fn current_state<'db, 'txn: 'db>(
        &'txn self,
        channel: &'db Channel<Self>
    ) -> Option<Merkle> { ... } }

The trait of immutable transactions.

Required methods

fn hash_from_prefix(&self, prefix: &str) -> Result<(Hash, ChangeId), Error>

fn hash_from_prefix_remote(
    &self,
    remote: &RemoteRef<Self>,
    prefix: &str
) -> Result<Hash, Error>

fn load_channel(&self, name: &str) -> Option<ChannelRef<Self>>

Returns a handle to the channel with name name, if it exists. In order to prevent memory leaks, channels have to be committed after use.

See the note about the return type of MutTxnT::open_or_create_channel. Since a mutable transaction type could implement both this trait and MutTxnT, the return type of this function must use the same logic as the return type of MutTxnT::open_or_create_channel.

fn load_remote(&self, name: &str) -> Option<RemoteRef<Self>>

fn iter_channels<'txn>(&'txn self, start: &str) -> ChannelIterator<'txn, Self>

Notable traits for ChannelIterator<'txn, T>

impl<'txn, T: TxnT> Iterator for ChannelIterator<'txn, T> type Item = ChannelRef<T>;

Iterate a function over all channels. The loop stops the first time f returns false.

fn iter_rev_remote<'txn>(
    &'txn self,
    remote: &Self::Remote,
    k: Option<u64>
) -> RevCursor<Self, &'txn Self, Self::RemoteCursor, u64, (Hash, Merkle)>

fn get_remote(&mut self, name: &str) -> Option<RemoteRef<Self>>

fn last_remote(&self, remote: &Self::Remote) -> Option<(u64, (Hash, Merkle))>

fn get_remote_state(
    &self,
    remote: &Self::Remote,
    n: u64
) -> Option<(u64, (Hash, Merkle))>

fn remote_has_change(&self, remote: &RemoteRef<Self>, hash: Hash) -> bool

fn remote_has_state(&self, remote: &RemoteRef<Self>, hash: Merkle) -> bool

fn channel_has_state(&self, channel: &ChannelRef<Self>, hash: Merkle) -> bool

Loading content...

Provided methods

fn tree_path(&self, v: Position<ChangeId>) -> Option<String>

fn current_state<'db, 'txn: 'db>(
    &'txn self,
    channel: &'db Channel<Self>
) -> Option<Merkle>

Loading content...

Implementors

impl<T: Transaction> TxnT for GenericTxn<T>[src]

fn load_channel(&self, name: &str) -> Option<ChannelRef<Self>>[src]

type Channels = Db<UnsafeSmallStr, (u64, u64, u64, u64, u64, u64)>

type Remotes = Db<UnsafeSmallStr, (u64, u64, u64)>

type Remote = Db<u64, (Hash, Merkle)>

type Revremote = Db<Hash, u64>

type Remotestates = Db<Merkle, u64>

Loading content...