pub struct State {
pub root: Node,
pub metadata: Metadata,
}Expand description
This is the base MolViewSpec object containing the root node and the metadata
Holds methods that modify the root node.
Fields§
§root: Node§metadata: MetadataImplementations§
Source§impl State
impl State
pub fn new() -> Self
Sourcepub fn from_reader<R: Read>(reader: R) -> Result<State>
pub fn from_reader<R: Read>(reader: R) -> Result<State>
Parse a MVSJ reader into a State.
Sourcepub fn camera(&mut self, params: CameraParams) -> Option<&mut Node>
pub fn camera(&mut self, params: CameraParams) -> Option<&mut Node>
Set Camera Location
Sourcepub fn canvas(&mut self, params: CanvasParams) -> Option<&mut Node>
pub fn canvas(&mut self, params: CanvasParams) -> Option<&mut Node>
Set canvas background color.
pub fn download(&mut self, url: &str) -> Option<&mut Node>
Sourcepub fn generic_visuals(&mut self) -> Option<&mut Node>
pub fn generic_visuals(&mut self) -> Option<&mut Node>
Add a generic_visuals node for custom spheres and lines.
Sourcepub fn into_snapshot(self) -> Snapshot
pub fn into_snapshot(self) -> Snapshot
Consume this State as the sole snapshot of an MvsjFile.
pub fn to_url(&self) -> String
Trait Implementations§
Source§impl<'de> Deserialize<'de> for State
impl<'de> Deserialize<'de> for State
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
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
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