pub struct Tube { /* private fields */ }Expand description
A body tube: a length of the airframe.
Implementations§
Source§impl Tube
impl Tube
Sourcepub fn from_catalog(part: &Part) -> Result<Self, Error>
pub fn from_catalog(part: &Part) -> Result<Self, Error>
The catalog body tube part: its length, outer diameter and wall, named by its maker
and number. A catalog tube is often sold longer than it is flown:
Tube::with_length_m cuts it.
§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).
Sourcepub fn with_length_m(self, length_m: f64) -> Self
pub fn with_length_m(self, length_m: f64) -> Self
The same tube cut to length_m. A catalog tube that states its mass keeps the density
that gives it that mass, so a cut weighs its share.
Source§impl Tube
impl Tube
Sourcepub fn new(length_m: f64, wall_m: f64, material: Material) -> Self
pub fn new(length_m: f64, wall_m: f64, material: Material) -> Self
A tube length_m long with a wall wall_m thick. Its outer diameter is the aft diameter
of the body part before it, or the rocket’s if it is the first.
Sourcepub fn with_diameter_m(self, diameter_m: f64) -> Self
pub fn with_diameter_m(self, diameter_m: f64) -> Self
The same tube with outer diameter diameter_m. A diameter other than the aft diameter of
the part before it makes a step in the airframe, which the design’s checks warn of; a
Transition joins two diameters smoothly.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tube
impl<'de> Deserialize<'de> for Tube
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Tube
Auto Trait Implementations§
impl Freeze for Tube
impl RefUnwindSafe for Tube
impl Send for Tube
impl Sync for Tube
impl Unpin for Tube
impl UnsafeUnpin for Tube
impl UnwindSafe for Tube
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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