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: boolIf false only coerce already “stringly” types like strings and paths, but
also coerce sets that have a __toString attribute. In Snix, 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: boolIf 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§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<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