[][src]Trait libpijul::pristine::TxnT

pub trait TxnT: Sized {
    pub fn hash_from_prefix(
        &self,
        prefix: &str
    ) -> Result<(Hash, ChangeId), Error>;
pub fn hash_from_prefix_remote(
        &self,
        remote: &RemoteRef<Self>,
        prefix: &str
    ) -> Result<Hash, Error>;
pub fn load_channel(&self, name: &str) -> Option<ChannelRef<Self>>;
pub fn load_remote(&self, name: &str) -> Option<RemoteRef<Self>>;
pub 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>;
;
pub fn iter_rev_remote<'txn>(
        &'txn self,
        remote: &Self::Remote,
        k: Option<u64>
    ) -> RevCursor<Self, &'txn Self, Self::RemoteCursor, u64, (Hash, Merkle)>;
pub fn get_remote(&mut self, name: &str) -> Option<RemoteRef<Self>>;
pub fn last_remote(
        &self,
        remote: &Self::Remote
    ) -> Option<(u64, (Hash, Merkle))>;
pub fn get_remote_state(
        &self,
        remote: &Self::Remote,
        n: u64
    ) -> Option<(u64, (Hash, Merkle))>;
pub fn remote_has_change(
        &self,
        remote: &RemoteRef<Self>,
        hash: Hash
    ) -> bool;
pub fn remote_has_state(
        &self,
        remote: &RemoteRef<Self>,
        hash: Merkle
    ) -> bool;
pub fn channel_has_state(
        &self,
        channel: &ChannelRef<Self>,
        hash: Merkle
    ) -> bool; pub fn tree_path(&self, v: Position<ChangeId>) -> Option<String> { ... }
pub fn current_state<'db, 'txn: 'db>(
        &'txn self,
        channel: &'db Channel<Self>
    ) -> Option<Merkle> { ... } }

The trait of immutable transactions.

Required methods

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

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

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

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.

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

pub 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>;
[src]

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

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

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

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

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

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

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

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

Loading content...

Provided methods

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

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

Loading content...

Implementors

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

pub 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...