Writable

Trait Writable 

Source
pub trait Writable<O: Output> {
    // Required method
    async fn write_to(&self, output: &mut O) -> Result<(), O::Error>;
}
Expand description

A type that can be written to an output stream.

This struct is typically implemented by generic structs whenever their fields are also Writable. In this way, writable types depend on each other and re-use common syntax.

Required Methods§

Source

async fn write_to(&self, output: &mut O) -> Result<(), O::Error>

Writes to the output. Returns the output’s error upon failure.

A writable can always be written multiple times. Because of this, the function takes a borrowed reference.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'w, W, O> Writable<O> for &'w W
where W: Writable<O>, O: Output,

Source§

async fn write_to(&self, output: &mut O) -> Result<(), O::Error>

Implementors§

Source§

impl<O> Writable<O> for Modifier
where O: Output,

Source§

impl<O> Writable<O> for AttributeSeparator
where O: Output,

Source§

impl<O> Writable<O> for NoOp
where O: Output,

Source§

impl<O> Writable<O> for Lifetime<'_>
where O: Output,

Source§

impl<O> Writable<O> for ModPub
where O: Output,

Source§

impl<O> Writable<O> for ModUnsafe
where O: Output,

Source§

impl<O> Writable<O> for MustUse
where O: Output,

Source§

impl<O> Writable<O> for NoMangle

Source§

impl<O, Abi> Writable<O> for ModUnsafeExtern<Abi>
where O: Output, Abi: Writable<O>,

Source§

impl<O, Abi, Body> Writable<O> for ExternBlock<Abi, Body>
where O: Output, O::Ctx: ContextProvides<Edition>, Abi: Writable<O>, Body: Writable<O>,

Source§

impl<O, Arg> Writable<O> for Link<Arg>
where O: Output, Arg: Writable<O>,

Source§

impl<O, Args> Writable<O> for AnonTuple<Args>
where O: Output, Args: WritableSeq<O>,

Source§

impl<O, Args, Return> Writable<O> for FunctionPtr<Args, Return>
where O: Output, Args: WritableSeq<O>, Return: Writable<O>,

Source§

impl<O, Assert> Writable<O> for AssertStmt<Assert>
where O: Output, Assert: Writable<O>,

Source§

impl<O, Attr, Value> Writable<O> for WithAttributes<Attr, Value>
where O: Output, Attr: WritableSeq<O>, Value: Writable<O>,

Source§

impl<O, Component> Writable<O> for Array<Component>
where O: Output, Component: Writable<O>,

Source§

impl<O, Cond> Writable<O> for Cfg<Cond>
where O: Output, Cond: Writable<O>,

Source§

impl<O, Cond, Attr> Writable<O> for CfgAttr<Cond, Attr>
where O: Output, Cond: Writable<O>, Attr: Writable<O>,

Source§

impl<O, Content> Writable<O> for RawStringLiteral<Content>
where O: Output, Content: Writable<O>,

Source§

impl<O, Expr> Writable<O> for ConstPtr<Expr>
where O: Output, Expr: Writable<O>,

Source§

impl<O, Expr> Writable<O> for Dereference<Expr>
where O: Output, Expr: Writable<O>,

Source§

impl<O, Expr> Writable<O> for MutPtr<Expr>
where O: Output, Expr: Writable<O>,

Source§

impl<O, Expr> Writable<O> for ParenthesesAround<Expr>
where O: Output, Expr: Writable<O>,

Source§

impl<O, Expr> Writable<O> for RawConstOf<Expr>
where O: Output, Expr: Writable<O>,

Source§

impl<O, Expr> Writable<O> for RawMutOf<Expr>
where O: Output, Expr: Writable<O>,

Source§

impl<O, Expr, Ifaces> Writable<O> for Implements<Expr, Ifaces>
where O: Output, Expr: Writable<O>, Ifaces: WritableSeq<O>,

Source§

impl<O, Expr, Super> Writable<O> for Extends<Expr, Super>
where O: Output, Expr: Writable<O>, Super: Writable<O>,

Source§

impl<O, Fields> Writable<O> for StructFields<Fields>
where O: Output, Fields: WritableSeq<O>,

Source§

