pub struct GraphDoc {
pub nodes: Vec<GraphNode>,
pub edges: Vec<EdgeDoc>,
}Fields§
§nodes: Vec<GraphNode>§edges: Vec<EdgeDoc>Implementations§
Source§impl GraphDoc
impl GraphDoc
pub fn is_empty(&self) -> bool
pub fn node(&self, id: &str) -> Option<&GraphNode>
pub fn node_mut(&mut self, id: &str) -> Option<&mut GraphNode>
pub fn contains(&self, id: &str) -> bool
Sourcepub fn path(&self, id: &str) -> Option<Vec<String>>
pub fn path(&self, id: &str) -> Option<Vec<String>>
id’s chain from its source: [source, op…, id]; None when it does not reach one.
Sourcepub fn descendants(&self, id: &str) -> BTreeSet<String>
pub fn descendants(&self, id: &str) -> BTreeSet<String>
Every node downstream of id.
Sourcepub fn fresh_id(&self, base: &str) -> String
pub fn fresh_id(&self, base: &str) -> String
An id not used yet: base itself, else base1, base2, …
Sourcepub fn numbered_id(&self, prefix: &str, taken: impl Fn(&str) -> bool) -> String
pub fn numbered_id(&self, prefix: &str, taken: impl Fn(&str) -> bool) -> String
prefix1, prefix2, … (sources s1, writes w1).
Sourcepub fn connect(&mut self, from: &str, to: &str) -> Result<(), String>
pub fn connect(&mut self, from: &str, to: &str) -> Result<(), String>
Connects from’s output to to’s input (replacing to’s input).
Sourcepub fn disconnect(&mut self, to: &str)
pub fn disconnect(&mut self, to: &str)
Removes to’s input.
Sourcepub fn remove_bridging(&mut self, id: &str)
pub fn remove_bridging(&mut self, id: &str)
Removes a node, its input feeding what it fed.
Sourcepub fn unlink_bridging(&mut self, id: &str)
pub fn unlink_bridging(&mut self, id: &str)
Takes a node out of its chains (its input feeds what it fed); the node stays, unlinked.
Sourcepub fn chain(
&self,
id: &str,
recipes: &Recipes,
) -> Option<(RecordingRef, Vec<OpDoc>)>
pub fn chain( &self, id: &str, recipes: &Recipes, ) -> Option<(RecordingRef, Vec<OpDoc>)>
The recording and ops (enabled or not) of id’s chain; a recipe node gives its ops
(<node>.<op>, its overrides applied).
Sourcepub fn compile(&self, recipes: &Recipes) -> Vec<ViewDoc>
pub fn compile(&self, recipes: &Recipes) -> Vec<ViewDoc>
The views: each view node that reaches a source, in node order.
Sourcepub fn from_views(views: &[ViewDoc]) -> Self
pub fn from_views(views: &[ViewDoc]) -> Self
The graph of a document that has views only (written before the graph, or by hand): one row per view, its source, its ops, the view.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GraphDoc
impl<'de> Deserialize<'de> for GraphDoc
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
Source§impl JsonSchema for GraphDoc
impl JsonSchema for GraphDoc
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 moreimpl StructuralPartialEq for GraphDoc
Auto Trait Implementations§
impl Forget for GraphDoc
impl Freeze for GraphDoc
impl Move for GraphDoc
impl RefUnwindSafe for GraphDoc
impl Send for GraphDoc
impl Sync for GraphDoc
impl Unpin for GraphDoc
impl UnsafeUnpin for GraphDoc
impl UnwindSafe for GraphDoc
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> CloneExpand for Twhere
T: Clone,
impl<T> CloneExpand for Twhere
T: Clone,
fn __expand_clone_method(&self, _: &Scope) -> T
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§impl<T> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
Source§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
Source§type NoneType = T
type NoneType = T
The type of the none-equivalent value that
NoneValue::null_value produces.Source§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().