Struct de_pathing::segmentproj::ParamPair
source · pub(crate) struct ParamPair(f32, f32);Expand description
Parameters of a (sub-)segment of a line segment.
Tuple Fields§
§0: f32§1: f32Implementations§
source§impl ParamPair
impl ParamPair
sourcefn round(parameter: f32, scale: f32) -> f32
fn round(parameter: f32, scale: f32) -> f32
Round parameters very close to 0 or 1 to exact 0 or 1.
§Arguments
-
parameter- parameter to be rounded. -
scale- size of the line segment to take into account for the rounding. The large the scale the less aggressive the rounding.
sourcefn normalized(a: f32, b: f32, scale: f32) -> Option<Self>
fn normalized(a: f32, b: f32, scale: f32) -> Option<Self>
Creates a normalized (sub-)segment parameter pair. The resulting pair is ordered (i.e. ordering of the first two arguments does not matter) and rounded (to avoid precision issues).
None is returned in the case when the resulting interval contains only a single point.
§Arguments
-
a- first projection parameter. A number between 0. and 1. Argumentsaandbmay be swapped. -
b- seea. -
scale- size of the corresponding line segment. It is used for proper parameter rounding.
pub(crate) fn new(a: f32, b: f32) -> Self
sourcepub(crate) fn apply(&self, segment: Segment) -> Segment
pub(crate) fn apply(&self, segment: Segment) -> Segment
Apply the parameters on the parent line segment and return the (sub-)segment.
sourcepub(crate) fn includes_corner_a(&self) -> bool
pub(crate) fn includes_corner_a(&self) -> bool
Returns true if the first parameter coincides with endpoint a of the parent line segment.
sourcepub(crate) fn includes_corner_b(&self) -> bool
pub(crate) fn includes_corner_b(&self) -> bool
Returns true if the first parameter coincides with endpoint b of the parent line segment.
Trait Implementations§
source§impl PartialEq for ParamPair
impl PartialEq for ParamPair
impl Copy for ParamPair
impl StructuralPartialEq for ParamPair
Auto Trait Implementations§
impl Freeze for ParamPair
impl RefUnwindSafe for ParamPair
impl Send for ParamPair
impl Sync for ParamPair
impl Unpin for ParamPair
impl UnwindSafe for ParamPair
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T [ShaderType] for self. When used in [AsBindGroup]
derives, it is safe to assume that all images in self exist.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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.