pub trait ItemArgument {
// Required method
fn write_arg_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>;
}Expand description
Types that can be added as argument(s) to item keyword lines
Implemented for strings, and various other types.
This is a separate trait so we can control the formatting of (eg) Iso8601TimeSp,
without having a method on ItemEncoder for each argument type.
Required Methods§
Sourcefn write_arg_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>
fn write_arg_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>
Format as a string suitable for including as a netdoc keyword line argument
The implementation is responsible for checking that the syntax is legal.
For example, if self is a string, it must check that the string is
in legal as a single argument.
Some netdoc values (eg times) turn into several arguments; in that case,
one ItemArgument may format into multiple arguments, and this method
is responsible for writing them all, with the necessary spaces.