pub struct RepositoryObservations {
pub index: AnswerObservation,
pub git: AnswerObservation,
}Expand description
The two pictures a process takes of the repository, each with when it was taken.
A picture without a window is never stale, and its window is not serialized.
use std::time::{Duration, UNIX_EPOCH};
use majordomus_cli::index::{AnswerObservation, RepositoryObservations};
let now = RepositoryObservations {
index: AnswerObservation::taken("index build", UNIX_EPOCH, None),
git: AnswerObservation::taken("git read", UNIX_EPOCH, Some(Duration::from_secs(120))),
};
let json = serde_json::to_value(&now).unwrap();
assert_eq!(json["git"]["stale_after"], "1970-01-01T00:02:00Z");
assert!(json["index"].get("stale_after").is_none());
let back: RepositoryObservations = serde_json::from_value(json).unwrap();
assert_eq!(back, now);Fields§
§index: AnswerObservationWhen the index was built: the objects, the kinds, the diagnostics.
git: AnswerObservationWhen git was asked: the branch, the head, the working tree.
Trait Implementations§
Source§impl Clone for RepositoryObservations
impl Clone for RepositoryObservations
Source§fn clone(&self) -> RepositoryObservations
fn clone(&self) -> RepositoryObservations
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RepositoryObservations
impl Debug for RepositoryObservations
Source§impl Default for RepositoryObservations
impl Default for RepositoryObservations
Source§fn default() -> RepositoryObservations
fn default() -> RepositoryObservations
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RepositoryObservations
impl<'de> Deserialize<'de> for RepositoryObservations
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 RepositoryObservations
Source§impl JsonSchema for RepositoryObservations
impl JsonSchema for RepositoryObservations
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for RepositoryObservations
impl PartialEq for RepositoryObservations
Source§fn eq(&self, other: &RepositoryObservations) -> bool
fn eq(&self, other: &RepositoryObservations) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for RepositoryObservations
impl Serialize for RepositoryObservations
impl StructuralPartialEq for RepositoryObservations
Auto Trait Implementations§
impl Freeze for RepositoryObservations
impl RefUnwindSafe for RepositoryObservations
impl Send for RepositoryObservations
impl Sync for RepositoryObservations
impl Unpin for RepositoryObservations
impl UnsafeUnpin for RepositoryObservations
impl UnwindSafe for RepositoryObservations
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.