impl<O, Init, Predicate, Update, Body> Writable<O> for TraditionalFor<Init, Predicate, Update, Body>
where O: Output, Init: Writable<O>, Predicate: Writable<O>, Update: Writable<O>, Body: Writable<O>,

Source§

impl<O, InputVars, Expr> Writable<O> for Closure<InputVars, Expr>
where O: Output, InputVars: WritableSeq<O>, Expr: Writable<O>,

Source§

impl<O, Lints> Writable<O> for AllowLints<Lints>
where O: Output, Lints: WritableSeq<O>,

Source§

impl<O, Mods, Name, Args, Return, Where, Body> Writable<O> for async_codegen::rust::FunctionDef<Mods, Name, Args, Return, Where, Body>
where O: Output, Mods: WritableSeq<O>, Name: Writable<O>, Args: WritableSeq<O>, Return: Writable<O>, Where: WritableSeq<O>, Body: Writable<O>,

Source§

impl<O, Mods, Name, Body> Writable<O> for ClassDef<Mods, Name, Body>
where O: Output, Mods: WritableSeq<O>, Name: Writable<O>, Body: Writable<O>,

Source§

impl<O, Mods, Name, Body> Writable<O> for InterfaceDef<Mods, Name, Body>
where O: Output, Mods: WritableSeq<O>, Name: Writable<O>, Body: Writable<O>,

Source§

impl<O, Mods, Name, Elements> Writable<O> for StructDef<Mods, Name, Elements>
where O: Output, Mods: WritableSeq<O>, Name: Writable<O>, Elements: WritableSeq<O>,

Source§

impl<O, Mods, Name, Entries> Writable<O> for EnumDef<Mods, Name, Entries>
where O: Output, Mods: WritableSeq<O>, Name: Writable<O>, Entries: WritableSeq<O>,

Source§

impl<O, Mods, Name, FieldType> Writable<O> for DeclareField<Mods, Name, FieldType>
where O: Output, Mods: WritableSeq<O>, Name: Writable<O>, FieldType: Writable<O>,

Source§

impl<O, Mods, Name, TypeVars, SuperTraits, Body> Writable<O> for TraitDef<Mods, Name, TypeVars, SuperTraits, Body>
where O: Output, Mods: WritableSeq<O>, Name: Writable<O>, TypeVars: WritableSeq<O>, SuperTraits: WritableSeq<O>, Body: Writable<O>,

Source§

impl<O, Mods, TypeArgs, Name, Args, Throws, Body> Writable<O> for ConstructorDef<Mods, TypeArgs, Name, Args, Throws, Body>
where O: Output, Mods: WritableSeq<O>, TypeArgs: WritableSeq<O>, Name: Writable<O>, Args: WritableSeq<O>, Throws: WritableSeq<O>, Body: Writable<O>,

Source§

impl<O, Mods, TypeArgs, Return, Name, Args, Throws, Body> Writable<O> for async_codegen::java::FunctionDef<Mods, TypeArgs, Return, Name, Args, Throws, Body>
where O: Output, Mods: WritableSeq<O>, TypeArgs: WritableSeq<O>, Return: Writable<O>, Name: Writable<O>, Args: WritableSeq<O>, Throws: WritableSeq<O>, Body: Writable<O>,

Source§

impl<O, Mods, TypeVars, Recv, Where, Body> Writable<O> for Impl<Mods, TypeVars, Recv, Where, Body>
where O: Output, Mods: WritableSeq<O>, TypeVars: WritableSeq<O>, Recv: Writable<O>, Where: WritableSeq<O>, Body: Writable<O>,

Source§

impl<O, Mods, TypeVars, Trait, Recv, Where, Body> Writable<O> for TraitImpl<Mods, TypeVars, Trait, Recv, Where, Body>
where O: Output, Mods: WritableSeq<O>, TypeVars: WritableSeq<O>, Trait: Writable<O>, Recv: Writable<O>, Where: WritableSeq<O>, Body: Writable<O>,

Source§

impl<O, Msg, Since> Writable<O> for Deprecated<Msg, Since>
where O: Output, Msg: Writable<O>, Since: Writable<O>,

Source§

impl<O, Name> Writable<O> for WithInference<Name>
where O: Output, Name: Writable<O>,

