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§
Sourcefn policy_error(&self, _tag: String, msg: String) -> Result<(), ValidationError>
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(())
Sourcefn temporary_policy_error(
&self,
_tag: String,
msg: String,
) -> Result<(), ValidationError>
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(())
Sourcefn policy_log(&self, _tag: String, msg: String)
fn policy_log(&self, _tag: String, msg: String)
Log at ERROR or WARN matching the policy error handling
Sourcefn global_velocity_control(&self) -> VelocityControlSpec
fn global_velocity_control(&self) -> VelocityControlSpec
Velocity control to apply to the entire node
Sourcefn fee_velocity_control(&self) -> VelocityControlSpec
fn fee_velocity_control(&self) -> VelocityControlSpec
Velocity control to apply to L1 fees paid by the node
Provided Methods§
Sourcefn max_channels(&self) -> usize
fn max_channels(&self) -> usize
Maximum number of concurrent channels
Sourcefn max_invoices(&self) -> usize
fn max_invoices(&self) -> usize
Maximum number of concurrent invoices (issued and approved)