pub struct AtomView<'a, T: ModelInfo> { /* private fields */ }

Implementations§

Examples found in repository?
src/atom/mod.rs (line 64)
60
61
62
63
64
65
66
67
68
69
    fn from(src: AtomView<'a, T>) -> Self {
        Self {
            element_symbol: src.element_symbol().into(),
            atomic_number: *src.atomic_number(),
            xyz: src.xyz().to_owned(),
            fractional_xyz: src.fractional_xyz().copied(),
            atom_id: *src.atom_id(),
            format_type: T::default(),
        }
    }
More examples
Hide additional examples
src/lattice/mod.rs (line 56)
54
55
56
57
58
59
60
61
62
    pub fn get_vector_ab(&self, a_id: u32, b_id: u32) -> Result<Vector3<f64>, InvalidIndex> {
        if a_id != b_id {
            let atom_a_xyz = self.view_atom_by_id(a_id)?.xyz().to_owned();
            let atom_b_xyz = self.view_atom_by_id(b_id)?.xyz().to_owned();
            Ok(atom_b_xyz - atom_a_xyz)
        } else {
            Err(InvalidIndex)
        }
    }
src/model_type/msi.rs (line 175)
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(
            f,
            r#"  ({item_id} Atom
    (A C ACL "{elm_id} {elm}")
    (A C Label "{elm}")
    (A D XYZ ({x:.12} {y:.12} {z:.12}))
    (A I Id {atom_id})
  )
"#,
            item_id = self.atom_id() + 1,
            elm_id = self.atomic_number(),
            elm = self.element_symbol(),
            x = self.xyz().x,
            y = self.xyz().y,
            z = self.xyz().z,
            atom_id = self.atom_id(),
        )
    }
Examples found in repository?
src/atom/mod.rs (line 62)
60
61
62
63
64
65
66
67
68
69
    fn from(src: AtomView<'a, T>) -> Self {
        Self {
            element_symbol: src.element_symbol().into(),
            atomic_number: *src.atomic_number(),
            xyz: src.xyz().to_owned(),
            fractional_xyz: src.fractional_xyz().copied(),
            atom_id: *src.atom_id(),
            format_type: T::default(),
        }
    }
More examples
Hide additional examples
src/model_type/msi.rs (line 174)
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(
            f,
            r#"  ({item_id} Atom
    (A C ACL "{elm_id} {elm}")
    (A C Label "{elm}")
    (A D XYZ ({x:.12} {y:.12} {z:.12}))
    (A I Id {atom_id})
  )
"#,
            item_id = self.atom_id() + 1,
            elm_id = self.atomic_number(),
            elm = self.element_symbol(),
            x = self.xyz().x,
            y = self.xyz().y,
            z = self.xyz().z,
            atom_id = self.atom_id(),
        )
    }
Examples found in repository?
src/atom/mod.rs (line 63)
60
61
62
63
64
65
66
67
68
69
    fn from(src: AtomView<'a, T>) -> Self {
        Self {
            element_symbol: src.element_symbol().into(),
            atomic_number: *src.atomic_number(),
            xyz: src.xyz().to_owned(),
            fractional_xyz: src.fractional_xyz().copied(),
            atom_id: *src.atom_id(),
            format_type: T::default(),
        }
    }
More examples
Hide additional examples
src/model_type/msi.rs (line 173)
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(
            f,
            r#"  ({item_id} Atom
    (A C ACL "{elm_id} {elm}")
    (A C Label "{elm}")
    (A D XYZ ({x:.12} {y:.12} {z:.12}))
    (A I Id {atom_id})
  )
"#,
            item_id = self.atom_id() + 1,
            elm_id = self.atomic_number(),
            elm = self.element_symbol(),
            x = self.xyz().x,
            y = self.xyz().y,
            z = self.xyz().z,
            atom_id = self.atom_id(),
        )
    }
Examples found in repository?
src/atom/mod.rs (line 65)
60
61
62
63
64
65
66
67
68
69
    fn from(src: AtomView<'a, T>) -> Self {
        Self {
            element_symbol: src.element_symbol().into(),
            atomic_number: *src.atomic_number(),
            xyz: src.xyz().to_owned(),
            fractional_xyz: src.fractional_xyz().copied(),
            atom_id: *src.atom_id(),
            format_type: T::default(),
        }
    }
Examples found in repository?
src/atom/mod.rs (line 66)
60
61
62
63
64
65
66
67
68
69
    fn from(src: AtomView<'a, T>) -> Self {
        Self {
            element_symbol: src.element_symbol().into(),
            atomic_number: *src.atomic_number(),
            xyz: src.xyz().to_owned(),
            fractional_xyz: src.fractional_xyz().copied(),
            atom_id: *src.atom_id(),
            format_type: T::default(),
        }
    }
More examples
Hide additional examples
src/model_type/msi.rs (line 172)
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(
            f,
            r#"  ({item_id} Atom
    (A C ACL "{elm_id} {elm}")
    (A C Label "{elm}")
    (A D XYZ ({x:.12} {y:.12} {z:.12}))
    (A I Id {atom_id})
  )
"#,
            item_id = self.atom_id() + 1,
            elm_id = self.atomic_number(),
            elm = self.element_symbol(),
            x = self.xyz().x,
            y = self.xyz().y,
            z = self.xyz().z,
            atom_id = self.atom_id(),
        )
    }

Trait Implementations§

Formats the value using the given formatter. Read more
Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Checks if self is actually part of its subset T (and can be converted to it).
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
The inclusion map: converts self to the equivalent element of its superset.
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.