Source§

impl<O, Name, Args> Writable<O> for ConstructorCall<Name, Args>
where O: Output, Name: Writable<O>, Args: WritableSeq<O>,

Source§

impl<O, Name, Args> Writable<O> for async_codegen::java::FunctionCall<Name, Args>
where O: Output, Name: Writable<O>, Args: WritableSeq<O>,

Source§

impl<O, Name, Args> Writable<O> for NamedTuple<Name, Args>
where O: Output, Name: Writable<O>, Args: WritableSeq<O>,

Source§

impl<O, Name, Body> Writable<O> for ModBlock<Name, Body>
where O: Output, Name: Writable<O>, Body: Writable<O>,

Source§

impl<O, Name, Body> Writable<O> for StructCall<Name, Body>
where O: Output, Name: Writable<O>, Body: Writable<O>,

Source§

impl<O, Name, Type> Writable<O> for FunctionParam<Name, Type>
where O: Output, Name: Writable<O>, Type: Writable<O>,

Source§

impl<O, Name, Value> Writable<O> for FillOutField<Name, Value>
where O: Output, Name: Writable<O>, Value: Writable<O>,

Source§

impl<O, Part1, Part2> Writable<O> for AssignExpr<Part1, Part2>
where O: Output, Part1: Writable<O>, Part2: Writable<O>,

Source§

impl<O, Part1, Part2> Writable<O> for async_codegen::java::AssignStmt<Part1, Part2>
where O: Output, Part1: Writable<O>, Part2: Writable<O>,

Source§

impl<O, Part1, Part2> Writable<O> for async_codegen::java::Else<Part1, Part2>
where O: Output, Part1: Writable<O>, Part2: Writable<O>,

Source§

impl<O, Part1, Part2> Writable<O> for async_codegen::java::IfBlock<Part1, Part2>
where O: Output, Part1: Writable<O>, Part2: Writable<O>,

Source§

impl<O, Part1, Part2> Writable<O> for async_codegen::java::MemberAccess<Part1, Part2>
where O: Output, Part1: Writable<O>, Part2: Writable<O>,

Source§

impl<O, Part1, Part2> Writable<O> for async_codegen::java::Parameterized<Part1, Part2>
where O: Output, Part1: Writable<O>, Part2: WritableSeq<O>,

Source§

impl<O, Part1, Part2> Writable<O> for async_codegen::rust::AssignStmt<Part1, Part2>
where O: Output, Part1: Writable<O>, Part2: Writable<O>,

Source§

impl<O, Part1, Part2> Writable<O> for async_codegen::rust::Else<Part1, Part2>
where O: Output, Part1: Writable<O>, Part2: Writable<O>,

Source§

impl<O, Part1, Part2> Writable<O> for async_codegen::rust::IfBlock<Part1, Part2>
where O: Output, Part1: Writable<O>, Part2: Writable<O>,

Source§

impl<O, Part1, Part2> Writable<O> for async_codegen::rust::MemberAccess<Part1, Part2>
where O: Output, Part1: Writable<O>, Part2: Writable<O>,

Source§

impl<O, Part1, Part2> Writable<O> for async_codegen::rust::Parameterized<Part1, Part2>
where O: Output, Part1: Writable<O>, Part2: WritableSeq<O>,

Source§

impl<O, Part> Writable<O> for async_codegen::java::Block<Part>
where O: Output, Part: Writable<O>,

Source§

impl<O, Part> Writable<O> for async_codegen::java::ReturnStmt<Part>
where O: Output, Part: Writable<O>,

Source§

impl<O, Part> Writable<O> for async_codegen::java::Stmt<Part>
where O: Output, Part: Writable<O>,

Source§

impl<O, Part> Writable<O> for async_codegen::rust::Block<Part>
where O: Output, Part: Writable<O>,

Source§

impl<O, Part> Writable<O> for async_codegen::rust::ReturnStmt<Part>
where O: Output, Part: Writable<O>,

Source§

impl<O, Part> Writable<O> for async_codegen::rust::Stmt<Part>
where O: Output, Part: Writable<O>,

Source§

impl<O, Pattern, Expr> Writable<O> for LetExpr<Pattern, Expr>
where O: Output, Pattern: Writable<O>, Expr: Writable<O>,

