Trait runtime_fmt::FormatArgs [] [src]

pub trait FormatArgs {
    fn validate_name(name: &str) -> Option<usize>;
fn validate_index(index: usize) -> bool;
fn get_child<F: FormatTrait + ?Sized>(
        index: usize
    ) -> Option<fn(_: &Self, _: &mut Formatter) -> Result>;
fn as_usize(index: usize) -> Option<fn(_: &Self) -> &usize>; }

A trait for types against which formatting specifiers may be pre-checked.

Implementations may be generated automatically using runtime-fmt-derive and #[derive(FormatArgs)].

Required Methods

Find the index within this type corresponding to the provided name.

If this function returns Some, get_child with the returned index must not panic.

Validate that a given index is within range for this type.

If this function returns true, get_child with the given index must not panic.

Return the formatter function for the given format trait, accepting &Self and using the given format trait on the value at that index.

Returns None if the given format trait cannot format the child at that index. Panics if the index is invalid.

Return the value at the given index interpreted as a usize.

Returns None if the child at the given index cannot be interpreted as a usize. Panics if the index is invalid.

Implementors