Trait Policy

Source
pub trait Policy: Send + Sync {
    // Required methods
    fn policy_error(
        &self,
        _tag: String,
        msg: String,
    ) -> Result<(), ValidationError>;
    fn temporary_policy_error(
        &self,
        _tag: String,
        msg: String,
    ) -> Result<(), ValidationError>;
    fn policy_log(&self, _tag: String, msg: String);
    fn global_velocity_control(&self) -> VelocityControlSpec;
    fn fee_velocity_control(&self) -> VelocityControlSpec;

    // Provided methods
    fn max_channels(&self) -> usize { ... }
    fn max_invoices(&self) -> usize { ... }
}
Expand description

An enforcement policy

Required Methods§

Source

fn policy_error(&self, _tag: String, msg: String) -> Result<(), ValidationError>

A policy error has occurred. Policy errors can be converted to warnings by returning Ok(())

Source

fn temporary_policy_error( &self, _tag: String, msg: String, ) -> Result<(), ValidationError>

A temporary policy error has occurred. Policy errors can be converted to warnings by returning Ok(())

Source

fn policy_log(&self, _tag: String, msg: String)

Log at ERROR or WARN matching the policy error handling

Source

fn global_velocity_control(&self) -> VelocityControlSpec

Velocity control to apply to the entire node

Source

fn fee_velocity_control(&self) -> VelocityControlSpec

Velocity control to apply to L1 fees paid by the node

Provided Methods§

Source

fn max_channels(&self) -> usize

Maximum number of concurrent channels

Source

fn max_invoices(&self) -> usize

Maximum number of concurrent invoices (issued and approved)

Implementors§