tinymist_std::typst::foundations

Struct Decimal

pub struct Decimal(/* private fields */);
Expand description

A fixed-point decimal number type.

This type should be used for precise arithmetic operations on numbers represented in base 10. A typical use case is representing currency.

§Example

Decimal: #(decimal("0.1") + decimal("0.2")) \
Float: #(0.1 + 0.2)

§Construction and casts

To create a decimal number, use the {decimal(string)} constructor, such as in {decimal("3.141592653")} (note the double quotes!). This constructor preserves all given fractional digits, provided they are representable as per the limits specified below (otherwise, an error is raised).

You can also convert any integer to a decimal with the {decimal(int)} constructor, e.g. {decimal(59)}. However, note that constructing a decimal from a floating-point number, while supported, is an imprecise conversion and therefore discouraged. A warning will be raised if Typst detects that there was an accidental float to decimal cast through its constructor, e.g. if writing {decimal(3.14)} (note the lack of double quotes, indicating this is an accidental float cast and therefore imprecise). It is recommended to use strings for constant decimal values instead (e.g. {decimal("3.14")}).

The precision of a float to decimal cast can be slightly improved by rounding the result to 15 digits with calc.round, but there are still no precision guarantees for that kind of conversion.

§Operations

Basic arithmetic operations are supported on two decimals and on pairs of decimals and integers.

Built-in operations between float and decimal are not supported in order to guard against accidental loss of precision. They will raise an error instead.

Certain calc functions, such as trigonometric functions and power between two real numbers, are also only supported for float (although raising decimal to integer exponents is supported). You can opt into potentially imprecise operations with the {float(decimal)} constructor, which casts the decimal number into a float, allowing for operations without precision guarantees.

§Displaying decimals

To display a decimal, simply insert the value into the document. To only display a certain number of digits, round the decimal first. Localized formatting of decimals and other numbers is not yet supported, but planned for the future.

You can convert decimals to strings using the str constructor. This way, you can post-process the displayed representation, e.g. to replace the period with a comma (as a stand-in for proper built-in localization to languages that use the comma).

§Precision and limits

A decimal number has a limit of 28 to 29 significant base-10 digits. This includes the sum of digits before and after the decimal point. As such, numbers with more fractional digits have a smaller range. The maximum and minimum decimal numbers have a value of {79228162514264337593543950335} and {-79228162514264337593543950335} respectively. In contrast with [float], this type does not support infinity or NaN, so overflowing or underflowing operations will raise an error.

Typical operations between decimal numbers, such as addition, multiplication, and power to an integer, will be highly precise due to their fixed-point representation. Note, however, that multiplication and division may not preserve all digits in some edge cases: while they are considered precise, digits past the limits specified above are rounded off and lost, so some loss of precision beyond the maximum representable digits is possible. Note that this behavior can be observed not only when dividing, but also when multiplying by numbers between 0 and 1, as both operations can push a number’s fractional digits beyond the limits described above, leading to rounding. When those two operations do not surpass the digit limits, they are fully precise.

Implementations§

§

impl Decimal

pub const ZERO: Decimal

pub const ONE: Decimal

pub const MIN: Decimal

pub const MAX: Decimal

pub const fn is_zero(self) -> bool

Whether this decimal value is zero.

pub const fn is_negative(self) -> bool

Whether this decimal value is negative.

pub fn is_integer(self) -> bool

Whether this decimal has fractional part equal to zero (is an integer).

pub fn abs(self) -> Decimal

Computes the absolute value of this decimal.

pub fn floor(self) -> Decimal

Computes the largest integer less than or equal to this decimal.

A decimal is returned as this may not be within i64’s range of values.

pub fn ceil(self) -> Decimal

Computes the smallest integer greater than or equal to this decimal.

A decimal is returned as this may not be within i64’s range of values.

pub fn trunc(self) -> Decimal

Returns the integer part of this decimal.

pub fn fract(self) -> Decimal

Returns the fractional part of this decimal (with the integer part set to zero).

pub fn round(self, digits: i32) -> Option<Decimal>

Rounds this decimal up to the specified amount of digits with the traditional rounding rules, using the “midpoint away from zero” strategy (6.5 -> 7, -6.5 -> -7).

If given a negative amount of digits, rounds to integer digits instead with the same rounding strategy. For example, rounding to -3 digits will turn 34567.89 into 35000.00 and -34567.89 into -35000.00.

