Skip to main content

sword_error

Macro sword_error 

Source
macro_rules! sword_error {
    (
        title: $title:expr,
        reason: $reason:expr,
        $(source: $source:expr,)?
        fields: { $($field:ident = $value:expr),* $(,)? },
        hints: [$hint:expr $(,)?],
        fatal: false
        $(,)?
    ) => { ... };
    (
        title: $title:expr,
        reason: $reason:expr,
        $(source: $source:expr,)?
        fields: { $($field:ident = $value:expr),* $(,)? },
        hints: [$hint:expr $(,)?]
        $(, fatal: true)?
        $(,)?
    ) => { ... };
    (
        title: $title:expr,
        reason: $reason:expr
        $(, source: $source:expr)?
        $(, context: { $($context_key:expr => $context_value:expr),* $(,)? })?
        $(, extra_context: $extra_context:expr)?
        $(, hints: [ $($hint:expr),* $(,)? ])?
        , fatal: false
        $(,)?
    ) => { ... };
    (
        title: $title:expr,
        reason: $reason:expr
        $(, source: $source:expr)?
        $(, context: { $($context_key:expr => $context_value:expr),* $(,)? })?
        $(, extra_context: $extra_context:expr)?
        $(, hints: [ $($hint:expr),* $(,)? ])?
        $(, fatal: true)?
        $(,)?
    ) => { ... };
}