Skip to main content

Node

Struct Node 

Source
pub struct Node {
    pub kind: KindT,
    pub params: Option<NodeParams>,
    pub children: Option<Vec<Node>>,
}
Expand description

Node

This is the core data structure for generating MSVJ files. Each node type can have a type, params, and children.

Methods derived from the Python API found here

Fields§

§kind: KindT§params: Option<NodeParams>§children: Option<Vec<Node>>

Implementations§

Source§

impl Node

Source

pub fn new(kind: KindT, params: Option<NodeParams>) -> Node

Source

pub fn add_child(&mut self, node: Node)

Source

pub fn get_kind(&self) -> &KindT

Source

pub fn download(&mut self, url: &str) -> Option<&mut Node>

Create the download node

Source

pub fn parse(&mut self, params: ParseParams) -> Option<&mut Node>

Parse a Download Node

Source

pub fn model_structure(&mut self, params: StructureParams) -> Option<&mut Node>

Create a structure for the deposited (asymmetric unit / model) coordinates.

Source

pub fn assembly_structure( &mut self, params: StructureParams, ) -> Option<&mut Node>

Parse a Download Node

Source

pub fn symmetry_structure( &mut self, params: StructureParams, ) -> Option<&mut Node>

Symmetry Structure

Source

pub fn symmetry_mates_structure( &mut self, params: StructureParams, ) -> Option<&mut Node>

Parse a Download Node

Source

pub fn volume(&mut self, params: VolumeParams) -> Option<&mut Node>

Create a Volume node (parallel to a Structure node — loads volumetric data).

Source

pub fn volume_representation( &mut self, params: VolumeRepresentationParams, ) -> Option<&mut Node>

Add an isosurface or grid-slice representation for this volume.

Source

pub fn component(&mut self, selector: ComponentSelector) -> Option<&mut Node>

Create a Component

Source

pub fn component_from_uri( &mut self, params: ComponentFromUriParams, ) -> Option<&mut Node>

Source

pub fn component_from_source( &mut self, params: ComponentFromSourceParams, ) -> Option<&mut Node>

Source

pub fn label_from_uri( &mut self, params: LabelFromUriParams, ) -> Option<&mut Node>

Add labels loaded from an external annotation file.

Source

pub fn label_from_source( &mut self, params: LabelFromSourceParams, ) -> Option<&mut Node>

Add labels read from a category of the structure’s own source file.

Source

pub fn tooltip_from_uri( &mut self, params: TooltipFromUriParams, ) -> Option<&mut Node>

Add tooltips loaded from an external annotation file.

Source

pub fn tooltip_from_source( &mut self, params: TooltipFromSourceParams, ) -> Option<&mut Node>

Add tooltips read from a category of the structure’s own source file.

Source

pub fn transform(&mut self, params: TransformParams) -> Option<&mut Node>

Add a transform to a structure.

Returns None if self is not a structure, or if params.rotation is non-empty and not a 3x3 rotation matrix (see is_rotation_matrix); the Python builder raises ValueError in that case.

Source

pub fn representation( &mut self, representation_type: RepresentationTypeT, ) -> Option<&mut Node>

Add a representation for this component. :param type: the type of representation, defaults to ‘cartoon’ :return: a builder that handles operations at representation level

Source

pub fn representation_with_theme( &mut self, representation_type: RepresentationTypeT, color_theme: Option<ColorThemeT>, ) -> Option<&mut Node>

Source

pub fn label(&mut self, label: String) -> Option<&mut Node>

Source

pub fn tooltip(&mut self, text: String) -> Option<&mut Node>

Source

pub fn focus( &mut self, direction: Option<(f64, f64, f64)>, up: Option<(f64, f64, f64)>, ) -> Option<&mut Node>

Source

pub fn color_from_source( &mut self, params: ColorFromSourceParams, ) -> Option<&mut Node>

Source

pub fn color_from_uri( &mut self, params: ColorFromUriParams, ) -> Option<&mut Node>

Source

pub fn color( &mut self, color: ColorT, selector: ComponentSelector, ) -> Option<&mut Node>

Source

pub fn sphere(&mut self, params: SphereParams) -> Option<&mut Node>

Source

pub fn line(&mut self, params: LineParams) -> Option<&mut Node>

Trait Implementations§

Source§

impl Clone for Node

Source§

fn clone(&self) -> Node

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Node

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Node

Source§

fn default() -> Node

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Node

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Node

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Node

§

impl RefUnwindSafe for Node

§

impl Send for Node

§

impl Sync for Node

§

impl Unpin for Node

§

impl UnsafeUnpin for Node

§

impl UnwindSafe for Node

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.