Note that this can return None when using negative digits where the rounded number would overflow the available range for decimals.

pub fn checked_add(self, other: Decimal) -> Option<Decimal>

Attempts to add two decimals.

Returns None on overflow or underflow.

pub fn checked_sub(self, other: Decimal) -> Option<Decimal>

Attempts to subtract a decimal from another.

Returns None on overflow or underflow.

pub fn checked_mul(self, other: Decimal) -> Option<Decimal>

Attempts to multiply two decimals.

Returns None on overflow or underflow.

pub fn checked_div(self, other: Decimal) -> Option<Decimal>

Attempts to divide two decimals.

Returns None if other is zero, as well as on overflow or underflow.

pub fn checked_div_euclid(self, other: Decimal) -> Option<Decimal>

Attempts to obtain the quotient of Euclidean division between two decimals. Implemented similarly to f64::div_euclid.

The returned quotient is truncated and adjusted if the remainder was negative.

Returns None if other is zero, as well as on overflow or underflow.

pub fn checked_rem_euclid(self, other: Decimal) -> Option<Decimal>

Attempts to obtain the remainder of Euclidean division between two decimals. Implemented similarly to f64::rem_euclid.

The returned decimal r is non-negative within the range 0.0 <= r < other.abs().

Returns None if other is zero, as well as on overflow or underflow.

pub fn checked_rem(self, other: Decimal) -> Option<Decimal>

Attempts to calculate the remainder of the division of two decimals.

Returns None if other is zero, as well as on overflow or underflow.

pub fn checked_powi(self, other: i64) -> Option<Decimal>

Attempts to take one decimal to the power of an integer.

Returns None for invalid operands, as well as on overflow or underflow.

§

impl Decimal

