mirror of
https://github.com/ratspeak/rsReticulum
synced 2026-08-12 18:08:29 -04:00
runtime: simplify resource policy callback type
This commit is contained in:
parent
869322fa80
commit
d24e4e3ce3
1 changed files with 3 additions and 3 deletions
|
|
@ -30,6 +30,8 @@ use crate::link_manager::{
|
|||
const DEFAULT_EVENT_CAPACITY: usize = 128;
|
||||
const COMMAND_CAPACITY: usize = 256;
|
||||
|
||||
type ResourceAcceptCallback = dyn Fn([u8; 16], &ResourceAdvertisement) -> bool + Send + Sync;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct DestinationRuntimeOptions {
|
||||
pub proof_strategy: ProofStrategy,
|
||||
|
|
@ -65,9 +67,7 @@ impl Default for DestinationRuntimeOptions {
|
|||
|
||||
/// Clonable per-advertisement inbound Resource acceptance policy.
|
||||
#[derive(Clone)]
|
||||
pub struct ResourceAcceptPolicy(
|
||||
Arc<dyn Fn([u8; 16], &ResourceAdvertisement) -> bool + Send + Sync>,
|
||||
);
|
||||
pub struct ResourceAcceptPolicy(Arc<ResourceAcceptCallback>);
|
||||
|
||||
impl ResourceAcceptPolicy {
|
||||
pub fn new(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue