pub struct Constructors {
pub record: fn(&str, &[(String, String)]) -> String,
pub variant: fn(&str, &str, Option<&str>) -> String,
pub plain: fn(&Value) -> String,
pub tuple: fn(&[String]) -> String,
pub typed: Option<fn(&CheckedWorkspace, &Value, &Type) -> String>,
}Expand description
How one language writes the parts a value is made of.
Only the pieces that differ. What a float or a string looks like is already each backend’s untyped literal writer; what differs once a type is known is how a struct is built and how a variant is named.
Fields§
§record: fn(&str, &[(String, String)]) -> StringBuilds a named struct from name and its field = value parts.
variant: fn(&str, &str, Option<&str>) -> StringBuilds one alternative of a named enum.
plain: fn(&Value) -> StringWrites a value with no type to guide it.
tuple: fn(&[String]) -> StringBrackets parts that are already written as this language’s tuple.
typed: Option<fn(&CheckedWorkspace, &Value, &Type) -> String>Writes a whole value against its type, for a language where the shared walk below is not enough: one that names a field after the type that declares it, or has to say that a value is present before it is allowed where one that may be absent is wanted.
Auto Trait Implementations§
impl Forget for Constructors
impl Freeze for Constructors
impl Move for Constructors
impl RefUnwindSafe for Constructors
impl Send for Constructors
impl Sync for Constructors
impl Unpin for Constructors
impl UnsafeUnpin for Constructors
impl UnwindSafe for Constructors
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
Mutably borrows from an owned value. Read more