pub struct Index {
pub schema: String,
pub capability_floor: CanonVersion,
pub releases: Vec<IndexEntry>,
}Expand description
The complete coverage ledger.
Fields§
§schema: StringAlways INDEX_SCHEMA once parsed.
capability_floor: CanonVersionThe lowest release this ledger covers.
releases: Vec<IndexEntry>One entry per covered release.
Implementations§
Source§impl Index
impl Index
Sourcepub fn parse(bytes: &[u8]) -> Result<Self, GuidanceError>
pub fn parse(bytes: &[u8]) -> Result<Self, GuidanceError>
Read the ledger.
§Errors
GuidanceError for bytes that do not parse, a schema this engine
does not read, or a release listed twice.
Sourcepub fn entry(&self, version: CanonVersion) -> Option<&IndexEntry>
pub fn entry(&self, version: CanonVersion) -> Option<&IndexEntry>
What the ledger says about one release.
Sourcepub fn interval(
&self,
from: Option<CanonVersion>,
to: CanonVersion,
) -> Vec<&IndexEntry>
pub fn interval( &self, from: Option<CanonVersion>, to: CanonVersion, ) -> Vec<&IndexEntry>
Every release in the half-open interval, in order.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Index
impl<'de> Deserialize<'de> for Index
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Index
impl StructuralPartialEq for Index
Auto Trait Implementations§
impl Freeze for Index
impl RefUnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl UnsafeUnpin for Index
impl UnwindSafe for Index
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.