pub trait Patches {
type Error: Error + Send + Sync + 'static;
type Iter<'a>: Iterator<Item = Result<(PatchId, Patch), Self::Error>> + 'a
where Self: 'a;
// Required methods
fn get(&self, id: &PatchId) -> Result<Option<Patch>, Self::Error>;
fn find_by_revision(
&self,
id: &RevisionId,
) -> Result<Option<ByRevision>, Self::Error>;
fn list(&self) -> Result<Self::Iter<'_>, Self::Error>;
fn list_by_status(
&self,
status: &Status,
) -> Result<Self::Iter<'_>, Self::Error>;
fn counts(&self) -> Result<PatchCounts, Self::Error>;
// Provided methods
fn opened(&self) -> Result<Self::Iter<'_>, Self::Error> { ... }
fn archived(&self) -> Result<Self::Iter<'_>, Self::Error> { ... }
fn drafted(&self) -> Result<Self::Iter<'_>, Self::Error> { ... }
fn merged(&self) -> Result<Self::Iter<'_>, Self::Error> { ... }
fn is_empty(&self) -> Result<bool, Self::Error> { ... }
}Expand description
A set of read-only methods for a Patch store.
Required Associated Types§
Required Methods§
Sourcefn get(&self, id: &PatchId) -> Result<Option<Patch>, Self::Error>
fn get(&self, id: &PatchId) -> Result<Option<Patch>, Self::Error>
Get the Patch, identified by id, returning None if it
was not found.
Sourcefn find_by_revision(
&self,
id: &RevisionId,
) -> Result<Option<ByRevision>, Self::Error>
fn find_by_revision( &self, id: &RevisionId, ) -> Result<Option<ByRevision>, Self::Error>
Get the Patch and its Revision, identified by the revision
id, returning None if it was not found.
Sourcefn list_by_status(&self, status: &Status) -> Result<Self::Iter<'_>, Self::Error>
fn list_by_status(&self, status: &Status) -> Result<Self::Iter<'_>, Self::Error>
List all patches in the store that match the provided
status.
Also see Patches::opened, Patches::archived,
Patches::drafted, Patches::merged.
Sourcefn counts(&self) -> Result<PatchCounts, Self::Error>
fn counts(&self) -> Result<PatchCounts, Self::Error>
Get the PatchCounts of all the patches in the store.
Provided Methods§
Sourcefn archived(&self) -> Result<Self::Iter<'_>, Self::Error>
fn archived(&self) -> Result<Self::Iter<'_>, Self::Error>
List all archived patches in the store.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.