Struct Complex

#[repr(C)]
pub struct Complex<T> { pub re: T, pub im: T }

A complex number.

Fields

re: T

The real component.

im: T

The imaginary component.

Implementations

impl<T> Complex<T>

fn new(re: T, im: T) -> Complex<T>

Create a new complex number from a real and imaginary component.

Trait Implementations

impl<T: Clone> Clone for Complex<T>

fn clone(&self) -> Complex<T>

impl<T: Copy> Copy for Complex<T>

impl<T: Debug> Debug for Complex<T>

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

impl<T: PartialEq> PartialEq for Complex<T>

fn eq(&self, other: &Complex<T>) -> bool

impl<T: PartialEq> StructuralPartialEq for Complex<T>

Auto Trait Implementations

impl<T> Freeze for Complex<T> where T: Freeze + Freeze,

impl<T> RefUnwindSafe for Complex<T> where T: RefUnwindSafe + RefUnwindSafe,

impl<T> Send for Complex<T> where T: Send + Send,

impl<T> Sync for Complex<T> where T: Sync + Sync,

impl<T> Unpin for Complex<T> where T: Unpin + Unpin,

impl<T> UnsafeUnpin for Complex<T> where T: UnsafeUnpin + UnsafeUnpin,

impl<T> UnwindSafe for Complex<T> where T: UnwindSafe + UnwindSafe,

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

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

impl<T> From<T> for Complex<T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Printable for Complex<T> where T: Copy + Debug,

impl<T> SizeHint for Complex<T> where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for Complex<T>

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

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, U> TryFrom<U> for Complex<T> where U: Into<T>,

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

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

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