Solid

Struct Solid 

Source
pub struct Solid {
    pub length: f32,
    pub width: f32,
    pub height: f32,
}

Fields§

§length: f32

length of Solid

§width: f32

width of Solid

§height: f32

height of Solid

Implementations§

Source§

impl Solid

Source

pub fn new(length: f32, width: f32, height: f32) -> Solid

create new solid instance

§Examples

Basic usage:

use formula_3d_shape_lib::solid::Solid;
use formula_3d_shape_lib::common_formula::Formula;
let solid1 = Solid::new(4.0, 10.0,3.0);
Source§

impl Solid

Source

pub fn summary(&self)

this function gives summary of solid

§Examples

Basic usage:

use formula_3d_shape_lib::solid::Solid;
use formula_3d_shape_lib::common_formula::Formula;
let solid1 = Solid::new(4.0, 10.0,3.0);
solid1.summary();

Trait Implementations§

Source§

impl Debug for Solid

Source§

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

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

impl Formula for Solid

Source§

fn get_volume(&self) -> f32

this function return volume

§Examples

Basic usage:

use formula_3d_shape_lib::solid::Solid;
use formula_3d_shape_lib::common_formula::Formula;
let solid1 = Solid::new(4.0, 10.0,3.0);
solid1.get_volume();
Source§

fn get_surface_area(&self) -> f32

This function return surface area

§Examples

Basic usage:

use formula_3d_shape_lib::solid::Solid;
use formula_3d_shape_lib::common_formula::Formula;
let solid1 = Solid::new(4.0, 10.0,3.0);
solid1.get_surface_area();

Auto Trait Implementations§

§

impl Freeze for Solid

§

impl RefUnwindSafe for Solid

§

impl Send for Solid

§

impl Sync for Solid

§

impl Unpin for Solid

§

impl UnwindSafe for Solid

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> 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, 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.