Struct pdbtbx::UnitCell

source ·
pub struct UnitCell { /* private fields */ }
Expand description

A unit cell of a crystal, containing its dimensions and angles

Implementations§

source§

impl UnitCell

source

pub const fn new( a: f64, b: f64, c: f64, alpha: f64, beta: f64, gamma: f64 ) -> Self

Create a new UnitCell construct.

Arguments
  • a - a-axis dimension
  • b - b-axis dimension
  • c - c-axis dimension
  • alpha - alpha angle in degrees
  • beta - beta angle in degrees
  • gamma - gamma angle in degrees
source

pub const fn a(&self) -> f64

Get the a-axis dimension

source

pub const fn b(&self) -> f64

Get the b-axis dimension

source

pub const fn c(&self) -> f64

Get the c-axis dimension

source

pub fn set_a(&mut self, new_a: f64)

Set the a-axis dimension

Panics

It panics if the new value is not finite

source

pub fn set_b(&mut self, new_b: f64)

Set the b-axis dimension

Panics

It panics if the new value is not finite

source

pub fn set_c(&mut self, new_c: f64)

Set the c-axis dimension

Panics

It panics if the new value is not finite

source

pub const fn alpha(&self) -> f64

Get the alpha angle in degrees

source

pub fn set_alpha(&mut self, new_alpha: f64)

Set the alpha angle in degrees

Panics

It panics if the new value is not finite. It also panics if the alpha value is outside of bounds [0, 360)

source

pub const fn beta(&self) -> f64

Get the beta angle in degrees

source

pub fn set_beta(&mut self, new_beta: f64)

Set the beta angle in degrees

Panics

It panics if the new value is not finite. It also panics if the beta value is outside of bounds [0, 360)

source

pub const fn gamma(&self) -> f64

Get the gamma angle in degrees

source

pub fn set_gamma(&mut self, new_gamma: f64)

Set the gamma angle in degrees

Panics

It panics if the new value is not finite. It also panics if the gamma value is outside of bounds [0, 360)

source

pub const fn size(&self) -> (f64, f64, f64)

Get the dimensions in a tuple (a, b, c)

Trait Implementations§

source§

impl Clone for UnitCell

source§

fn clone(&self) -> UnitCell

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for UnitCell

source§

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

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

impl Default for UnitCell

source§

fn default() -> Self

Default UnitCell with all sizes set to 0.0 and angles to 90.0

source§

impl<'de> Deserialize<'de> for UnitCell

source§

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 PartialEq<UnitCell> for UnitCell

source§

fn eq(&self, other: &UnitCell) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<UnitCell> for UnitCell

source§

fn partial_cmp(&self, other: &UnitCell) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for UnitCell

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
source§

impl StructuralPartialEq for UnitCell

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
source§

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