Skip to main content

Output

Struct Output 

Source
pub struct Output(/* private fields */);
Expand description

A write destination: an Expr<Path>, folded when literal.

The engine records every destination it writes through, in each Change’s path, so a config’s visit reports an Output as recorded whether or not its field says records.

Implementations§

Source§

impl Output

Source

pub fn path(&self) -> &Expr<Path>

The destination expression.

Source

pub fn constant(&self) -> Option<&Path>

The destination when it is a literal path, resolved at compile time.

Trait Implementations§

Source§

impl ConfigField for Output

Source§

fn visit(&self, v: &mut Visit<'_>)

Visited as recorded, wherever it sits: a destination lands in every Change written through it, so it may not read a secret.

Source§

fn resolve(&self, r: &mut dyn Resolver) -> Result<Option<OwnedDataValue>>

The destination’s dotted text, computed for this call when it is not literal.

Source§

const IS_OUTPUT: bool = true

Whether the field is an output: a destination its call writes to. false unless the type is Output or an Option of one. The derive reads a field typed Output or marked #[output] as an output and asserts that this is true, so a type that merely shares the name is refused at compile time.
Source§

fn compile(raw: &Value, cx: &mut CompileCx<'_>) -> Option<Self>

Compiles raw; None after recording at least one issue.
Source§

fn kind() -> FieldKind

What the field is.
Source§

const NULL_IS_VALUE: bool = false

Whether null is one of the type’s values. When it is not, an explicit null in an Option<Self> field means None.
Source§

fn absent() -> Option<Self>

The value when the key is absent and no default is declared. None makes the field required.
Source§

impl Debug for Output

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.