Skip to main content

IgnoredDefault

Enum IgnoredDefault 

Source
pub enum IgnoredDefault {
    Const(Value),
    CopyField {
        name: String,
        index: usize,
    },
    Native(Closure),
}
Expand description

The default of an ignored field — how the field is refilled wherever a value is materialized without it (design §3.7).

Const and CopyField are the serializable vocabulary of the descriptor JSON (fixtures are data, not code — impl plan §4 step 6); Native is an arbitrary thunk supplied by the embedder, which is what a Soil-level default expression eventually compiles to and is not serializable.

Variants§

§

Const(Value)

A constant of the field’s own (scalar) shape.

§

CopyField

Copy another (non-ignored, same-shaped) field’s value.

Fields

§name: String
§index: usize

Index into the thunk-argument list — the record’s non-ignored fields in declaration order (micro-pin §8.6). Resolved at registration.

§

Native(Closure)

Implementations§

Source§

impl IgnoredDefault

Source

pub fn call(&self, args: &[Value]) -> Result<Value, SoilError>

args are the record’s non-ignored field values in declaration order (micro-pin §8.6).

Trait Implementations§

Source§

impl Debug for IgnoredDefault

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

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<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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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