Skip to main content

MagneticFluxDensity

Struct MagneticFluxDensity 

Source
pub struct MagneticFluxDensity(/* private fields */);
Expand description

A magnetic flux density quantity, stored internally in tesla (T).

§Construction

let b = MagneticFluxDensity::from_gauss(0.5);

§Typed arithmetic

Implementations§

Source§

impl MagneticFluxDensity

Source

pub const fn from_t(val: f64) -> Self

Create from tesla (canonical unit).

Source

pub const fn from_mt(val: f64) -> Self

Create from millitesla. 1 mT = 1e-3 T.

Source

pub const fn from_ut(val: f64) -> Self

Create from microtesla. 1 uT = 1e-6 T.

Source

pub const fn from_nt(val: f64) -> Self

Create from nanotesla. 1 nT = 1e-9 T.

Source

pub const fn from_gauss(val: f64) -> Self

Create from gauss. 1 G = 1e-4 T.

Source

pub const fn in_t(self) -> f64

Get value in tesla.

Source

pub const fn in_mt(self) -> f64

Get value in millitesla.

Source

pub const fn in_ut(self) -> f64

Get value in microtesla.

Source

pub const fn in_nt(self) -> f64

Get value in nanotesla.

Source

pub const fn in_gauss(self) -> f64

Get value in gauss.

Source

pub fn in_unit(self, unit: MagneticFluxDensityUnit) -> f64

Get value in the specified MagneticFluxDensityUnit.

Source

pub fn display_as(self, unit: MagneticFluxDensityUnit) -> DisplayWithUnit

Return a display wrapper that formats this flux density in the given unit.

Source

pub fn abs(self) -> Self

Return the absolute value of this magnetic flux density.

Trait Implementations§

Source§

impl Add for MagneticFluxDensity

Source§

type Output = MagneticFluxDensity

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self

Performs the + operation. Read more
Source§

impl AddAssign for MagneticFluxDensity

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl Clone for MagneticFluxDensity

Source§

fn clone(&self) -> MagneticFluxDensity

Returns a duplicate 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 MagneticFluxDensity

Source§

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

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

impl Default for MagneticFluxDensity

Source§

fn default() -> MagneticFluxDensity

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

impl Display for MagneticFluxDensity

Source§

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

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

impl Div<f64> for MagneticFluxDensity

Source§

type Output = MagneticFluxDensity

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> Self

Performs the / operation. Read more
Source§

impl Div for MagneticFluxDensity

Source§

type Output = f64

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> f64

Performs the / operation. Read more
Source§

impl DivAssign<f64> for MagneticFluxDensity

Source§

fn div_assign(&mut self, rhs: f64)

Performs the /= operation. Read more
Source§

impl Mul<Area> for MagneticFluxDensity

Source§

type Output = MagneticFlux

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Area) -> MagneticFlux

Performs the * operation. Read more
Source§

impl Mul<MagneticFluxDensity> for Area

Source§

type Output = MagneticFlux

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: MagneticFluxDensity) -> MagneticFlux

Performs the * operation. Read more
Source§

impl Mul<MagneticFluxDensity> for f64

Source§

type Output = MagneticFluxDensity

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: MagneticFluxDensity) -> MagneticFluxDensity

Performs the * operation. Read more
Source§

impl Mul<f64> for MagneticFluxDensity

Source§

type Output = MagneticFluxDensity

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> Self

Performs the * operation. Read more
Source§

impl MulAssign<f64> for MagneticFluxDensity

Source§

fn mul_assign(&mut self, rhs: f64)

Performs the *= operation. Read more
Source§

impl Neg for MagneticFluxDensity

Source§

type Output = MagneticFluxDensity

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self

Performs the unary - operation. Read more
Source§

impl PartialEq for MagneticFluxDensity

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for MagneticFluxDensity

Source§

fn partial_cmp(&self, other: &MagneticFluxDensity) -> 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

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

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

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Sub for MagneticFluxDensity

Source§

type Output = MagneticFluxDensity

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more
Source§

impl SubAssign for MagneticFluxDensity

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl Sum for MagneticFluxDensity

Source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl Copy for MagneticFluxDensity

Source§

impl StructuralPartialEq for MagneticFluxDensity

Auto Trait Implementations§

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.