Skip to main content

CulvertBarrel

Struct CulvertBarrel 

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

Admitted culvert barrel cross-section, with dimensions in metres.

Implementations§

Source§

impl CulvertBarrel

Source

pub fn horizontal_ellipse( span_m: f64, rise_m: f64, side_radius_m: f64, ) -> Result<Self, StructureError>

Admits a four-arc horizontal ellipse of span span_m, rise rise_m and side radius side_radius_m.

The invert and crown arcs share one radius, derived from tangency. Rejects a span at or below the rise and a side radius at or above half the rise. Also rejects as the box constructor does, and when a radius cubed, scaled by 64, overflows F64.

Source

pub fn vertical_ellipse( span_m: f64, rise_m: f64, end_radius_m: f64, ) -> Result<Self, StructureError>

Admits a four-arc vertical ellipse of span span_m, rise rise_m and end radius end_radius_m.

The two side arcs share one radius, derived from tangency. Rejects a rise at or below the span and an end radius at or above half the span. Also rejects as the box constructor does, and when a radius cubed, scaled by 64, overflows F64.

Source

pub fn pipe_arch( span_m: f64, rise_m: f64, corner_radius_m: f64, bottom_radius_m: f64, ) -> Result<Self, StructureError>

Admits a pipe-arch of span span_m, rise rise_m, corner radius corner_radius_m and bottom radius bottom_radius_m.

The top radius is derived from tangency. Rejects a corner radius at or above half the span, a bottom radius at or below half the span, a rise at or below the corner-centre height plus the corner radius, and a rise above the corner centres of more than half the span, which would put the widest point on the top arc. Also rejects as the box constructor does, and when a radius cubed, scaled by 64, overflows F64.

Source

pub fn arch(span_m: f64, rise_m: f64) -> Result<Self, StructureError>

Admits a flat-floor arch of floor chord span_m and rise rise_m.

The arc radius is derived. Rejects a rise above the span or below a quarter of the span. Also rejects as the box constructor does.

Source§

impl CulvertBarrel

Source

pub fn with_floor(self, floor: CulvertFloor) -> Result<Self, StructureError>

The barrel with floor, replacing any floor it had.

Stores the depth D - fl(D - h), which differs from h by at most half an F64 step of D - h. Rejects a nonfinite or negative depth, a depth at or above the rise, which is a closed barrel, and a zero depth on a barrel without a floor. Rejects a nonfinite or nonpositive ratio, a ratio whose rho^(3/2) times the span leaves the F64 range, and an open rise whose 2^-30 fraction is subnormal.

Source

pub fn floor(&self) -> Option<CulvertFloor>

The declared floor, with its admitted depth.

Source

pub fn base(&self) -> CulvertBarrel

The barrel without its floor.

Source

pub fn open_rise_m(&self) -> f64

Rise of the open section above the bed, D - h in metres. D without a floor.

Source§

impl CulvertBarrel

Source

pub fn circular(diameter_m: f64) -> Result<Self, StructureError>

Admits a circular barrel of diameter diameter_m.

Rejects a nonfinite or nonpositive diameter, a diameter whose 2^-30 fraction is subnormal, and a diameter whose cube, scaled by 64, overflows F64.

Source

pub fn rectangular_box(span_m: f64, rise_m: f64) -> Result<Self, StructureError>

Admits a box barrel of span span_m and rise rise_m.

Rejects a nonfinite or nonpositive span or rise, a rise whose 2^-30 fraction is subnormal, and dimensions whose B D, 2 (B + D) or B D^2, scaled by 64, overflow F64.

Source

pub fn shape(&self) -> CulvertBarrelShape

Barrel shape.

Source

pub fn given_radius_m(&self) -> Option<&[f64]>

Radii the caller gave, in metres and constructor order.

A horizontal ellipse gives its side radius, a vertical ellipse its end radius, and a pipe-arch its corner and bottom radius. None for a circle, a box and a flat-floor arch.

Source

pub fn span_m(&self) -> f64

Horizontal width B in metres. A circle reports its diameter.

Source

pub fn rise_m(&self) -> f64

Vertical height D from invert to crown in metres. A circle reports its diameter.

Trait Implementations§

Source§

impl Clone for CulvertBarrel

Source§

fn clone(&self) -> Self

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 CulvertBarrel

Source§

impl Debug for CulvertBarrel

Source§

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

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

impl PartialEq for CulvertBarrel

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CulvertBarrel

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

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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> 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
Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.