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

pub trait MutTxnT: TxnT {
    pub fn put_graph(
        &mut self,
        channel: &mut Self::Graph,
        k: Vertex<ChangeId>,
        v: Edge
    ) -> Result<bool, Error>;
pub fn del_graph(
        &mut self,
        channel: &mut Self::Graph,
        k: Vertex<ChangeId>,
        v: Option<Edge>
    ) -> Result<bool, Error>;
pub fn put_changes(
        &mut self,
        channel: &mut Channel<Self>,
        p: ChangeId,
        t: ApplyTimestamp,
        h: &Hash
    ) -> Result<Option<Merkle>, Error>;
pub fn del_changes(
        &mut self,
        channel: &mut Channel<Self>,
        p: ChangeId,
        t: ApplyTimestamp
    ) -> Result<bool, Error>;
pub fn open_or_create_channel(
        &mut self,
        name: &str
    ) -> Result<ChannelRef<Self>, Error>;
pub fn fork(
        &mut self,
        channel: &ChannelRef<Self>,
        name: &str
    ) -> Result<ChannelRef<Self>, Error>;
pub fn rename_channel(
        &mut self,
        channel: &mut ChannelRef<Self>,
        name: &str
    ) -> Result<(), Error>;
pub fn drop_channel(&mut self, name: &str) -> Result<bool, Error>;
pub fn commit(self) -> Result<(), Error>;
pub fn put_partials(
        &mut self,
        k: &str,
        e: Position<ChangeId>
    ) -> Result<bool, Error>;
pub fn del_partials(
        &mut self,
        k: &str,
        e: Option<Position<ChangeId>>
    ) -> Result<bool, Error>;
pub fn open_or_create_remote(
        &mut self,
        name: &str
    ) -> Result<RemoteRef<Self>, Error>;
pub fn put_remote(
        &mut self,
        remote: &mut RemoteRef<Self>,
        k: u64,
        v: (Hash, Merkle)
    ) -> Result<bool, Error>;
pub fn del_remote(
        &mut self,
        remote: &mut RemoteRef<Self>,
        k: u64
    ) -> Result<bool, Error>;
pub fn drop_remote(
        &mut self,
        remote: RemoteRef<Self>
    ) -> Result<bool, Error>;
pub fn drop_named_remote(&mut self, remote: &str) -> Result<bool, Error>; }

The trait of immutable transactions.

Required methods

pub fn put_graph(
    &mut self,
    channel: &mut Self::Graph,
    k: Vertex<ChangeId>,
    v: Edge
) -> Result<bool, Error>
[src]

Insert a key and a value to a graph. Returns false if and only if (k, v) was already in the graph, in which case no insertion happened.

pub fn del_graph(
    &mut self,
    channel: &mut Self::Graph,
    k: Vertex<ChangeId>,
    v: Option<Edge>
) -> Result<bool, Error>
[src]

Delete a key and a value from a graph. Returns true if and only if (k, v) was in the graph.

pub fn put_changes(
    &mut self,
    channel: &mut Channel<Self>,
    p: ChangeId,
    t: ApplyTimestamp,
    h: &Hash
) -> Result<Option<Merkle>, Error>
[src]

Add a change and a timestamp to a change table. Returns None if and only if (p, t) was already in the change table, in which case no insertion happened. Returns the new state else.

pub fn del_changes(
    &mut self,
    channel: &mut Channel<Self>,
    p: ChangeId,
    t: ApplyTimestamp
) -> Result<bool, Error>
[src]

Delete a change from a change table. Returns true if and only if (p, t) was in the change table.

pub fn open_or_create_channel(
    &mut self,
    name: &str
) -> Result<ChannelRef<Self>, Error>
[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>, Error>
[src]

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

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

pub fn commit(self) -> Result<(), Error>[src]

Commit this transaction.

pub fn put_partials(
    &mut self,
    k: &str,
    e: Position<ChangeId>
) -> Result<bool, Error>
[src]

pub fn del_partials(
    &mut self,
    k: &str,
    e: Option<Position<ChangeId>>
) -> Result<bool, Error>
[src]

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

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

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

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

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

Loading content...

Implementors

impl MutTxnT for MutTxn<()>[src]

Loading content...