pub struct RoadmapFile {
pub schema_version: i64,
pub id: String,
pub title: String,
pub tree: Plan,
}Expand description
A roadmap as it appears on disk: id + title + the Roadmap→Phase→Plan→Task
tree. deny_unknown_fields keeps the schema loud, matching plan.rs.
Fields§
§schema_version: i64ROADMAP_FILE_SCHEMA_VERSION at write time; imports refuse a
version newer than they understand rather than mis-reading it.
id: StringThe roadmap’s store id, preserved across export/import so the repo file and every machine’s working copy name the same roadmap.
title: StringHuman title, as shown by /roadmap list.
tree: PlanThe node tree. Serialized under [tree] / [[tree.subtask]].
Implementations§
Source§impl RoadmapFile
impl RoadmapFile
Sourcepub fn new(id: impl Into<String>, title: impl Into<String>, tree: Plan) -> Self
pub fn new(id: impl Into<String>, title: impl Into<String>, tree: Plan) -> Self
Wrap a store roadmap for export, stamping the current schema version.
Sourcepub fn to_toml_string(&self) -> Result<String>
pub fn to_toml_string(&self) -> Result<String>
Serialize to the on-repo TOML text.
§Errors
Returns the toml serialization error (should not occur for a
well-formed tree).
Sourcepub fn from_toml_str(s: &str) -> Result<Self>
pub fn from_toml_str(s: &str) -> Result<Self>
Parse and validate on-repo TOML text. Fail-loud by design: a malformed or future-versioned file is a hard error so an import never writes a garbage tree into the store.
§Errors
On TOML that does not match the schema, a schema_version newer than
this build understands, an id outside the record-id alphabet
(ASCII alphanumeric + -), or a blank title.
Trait Implementations§
Source§impl Clone for RoadmapFile
impl Clone for RoadmapFile
Source§fn clone(&self) -> RoadmapFile
fn clone(&self) -> RoadmapFile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RoadmapFile
impl Debug for RoadmapFile
Source§impl<'de> Deserialize<'de> for RoadmapFile
impl<'de> Deserialize<'de> for RoadmapFile
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>,
impl Eq for RoadmapFile
Source§impl PartialEq for RoadmapFile
impl PartialEq for RoadmapFile
Source§impl Serialize for RoadmapFile
impl Serialize for RoadmapFile
impl StructuralPartialEq for RoadmapFile
Auto Trait Implementations§
impl Freeze for RoadmapFile
impl RefUnwindSafe for RoadmapFile
impl Send for RoadmapFile
impl Sync for RoadmapFile
impl Unpin for RoadmapFile
impl UnsafeUnpin for RoadmapFile
impl UnwindSafe for RoadmapFile
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
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>,
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
key and return true if they are equal.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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more