pub fn construct( engine: &mut Engine<'_>, value: Spanned<ToDecimal>, ) -> Result<Decimal, EcoVec<SourceDiagnostic>>

Converts a value to a decimal.

It is recommended to use a string to construct the decimal number, or an integer (if desired). The string must contain a number in the format {"3.14159"} (or {"-3.141519"} for negative numbers). The fractional digits are fully preserved; if that’s not possible due to the limit of significant digits (around 28 to 29) having been reached, an error is raised as the given decimal number wouldn’t be representable.

While this constructor can be used with floating-point numbers to cast them to decimal, doing so is discouraged as this cast is inherently imprecise. It is easy to accidentally perform this cast by writing {decimal(1.234)} (note the lack of double quotes), which is why Typst will emit a warning in that case. Please write {decimal("1.234")} instead for that particular case (initialization of a constant decimal). Also note that floats that are NaN or infinite cannot be cast to decimals and will raise an error.

#decimal("1.222222222222222")

Trait Implementations§

§

impl Clone for Decimal

§

fn clone(&self) -> Decimal

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Decimal

§

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

Formats the value using the given formatter. Read more
§

impl Default for Decimal

§

fn default() -> Decimal

Returns the “default value” for a type. Read more
§

impl Display for Decimal

§

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

Formats the value using the given formatter. Read more
§

impl From<i64> for Decimal

§

fn from(value: i64) -> Decimal

Converts to this type from the input type.
§

impl FromStr for Decimal

§

type Err = Error

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<Decimal, <Decimal as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl FromValue for Decimal

§

fn from_value(value: Value) -> Result<Decimal, HintedString>

Try to cast the value into an instance of Self.
§

impl Hash for Decimal

§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl IntoValue for Decimal

§

fn into_value(self) -> Value

Cast this type into a value.
§

impl NativeScope for Decimal

§

fn constructor() -> Option<&'static NativeFuncData>

The constructor function for the type, if any.
§

fn scope() -> Scope

Get the associated scope for the type.
§

impl NativeType for Decimal

§

const NAME: &'static str = "decimal"

The type’s name. Read more
§

fn data() -> &'static NativeTypeData

§

fn ty() -> Type

Get the type for the native Rust type.
§

impl Neg for Decimal

§

type Output = Decimal

The resulting type after applying the - operator.
§

fn neg(self) -> Decimal

Performs the unary - operation. Read more
§

impl Ord for Decimal

§

fn cmp(&self, other: &Decimal) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
§

impl PartialEq for Decimal

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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.
§

impl PartialOrd for Decimal

§

fn partial_cmp(&self, other: &Decimal) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl Reflect for Decimal

§

fn input() -> CastInfo

Describe what can be cast into this value.
§

fn output() -> CastInfo

Describe what this value can be cast into.
§

fn castable(value: &Value) -> bool

Whether the given value can be converted to T. Read more
§

fn error(found: &Value) -> HintedString

Produce an error message for an unacceptable value type. Read more
§

impl Repr for Decimal

§

fn repr(&self) -> EcoString

Return the debug representation of the value.
§

impl TryFrom<f64> for Decimal

§

fn try_from(value: f64) -> Result<Decimal, <Decimal as TryFrom<f64>>::Error>

Attempts to convert a Decimal to a float.

This can fail if the float is infinite or NaN, or otherwise cannot be represented by a decimal number.

§

type Error = ()

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

impl Copy for Decimal

§

impl Eq for Decimal

§

impl StructuralPartialEq for Decimal

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, D: AdaptFrom<S, Swp, Dwp, T>,

Source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<T>,

Convert the source color to the destination color using the specified method.
Source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default.
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<S, T> ArcInto<T> for S
where Arc<S>: Into<T>,

Source§

fn arc_into(self: Arc<S>) -> T

Converts Arc<T> into Self.
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

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

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

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T, C> ArraysFrom<C> for T
where C: IntoArrays<T>,

Source§

fn arrays_from(colors: C) -> T

Cast a collection of colors into a collection of arrays.
Source§

impl<T, C> ArraysInto<C> for T
where C: FromArrays<T>,

Source§

fn arrays_into(self) -> C

Cast this collection of arrays into a collection of colors.
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<T> CallHasher for T
where T: Hash + ?Sized,

§

fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

Source§

impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for U
where T: FromCam16Unclamped<WpParam, U>,

Source§

type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
Source§

fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T, C> ComponentsFrom<C> for T
where C: IntoComponents<T>,

Source§

fn components_from(colors: C) -> T

Cast a collection of colors into a collection of color components.
§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<T> Filterable for T

§

fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>

Creates a filterable data provider with the given name for debugging. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromAngle<T> for T

Source§

fn from_angle(angle: T) -> T

Performs a conversion from angle.
Source§

impl<T, U> FromStimulus<U> for T
where U: IntoStimulus<T>,

Source§

fn from_stimulus(other: U) -> T

Converts other into Self, while performing the appropriate scaling, rounding and clamping.
§

impl<T> FromValue<Spanned<Value>> for T
where T: FromValue,

§

fn from_value(value: Spanned<Value>) -> Result<T, HintedString>

Try to cast the value into an instance of Self.
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, U> IntoAngle<U> for T
where U: FromAngle<T>,

Source§

fn into_angle(self) -> U

Performs a conversion into T.
Source§

impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for U
where T: Cam16FromUnclamped<WpParam, U>,

Source§

type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
Source§

fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
Source§

impl<T, U> IntoColor<U> for T
where U: FromColor<T>,

Source§

fn into_color(self) -> U

Convert into T with values clamped to the color defined bounds Read more
Source§

impl<T, U> IntoColorUnclamped<U> for T
where U: FromColorUnclamped<T>,

Source§

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
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> IntoResult for T
where T: IntoValue,

§

fn into_result(self, _: Span) -> Result<Value, EcoVec<SourceDiagnostic>>

Cast this type into a value.
Source§

impl<T> IntoStimulus<T> for T

Source§

fn into_stimulus(self) -> T

Converts self into T, while performing the appropriate scaling, rounding and clamping.
§

impl<T> LayoutRaw for T

§

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

Gets the layout of the type.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
§

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

§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, C> TryComponentsInto<C> for T
where C: TryFromComponents<T>,

Source§

type Error = <C as TryFromComponents<T>>::Error

The error for when try_into_colors fails to cast.
Source§

fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>

Try to cast this collection of color components into a collection of colors. 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.
Source§

impl<T, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

Source§

fn try_into_color(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
Source§

impl<C, U> UintsFrom<C> for U
where C: IntoUints<U>,

Source§

fn uints_from(colors: C) -> U

Cast a collection of colors into a collection of unsigned integers.
Source§

impl<C, U> UintsInto<C> for U
where C: FromUints<U>,

Source§

fn uints_into(self) -> C

Cast this collection of unsigned integers into a collection of colors.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T
where T: Send + Sync,