pub(crate) trait ItemArgument {
// Required method
fn write_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>;
}
Available on crate feature
hs-service
only.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_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>
fn write_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.
Implementations on Foreign Types§
Source§impl ItemArgument for i8
impl ItemArgument for i8
fn write_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>
Source§impl ItemArgument for i16
impl ItemArgument for i16
fn write_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>
Source§impl ItemArgument for i32
impl ItemArgument for i32
fn write_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>
Source§impl ItemArgument for i64
impl ItemArgument for i64
fn write_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>
Source§impl ItemArgument for i128
impl ItemArgument for i128
fn write_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>
Source§impl ItemArgument for isize
impl ItemArgument for isize
fn write_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>
Source§impl ItemArgument for str
impl ItemArgument for str
fn write_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>
Source§impl ItemArgument for u8
impl ItemArgument for u8
fn write_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>
Source§impl ItemArgument for u16
impl ItemArgument for u16
fn write_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>
Source§impl ItemArgument for u32
impl ItemArgument for u32
fn write_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>
Source§impl ItemArgument for u64
impl ItemArgument for u64
fn write_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>
Source§impl ItemArgument for u128
impl ItemArgument for u128
fn write_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>
Source§impl ItemArgument for usize
impl ItemArgument for usize
fn write_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>
Source§impl ItemArgument for String
impl ItemArgument for String
fn write_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>
Source§impl ItemArgument for Effort
Available on crate feature hs-pow-full
only.
impl ItemArgument for Effort
Available on crate feature
hs-pow-full
only.fn write_onto(&self, out: &mut ItemEncoder<'_>) -> Result<(), Bug>
Source§impl ItemArgument for Seed
Available on crate feature hs-pow-full
only.
impl ItemArgument for Seed
Available on crate feature
hs-pow-full
only.