pub struct SessionDoc {
pub dspk_session: u32,
pub graph: GraphDoc,
pub recipes: Recipes,
pub epochs: Vec<EpochDoc>,
pub placements: Vec<Placement>,
pub event_sets: Vec<EventSetDoc>,
pub views: Vec<ViewDoc>,
pub active_view: Option<String>,
}Expand description
The whole session.
Fields§
§dspk_session: u32Document version; must equal SESSION_VERSION.
graph: GraphDocThe processing graph (the Pipeline canvas).
recipes: RecipesThe recipes the graph uses, by name (copies of library recipes, or made here).
epochs: Vec<EpochDoc>Marked spans of the recordings.
placements: Vec<Placement>Where recordings sit on the session’s time.
event_sets: Vec<EventSetDoc>Event sets drawn over the recordings’ traces.
views: Vec<ViewDoc>Every view, in the order they are listed: compiled from graph (a document with views
and no graph gets one on load).
active_view: Option<String>Id of the view shown (and edited by default).
Implementations§
Source§impl SessionDoc
impl SessionDoc
pub fn from_json(text: &str) -> Result<Self, SessionError>
Sourcepub fn normalize(&mut self)
pub fn normalize(&mut self)
A graph for a document with views only, then the views from the graph. Views still named
the old default way (file · /source/path) take their source’s name.
Sourcepub fn compile(&mut self)
pub fn compile(&mut self)
The views from the graph; the active view stays when it is still one, else the first.
Sourcepub fn normalized(self) -> Self
pub fn normalized(self) -> Self
The document as written by Self::from_json (graph and compiled views).
Sourcepub fn load(path: &Path) -> Result<Self, SessionError>
pub fn load(path: &Path) -> Result<Self, SessionError>
Reads a document (JSON).
Sourcepub fn to_json(&self) -> String
pub fn to_json(&self) -> String
The canonical form: pretty JSON with every default written out.
Sourcepub fn save(&self, path: &Path) -> Result<()>
pub fn save(&self, path: &Path) -> Result<()>
Writes the canonical JSON (through a temporary file, so a reader never sees half of it).
Sourcepub fn json_schema() -> String
pub fn json_schema() -> String
JSON Schema of the document (for agents and editors).
pub fn view(&self, id: &str) -> Option<&ViewDoc>
pub fn view_mut(&mut self, id: &str) -> Option<&mut ViewDoc>
pub fn active(&self) -> Option<&ViewDoc>
Sourcepub fn new_view_id(&self) -> String
pub fn new_view_id(&self) -> String
A view id not used yet (v1, v2, …), by any view or node.
Trait Implementations§
Source§impl Clone for SessionDoc
impl Clone for SessionDoc
Source§impl Debug for SessionDoc
impl Debug for SessionDoc
Source§impl Default for SessionDoc
impl Default for SessionDoc
Source§impl<'de> Deserialize<'de> for SessionDoc
impl<'de> Deserialize<'de> for SessionDoc
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>,
Source§impl JsonSchema for SessionDoc
impl JsonSchema for SessionDoc
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for SessionDoc
impl PartialEq for SessionDoc
Source§impl Serialize for SessionDoc
impl Serialize for SessionDoc
impl StructuralPartialEq for SessionDoc
Auto Trait Implementations§
impl Forget for SessionDoc
impl Freeze for SessionDoc
impl Move for SessionDoc
impl RefUnwindSafe for SessionDoc
impl Send for SessionDoc
impl Sync for SessionDoc
impl Unpin for SessionDoc
impl UnsafeUnpin for SessionDoc
impl UnwindSafe for SessionDoc
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> 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>
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>
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)
&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)
&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>
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>
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)
&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)
&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> ⓘ
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 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
NoneValue::null_value produces.Source§fn null_value() -> T
fn null_value() -> T
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>
ReadEndian::read_from_little_endian().