Source§

impl<O, STR> Writable<O> for Str<STR>
where O: Output, STR: AsRef<str>,

Source§

impl<O, Type1, Type2> Writable<O> for TypeAsType<Type1, Type2>
where O: Output, Type1: Writable<O>, Type2: Writable<O>,

Source§

impl<O, Type> Writable<O> for UseType<Type>
where O: Output, Type: Writable<O>,

Source§

impl<O, Type, Expr> Writable<O> for DeclareVarStmt<Type, Expr>
where O: Output, Type: Writable<O>, Expr: Writable<O>,

Source§

impl<O, Type, Name> Writable<O> for DeclareParam<Type, Name>
where O: Output, Type: Writable<O>, Name: Writable<O>,

Source§

impl<O, TypeVar, Bounds> Writable<O> for BoundedTypeVar<TypeVar, Bounds>
where O: Output, TypeVar: Writable<O>, Bounds: WritableSeq<O>,

Source§

impl<O, Value> Writable<O> for Doc<Value>
where O: Output, Value: Writable<O>,

Source§

impl<O, Value> Writable<O> for Target<Value>
where O: Output, Value: Writable<O>,

Source§

impl<O, VarName, Iter, Body> Writable<O> for EnhancedFor<VarName, Iter, Body>
where O: Output, VarName: Writable<O>, Iter: Writable<O>, Body: Writable<O>,

Source§

impl<O, W1, W2> Writable<O> for Combined<W1, W2>
where O: Output, W1: Writable<O>, W2: Writable<O>,

Source§

impl<O, W> Writable<O> for BoxedIndirection<W>
where O: Output, W: Writable<O>,

Source§

impl<O: Output> Writable<O> for FunctionBodyDeclare

Source§

impl<O: Output, Cont, Item> Writable<O> for AssociatedItem<Cont, Item>
where Cont: Writable<O>, Item: Writable<O>,

Source§

impl<O: Output, Elements> Writable<O> for ArrayFromElements<Elements>
where Elements: WritableSeq<O>,

Source§

impl<O: Output, Expr> Writable<O> for QuestionMarkAfter<Expr>
where Expr: Writable<O>,

Source§

impl<O: Output, Expr> Writable<O> for RefOf<Expr>
where Expr: Writable<O>,

Source§

impl<O: Output, Expr> Writable<O> for UnsafeBlock<Expr>
where Expr: Writable<O>,

Source§

impl<O: Output, Inner> Writable<O> for FunctionBodyImplement<Inner>
where Inner: Writable<O>,

Source§

impl<O: Output, Name, Args> Writable<O> for Turbofish<Name, Args>
where Name: Writable<O>, Args: WritableSeq<O>,

Source§

impl<O: Output, Recv, FuncName, Args> Writable<O> for async_codegen::rust::FunctionCall<Recv, FuncName, Args>
where Recv: Writable<O>, FuncName: Writable<O>, Args: WritableSeq<O>,

Source§

impl<O: Output, Type> Writable<O> for DynOf<Type>
where Type: Writable<O>,

Source§

impl<O: Output, Type> Writable<O> for ImplOf<Type>
where Type: Writable<O>,

Source§

impl<O: Output, Type> Writable<O> for LifetimedRefOf<'_, Type>
where Type: Writable<O>,

Source§

impl<O: Output, Type, Trait> Writable<O> for TypeAsTrait<Type, Trait>
where Type: Writable<O>, Trait: Writable<O>,

Source§

impl<O: Output, Type, Value> Writable<O> for AssociatedTypeEquals<Type, Value>
where Type: Writable<O>, Value: Writable<O>,

Source§

impl<O: Output, VarName, Value> Writable<O> for AssociatedTypeDef<VarName, Value>
where VarName: Writable<O>, Value: Writable<O>,

Source§

impl<O: Output, Variable, Expr> Writable<O> for LetMutStmt<Variable, Expr>
where Variable: Writable<O>, Expr: Writable<O>,

Source§

impl<O: Output, Variable, Expr> Writable<O> for LetStmt<Variable, Expr>
where Variable: Writable<O>, Expr: Writable<O>,