Skip to main content

Fitting

Struct Fitting 

Source
pub struct Fitting { /* private fields */ }
Expand description

A part fitted to the last body tube: a coupler, a centering ring, a bulkhead, a launch lug, or a packed parachute or streamer. It sits flush with the tube’s aft end unless placed elsewhere with Fitting::at.

A coupler, a ring or a bulkhead goes inside the tube; a launch lug on its outside. A parachute or a streamer from a catalog is its mass, packed into a point; its drag is a recovery device (super::Rocket::add_parachute).

Implementations§

Source§

impl Fitting

Source

pub fn coupler( length_m: f64, outer_diameter_m: f64, wall_m: f64, material: Material, ) -> Self

A tube inside the body tube, length_m long, outer_diameter_m across, with a wall wall_m thick: a coupler joining two tubes, or an engine block.

Source

pub fn centering_ring( length_m: f64, outer_diameter_m: f64, inner_diameter_m: f64, material: Material, ) -> Self

A centering ring length_m thick, outer_diameter_m across with a hole inner_diameter_m across.

Source

pub fn bulkhead(length_m: f64, diameter_m: f64, material: Material) -> Self

A bulkhead: a solid disc length_m thick and diameter_m across.

Source

pub fn launch_lug( length_m: f64, outer_diameter_m: f64, wall_m: f64, material: Material, ) -> Self

A launch lug on the outside of the tube, length_m long, outer_diameter_m across, with a wall wall_m thick.

Source

pub fn from_catalog(part: &Part) -> Result<Self, Error>

The catalog part part, a tube coupler, engine block, centering ring, bulkhead, launch lug, parachute or streamer, as the module says, named by its maker and number. An engine block is a coupler; a parachute’s or streamer’s packing is a point.

§Errors

Error::Catalog: CatalogProblem::Kind for a part of another kind, CatalogProblem::UndefinedMaterial for one whose material its file doesn’t define, CatalogProblem::NoVolume for one that states a mass but has no volume to hold it; Error::Domain for a stated mass that is negative or not finite; and Error::Design for one that states a mass but whose sizes can’t be weighed, such as a bore no narrower than its outside (a part that states no mass is refused for that when it is added).

Source

pub fn at(self, position: Position) -> Self

The same fitting at position along the body tube it is on.

Source

pub fn named(self, name: &str) -> Self

The same fitting with name, which the design file keeps.

Trait Implementations§

Source§

impl Clone for Fitting

Source§

fn clone(&self) -> Fitting

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 Debug for Fitting

Source§

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

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

impl<'de> Deserialize<'de> for Fitting

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 for Fitting

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 Serialize for Fitting

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 Fitting

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

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
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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, 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.