pub struct TyF64 {
pub n: f64,
pub ty: NumericType,
}Fields§
§n: f64§ty: NumericTypeImplementations§
Source§impl TyF64
impl TyF64
pub const fn new(n: f64, ty: NumericType) -> Self
pub fn from_number(n: Number, settings: &MetaSettings) -> Self
Sourcepub fn unwrap_to_mm(&self) -> f64
pub fn unwrap_to_mm(&self) -> f64
Soft-deprecated. Use Self::to_mm() instead. This is legacy, and all
callers should stop using this.
Sourcepub fn to_mm(&self) -> Option<f64>
pub fn to_mm(&self) -> Option<f64>
The original that returns f64 was renamed to Self::unwrap_to_mm().
Sourcepub fn is_length_compatible(&self) -> bool
pub fn is_length_compatible(&self) -> bool
Returns true if this can be used as a length unit (e.g. mm, inches, etc)
Sourcepub fn unwrap_to_length_units(&self, units: UnitLength) -> f64
pub fn unwrap_to_length_units(&self, units: UnitLength) -> f64
Soft-deprecated. Use Self::to_length_units() instead.
This is legacy, and all callers should stop using this.
Sourcepub fn to_length_units(&self, units: UnitLength) -> Option<f64>
pub fn to_length_units(&self, units: UnitLength) -> Option<f64>
The original that returns f64 was renamed to
Self::unwrap_to_length_units().
Sourcepub fn unwrap_to_degrees(
&self,
exec_state: &mut ExecState,
source_range: SourceRange,
) -> f64
pub fn unwrap_to_degrees( &self, exec_state: &mut ExecState, source_range: SourceRange, ) -> f64
Soft-deprecated. Use Self::to_degrees() instead. This is legacy, and
all callers should stop using this.
Sourcepub fn to_degrees(
&self,
exec_state: &mut ExecState,
source_range: SourceRange,
) -> Option<f64>
pub fn to_degrees( &self, exec_state: &mut ExecState, source_range: SourceRange, ) -> Option<f64>
The original that returns f64 was renamed to
Self::unwrap_to_degrees().
Sourcepub fn unwrap_to_radians(
&self,
exec_state: &mut ExecState,
source_range: SourceRange,
) -> f64
pub fn unwrap_to_radians( &self, exec_state: &mut ExecState, source_range: SourceRange, ) -> f64
Soft-deprecated. Use Self::to_radians() instead. This is legacy, and
all callers should stop using this.
Sourcepub fn to_radians(
&self,
exec_state: &mut ExecState,
source_range: SourceRange,
) -> Option<f64>
pub fn to_radians( &self, exec_state: &mut ExecState, source_range: SourceRange, ) -> Option<f64>
The original that returns f64 was renamed to
Self::unwrap_to_radians().
pub fn count(n: f64) -> Self
pub fn map_value(self, n: f64) -> Self
pub fn to_point2d( value: &[TyF64; 2], ) -> Result<Point2d<Number>, NumericSuffixTypeConvertError>
Trait Implementations§
Source§impl<'a> FromKclValue<'a> for TyF64
impl<'a> FromKclValue<'a> for TyF64
Source§fn from_kcl_val(arg: &'a KclValue) -> Option<Self>
fn from_kcl_val(arg: &'a KclValue) -> Option<Self>
impl StructuralPartialEq for TyF64
Source§impl TS for TyF64
impl TS for TyF64
Source§type WithoutGenerics = TyF64
type WithoutGenerics = TyF64
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or (). The only requirement for these dummy types is that
EXPORT_TO must be None. Read moreSource§type OptionInnerType = TyF64
type OptionInnerType = TyF64
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn decl_concrete(cfg: &Config) -> String
fn decl_concrete(cfg: &Config) -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl(cfg: &Config) -> String
fn decl(cfg: &Config) -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline(cfg: &Config) -> String
fn inline(cfg: &Config) -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened(cfg: &Config) -> String
fn inline_flattened(cfg: &Config) -> String
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported, relative to the output directory.
The returned path does not include any base directory. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
Source§fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export_all. Read moreSource§fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export. Read moreSource§fn export_to_string(cfg: &Config) -> Result<String, ExportError>where
Self: 'static,
fn export_to_string(cfg: &Config) -> Result<String, ExportError>where
Self: 'static,
Auto Trait Implementations§
impl Freeze for TyF64
impl RefUnwindSafe for TyF64
impl Send for TyF64
impl Sync for TyF64
impl Unpin for TyF64
impl UnsafeUnpin for TyF64
impl UnwindSafe for TyF64
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T, U> Imply<T> for U
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = !
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.