Struct tvix_eval::CoercionKind
source · pub struct CoercionKind {
pub strong: bool,
pub import_paths: bool,
}
Expand description
Describes what input types are allowed when coercing a Value
to a string
Fields§
§strong: bool
If false only coerce already “stringly” types like strings and paths, but
also coerce sets that have a __toString
attribute. In Tvix, this is
usually called a weak coercion. Equivalent to passing false
as the
coerceMore
argument of EvalState::coerceToString
in C++ Nix.
If true coerce all value types included by a weak coercion, but also
coerce null
, booleans, integers, floats and lists of coercible types.
Consequently, we call this a strong coercion. Equivalent to passing
true
as coerceMore
in C++ Nix.
import_paths: bool
If import_paths
is true
, paths are imported into the store and their
store path is the result of the coercion (equivalent to the
copyToStore
argument of EvalState::coerceToString
in C++ Nix).
Trait Implementations§
source§impl Clone for CoercionKind
impl Clone for CoercionKind
source§fn clone(&self) -> CoercionKind
fn clone(&self) -> CoercionKind
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CoercionKind
impl Debug for CoercionKind
source§impl From<CoercionKind> for u8
impl From<CoercionKind> for u8
source§fn from(k: CoercionKind) -> u8
fn from(k: CoercionKind) -> u8
source§impl From<u8> for CoercionKind
impl From<u8> for CoercionKind
source§impl PartialEq for CoercionKind
impl PartialEq for CoercionKind
impl Copy for CoercionKind
impl Eq for CoercionKind
impl StructuralPartialEq for CoercionKind
Auto Trait Implementations§
impl Freeze for CoercionKind
impl RefUnwindSafe for CoercionKind
impl Send for CoercionKind
impl Sync for CoercionKind
impl Unpin for CoercionKind
impl UnwindSafe for CoercionKind
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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