[][src]Trait libpijul::pristine::MutTxnT

pub trait MutTxnT: GraphMutTxnT + ChannelMutTxnT + DepsMutTxnT<DepsError = Self::GraphError> + TreeMutTxnT<TreeError = Self::GraphError> + TxnT {
    pub fn open_or_create_channel(
        &mut self,
        name: &str
    ) -> Result<ChannelRef<Self>, Self::GraphError>;
pub fn fork(
        &mut self,
        channel: &ChannelRef<Self>,
        name: &str
    ) -> Result<ChannelRef<Self>, ForkError<Self::GraphError>>;
pub fn rename_channel(
        &mut self,
        channel: &mut ChannelRef<Self>,
        name: &str
    ) -> Result<(), ForkError<Self::GraphError>>;
pub fn drop_channel(&mut self, name: &str) -> Result<bool, Self::GraphError>;
pub fn commit(self) -> Result<(), Self::GraphError>;
pub fn open_or_create_remote(
        &mut self,
        name: &str
    ) -> Result<RemoteRef<Self>, Self::GraphError>;
pub fn put_remote(
        &mut self,
        remote: &mut RemoteRef<Self>,
        k: u64,
        v: (Hash, Merkle)
    ) -> Result<bool, Self::GraphError>;
pub fn del_remote(
        &mut self,
        remote: &mut RemoteRef<Self>,
        k: u64
    ) -> Result<bool, Self::GraphError>;
pub fn drop_remote(
        &mut self,
        remote: RemoteRef<Self>
    ) -> Result<bool, Self::GraphError>;
pub fn drop_named_remote(
        &mut self,
        remote: &str
    ) -> Result<bool, Self::GraphError>; }

The trait of immutable transactions.

Required methods

pub fn open_or_create_channel(
    &mut self,
    name: &str
) -> Result<ChannelRef<Self>, Self::GraphError>
[src]

Open a channel, creating it if it is missing. The return type is a Rc<RefCell<…>> in order to avoid:

  • opening the same channel twice. Since a channel contains pointers, that could potentially lead to double-borrow issues. We absolutely have to check that at runtime (hence the RefCell).
  • writing the channel to disk (if the backend is written on the disk) for every minor operation on the channel.

Additionally, the Rc is used to:

  • avoid having to commit channels explicitly (channels are committed automatically upon committing the transaction), and
  • to return a value that doesn't borrow the transaction, so that the channel can actually be used in a mutable transaction.

pub fn fork(
    &mut self,
    channel: &ChannelRef<Self>,
    name: &str
) -> Result<ChannelRef<Self>, ForkError<Self::GraphError>>
[src]

pub fn rename_channel(
    &mut self,
    channel: &mut ChannelRef<Self>,
    name: &str
) -> Result<(), ForkError<Self::GraphError>>
[src]

pub fn drop_channel(&mut self, name: &str) -> Result<bool, Self::GraphError>[src]

pub fn commit(self) -> Result<(), Self::GraphError>[src]

Commit this transaction.

pub fn open_or_create_remote(
    &mut self,
    name: &str
) -> Result<RemoteRef<Self>, Self::GraphError>
[src]

pub fn put_remote(
    &mut self,
    remote: &mut RemoteRef<Self>,
    k: u64,
    v: (Hash, Merkle)
) -> Result<bool, Self::GraphError>
[src]

pub fn del_remote(
    &mut self,
    remote: &mut RemoteRef<Self>,
    k: u64
) -> Result<bool, Self::GraphError>
[src]

pub fn drop_remote(
    &mut self,
    remote: RemoteRef<Self>
) -> Result<bool, Self::GraphError>
[src]

pub fn drop_named_remote(
    &mut self,
    remote: &str
) -> Result<bool, Self::GraphError>
[src]

Loading content...

Implementors

impl MutTxnT for MutTxn<()>[src]

Loading content...