Skip to main content

Meters

Struct Meters 

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

Distance in meters.

Implementations§

Source§

impl Meters

Source

pub const fn new(v: f32) -> Self

Const constructor for use in static/const contexts.

Source

pub fn value(self) -> f32

Source

pub fn to_bigworld(self) -> BigWorldDistance

Source

pub fn to_ship_model(self) -> ShipModelDistance

Convert to ship-model units (1 unit = 15 meters). Use this for distances that will be compared against ship geometry (hull models, armor meshes), which are in ship-model coordinates.

Source

pub fn to_km(self) -> Km

Source

pub fn to_mm(self) -> Millimeters

Source

pub fn to_world(self) -> WorldDistance

Convert to replay world units (1 unit = 15 meters). Use this for distances that will be compared against packet positions.

Trait Implementations§

Source§

impl Add for Meters

Source§

type Output = Meters

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl Add<BigWorldDistance> for Meters

Source§

type Output = Meters

The resulting type after applying the + operator.
Source§

fn add(self, rhs: BigWorldDistance) -> Meters

Performs the + operation. Read more
Source§

impl Add<Km> for Meters

Source§

type Output = Meters

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Km) -> Meters

Performs the + operation. Read more
Source§

impl Add<Meters> for BigWorldDistance

Source§

type Output = BigWorldDistance

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Meters) -> BigWorldDistance

Performs the + operation. Read more
Source§

impl Add<Meters> for Km

Source§

type Output = Km

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Meters) -> Km

Performs the + operation. Read more
Source§

impl Clone for Meters

Source§

fn clone(&self) -> Meters

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 Copy for Meters

Source§

impl Debug for Meters

Source§

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

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

impl Default for Meters

Source§

fn default() -> Meters

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

impl Display for Meters

Conventional English-port rounding: whole meters.

Source§

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

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

impl Div<f32> for Meters

Source§

type Output = Meters

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f32) -> Meters

Performs the / operation. Read more
Source§

impl From<f32> for Meters

Source§

fn from(v: f32) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for Meters

Source§

fn from(v: i32) -> Self

Converts to this type from the input type.
Source§

impl Mul<f32> for Meters

Source§

type Output = Meters

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> Meters

Performs the * operation. Read more
Source§

impl PartialEq for Meters

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialEq<BigWorldDistance> for Meters

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialEq<Meters> for BigWorldDistance

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialOrd for Meters

Source§

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

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 PartialOrd<BigWorldDistance> for Meters

Source§

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

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 PartialOrd<Meters> for BigWorldDistance

Source§

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

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 StructuralPartialEq for Meters

Source§

impl Sub for Meters

Source§

type Output = Meters

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl Sub<BigWorldDistance> for Meters

Source§

type Output = Meters

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: BigWorldDistance) -> Meters

Performs the - operation. Read more
Source§

impl Sub<Km> for Meters

Source§

type Output = Meters

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Km) -> Meters

Performs the - operation. Read more
Source§

impl Sub<Meters> for BigWorldDistance

Source§

type Output = BigWorldDistance

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Meters) -> BigWorldDistance

Performs the - operation. Read more
Source§

impl Sub<Meters> for Km

Source§

type Output = Km

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Meters) -> Km

Performs the - operation. Read more
Source§

impl Sum for Meters

Source§

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

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

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.