Type Definition libpijul::pristine::sanakirja::MutTxn [−][src]
pub type MutTxn<T> = GenericTxn<MutTxn<Arc<Env>, T>>;
Trait Implementations
fn put_changes(
&mut self,
channel: &mut Self::Channel,
p: ChangeId,
t: ApplyTimestamp,
h: &Hash
) -> Result<Option<Merkle>, TxnErr<Self::GraphError>>
fn put_changes(
&mut self,
channel: &mut Self::Channel,
p: ChangeId,
t: ApplyTimestamp,
h: &Hash
) -> Result<Option<Merkle>, TxnErr<Self::GraphError>>
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.
fn del_changes(
&mut self,
channel: &mut Self::Channel,
p: ChangeId,
t: ApplyTimestamp
) -> Result<bool, TxnErr<Self::GraphError>>
fn del_changes(
&mut self,
channel: &mut Self::Channel,
p: ChangeId,
t: ApplyTimestamp
) -> Result<bool, TxnErr<Self::GraphError>>
Delete a change from a change table. Returns true
if and only if (p, t)
was in the change table.
fn del_revdep(
&mut self,
k: &ChangeId,
v: Option<&ChangeId>
) -> Result<bool, TxnErr<Self::DepsError>>
fn put_touched_files(
&mut self,
k: &Position<ChangeId>,
v: &ChangeId
) -> Result<bool, TxnErr<Self::DepsError>>
fn del_touched_files(
&mut self,
k: &Position<ChangeId>,
v: Option<&ChangeId>
) -> Result<bool, TxnErr<Self::DepsError>>
fn put_rev_touched_files(
&mut self,
k: &ChangeId,
v: &Position<ChangeId>
) -> Result<bool, TxnErr<Self::DepsError>>
fn put_graph(
&mut self,
graph: &mut Self::Graph,
k: &Vertex<ChangeId>,
e: &SerializedEdge
) -> Result<bool, TxnErr<Self::GraphError>>
fn put_graph(
&mut self,
graph: &mut Self::Graph,
k: &Vertex<ChangeId>,
e: &SerializedEdge
) -> Result<bool, TxnErr<Self::GraphError>>
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.
fn del_graph(
&mut self,
graph: &mut Self::Graph,
k: &Vertex<ChangeId>,
e: Option<&SerializedEdge>
) -> Result<bool, TxnErr<Self::GraphError>>
fn del_graph(
&mut self,
graph: &mut Self::Graph,
k: &Vertex<ChangeId>,
e: Option<&SerializedEdge>
) -> Result<bool, TxnErr<Self::GraphError>>
Delete a key and a value from a graph. Returns true
if and only if (k, v)
was in the graph.
fn put_internal(
&mut self,
k: &SerializedHash,
v: &ChangeId
) -> Result<bool, TxnErr<Self::GraphError>>
fn del_internal(
&mut self,
k: &SerializedHash,
v: Option<&ChangeId>
) -> Result<bool, TxnErr<Self::GraphError>>
fn put_external(
&mut self,
k: &ChangeId,
v: &SerializedHash
) -> Result<bool, TxnErr<Self::GraphError>>
fn del_external(
&mut self,
k: &ChangeId,
v: Option<&SerializedHash>
) -> Result<bool, TxnErr<Self::GraphError>>
fn split_block(
&mut self,
graph: &mut Self::Graph,
key: &Vertex<ChangeId>,
pos: ChangePosition,
buf: &mut Vec<SerializedEdge>
) -> Result<(), TxnErr<Self::GraphError>>
fn split_block(
&mut self,
graph: &mut Self::Graph,
key: &Vertex<ChangeId>,
pos: ChangePosition,
buf: &mut Vec<SerializedEdge>
) -> Result<(), TxnErr<Self::GraphError>>
Split a key [a, b[
at position pos
, yielding two keys [a, pos[
and [pos, b[
linked by an edge. Read more
fn put_remote(
&mut self,
remote: &mut RemoteRef<Self>,
k: u64,
v: (Hash, Merkle)
) -> Result<bool, Self::GraphError>
fn del_remote(
&mut self,
remote: &mut RemoteRef<Self>,
k: u64
) -> Result<bool, Self::GraphError>
fn open_or_create_channel(
&mut self,
name: &str
) -> Result<ChannelRef<Self>, Self::GraphError>
fn open_or_create_channel(
&mut self,
name: &str
) -> Result<ChannelRef<Self>, Self::GraphError>
Open a channel, creating it if it is missing. The return type
is a Rc<RefCell<…>>
in order to avoid: Read more
fn fork(
&mut self,
channel: &ChannelRef<Self>,
new_name: &str
) -> Result<ChannelRef<Self>, ForkError<Self::GraphError>>
fn rename_channel(
&mut self,
channel: &mut ChannelRef<Self>,
new_name: &str
) -> Result<(), ForkError<Self::GraphError>>
fn open_or_create_remote(
&mut self,
id: RemoteId,
path: &str
) -> Result<RemoteRef<Self>, Self::GraphError>
Commit this transaction.
fn apply_change_ws<C: ChangeStore>(
&mut self,
changes: &C,
channel: &mut Self::Channel,
hash: &Hash,
workspace: &mut ApplyWorkspace
) -> Result<(u64, Merkle), ApplyError<C::Error, Self::GraphError>>
fn apply_change_rec_ws<C: ChangeStore>(
&mut self,
changes: &C,
channel: &mut Self::Channel,
hash: &Hash,
workspace: &mut ApplyWorkspace
) -> Result<(), ApplyError<C::Error, Self::GraphError>>
fn apply_change<C: ChangeStore>(
&mut self,
changes: &C,
channel: &mut Self::Channel,
hash: &Hash
) -> Result<(u64, Merkle), ApplyError<C::Error, Self::GraphError>>
fn apply_change_rec<C: ChangeStore>(
&mut self,
changes: &C,
channel: &mut Self::Channel,
hash: &Hash
) -> Result<(), ApplyError<C::Error, Self::GraphError>>
fn apply_deps_rec<C: ChangeStore>(
&mut self,
changes: &C,
channel: &mut Self::Channel,
hash: &Hash
) -> Result<(), ApplyError<C::Error, Self::GraphError>>
fn apply_local_change_ws(
&mut self,
channel: &ChannelRef<Self>,
change: &Change,
hash: &Hash,
inode_updates: &HashMap<usize, InodeUpdate>,
workspace: &mut ApplyWorkspace
) -> Result<(u64, Merkle), LocalApplyError<Self::GraphError>>
fn apply_local_change(
&mut self,
channel: &ChannelRef<Self>,
change: &Change,
hash: &Hash,
inode_updates: &HashMap<usize, InodeUpdate>
) -> Result<(u64, Merkle), LocalApplyError<Self::GraphError>>
fn apply_recorded<C: ChangeStore>(
&mut self,
channel: &mut ChannelRef<Self>,
recorded: Recorded,
changestore: &C
) -> Result<Hash, ApplyError<C::Error, Self::GraphError>>
fn unrecord<C: ChangeStore>(
&mut self,
changes: &C,
channel: &ChannelRef<Self>,
hash: &Hash,
salt: u64
) -> Result<bool, UnrecordError<C::Error, Self::GraphError>>
Register a file in the working copy, where the file is given by
its path from the root of the repository, where the components of
the path are separated by /
(example path: a/b/c
). Read more
Register a directory in the working copy, where the directory is
given by its path from the root of the repository, where the
components of the path are separated by /
(example path:
a/b/c
). Read more
Register a file or directory in the working copy, given by its
path from the root of the repository, where the components of the
path are separated by /
(example path: a/b/c
). Read more
fn archive_with_state<P: ChangeStore, A: Archive>(
&mut self,
changes: &P,
channel: &mut ChannelRef<Self>,
state: &Merkle,
extra: &[Hash],
arch: &mut A,
salt: u64
) -> Result<Vec<Conflict>, ArchiveError<P::Error, Self::GraphError, A::Error>>
fn archive_prefix_with_state<'a, P: ChangeStore, A: Archive, I: Iterator<Item = &'a str>>(
&mut self,
changes: &P,
channel: &mut ChannelRef<Self>,
state: &Merkle,
extra: &[Hash],
prefix: &mut I,
arch: &mut A,
salt: u64
) -> Result<Vec<Conflict>, ArchiveError<P::Error, Self::GraphError, A::Error>>
fn archive_prefix_with_state<'a, P: ChangeStore, A: Archive, I: Iterator<Item = &'a str>>(
&mut self,
changes: &P,
channel: &mut ChannelRef<Self>,
state: &Merkle,
extra: &[Hash],
prefix: &mut I,
arch: &mut A,
salt: u64
) -> Result<Vec<Conflict>, ArchiveError<P::Error, Self::GraphError, A::Error>>
Warning: this method unrecords changes until finding the state. If this is not wanted, please fork the channel before calling. Read more