pub struct Patches<'a, R> { /* private fields */ }
Implementations§
Source§impl<'a, R> Patches<'a, R>
impl<'a, R> Patches<'a, R>
Sourcepub fn open(repository: &'a R) -> Result<Self, RepositoryError>
pub fn open(repository: &'a R) -> Result<Self, RepositoryError>
Open a patches store.
Sourcepub fn counts(&self) -> Result<PatchCounts, Error>
pub fn counts(&self) -> Result<PatchCounts, Error>
Patches count by state.
Sourcepub fn find_by_revision(
&self,
revision: &RevisionId,
) -> Result<Option<ByRevision>, Error>
pub fn find_by_revision( &self, revision: &RevisionId, ) -> Result<Option<ByRevision>, Error>
Find the Patch
containing the given Revision
.
Source§impl<'a, R> Patches<'a, R>
impl<'a, R> Patches<'a, R>
Sourcepub fn create<'g, C, G>(
&'g mut self,
title: impl ToString,
description: impl ToString,
target: MergeTarget,
base: impl Into<Oid>,
oid: impl Into<Oid>,
labels: &[Label],
cache: &'g mut C,
signer: &Device<G>,
) -> Result<PatchMut<'a, 'g, R, C>, Error>
pub fn create<'g, C, G>( &'g mut self, title: impl ToString, description: impl ToString, target: MergeTarget, base: impl Into<Oid>, oid: impl Into<Oid>, labels: &[Label], cache: &'g mut C, signer: &Device<G>, ) -> Result<PatchMut<'a, 'g, R, C>, Error>
Open a new patch.
Sourcepub fn draft<'g, C, G>(
&'g mut self,
title: impl ToString,
description: impl ToString,
target: MergeTarget,
base: impl Into<Oid>,
oid: impl Into<Oid>,
labels: &[Label],
cache: &'g mut C,
signer: &Device<G>,
) -> Result<PatchMut<'a, 'g, R, C>, Error>
pub fn draft<'g, C, G>( &'g mut self, title: impl ToString, description: impl ToString, target: MergeTarget, base: impl Into<Oid>, oid: impl Into<Oid>, labels: &[Label], cache: &'g mut C, signer: &Device<G>, ) -> Result<PatchMut<'a, 'g, R, C>, Error>
Draft a patch. This patch will be created in a State::Draft
state.
Methods from Deref<Target = Store<'a, Patch, R>>§
pub fn transaction( &self, actions: Vec<T::Action>, embeds: Vec<Embed<Uri>>, ) -> Transaction<T, R>
Sourcepub fn update<G>(
&self,
type_name: &TypeName,
object_id: ObjectId,
message: &str,
actions: impl Into<NonEmpty<T::Action>>,
embeds: Vec<Embed<Uri>>,
signer: &Device<G>,
) -> Result<Updated<T>, Error>
pub fn update<G>( &self, type_name: &TypeName, object_id: ObjectId, message: &str, actions: impl Into<NonEmpty<T::Action>>, embeds: Vec<Embed<Uri>>, signer: &Device<G>, ) -> Result<Updated<T>, Error>
Update an object.
Sourcepub fn create<G>(
&self,
message: &str,
actions: impl Into<NonEmpty<T::Action>>,
embeds: Vec<Embed<Uri>>,
signer: &Device<G>,
) -> Result<(ObjectId, T), Error>
pub fn create<G>( &self, message: &str, actions: impl Into<NonEmpty<T::Action>>, embeds: Vec<Embed<Uri>>, signer: &Device<G>, ) -> Result<(ObjectId, T), Error>
Create an object.
Sourcepub fn remove<G>(&self, id: &ObjectId, signer: &Device<G>) -> Result<(), Error>
pub fn remove<G>(&self, id: &ObjectId, signer: &Device<G>) -> Result<(), Error>
Remove an object.
Trait Implementations§
Auto Trait Implementations§
impl<'a, R> Freeze for Patches<'a, R>
impl<'a, R> RefUnwindSafe for Patches<'a, R>where
R: RefUnwindSafe,
impl<'a, R> Send for Patches<'a, R>where
R: Sync,
impl<'a, R> Sync for Patches<'a, R>where
R: Sync,
impl<'a, R> Unpin for Patches<'a, R>
impl<'a, R> UnwindSafe for Patches<'a, R>where
R: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more