Skip to main content

SyncPathManager

Trait SyncPathManager 

Source
pub trait SyncPathManager {
    // Required methods
    fn register_path(
        &self,
        src: IsdAsn,
        dst: IsdAsn,
        now: DateTime<Utc>,
        path: Path<Bytes>,
    );
    fn try_cached_path(
        &self,
        src: IsdAsn,
        dst: IsdAsn,
        now: DateTime<Utc>,
    ) -> Result<Option<Path<Bytes>>>;
}
Expand description

Trait for active path management with sync interface. Implementors of this trait should be able to be used in sync and async context. The functions must not block.

Required Methods§

Source

fn register_path( &self, src: IsdAsn, dst: IsdAsn, now: DateTime<Utc>, path: Path<Bytes>, )

Add a path to the path cache. This can be used to register reverse paths.

Source

fn try_cached_path( &self, src: IsdAsn, dst: IsdAsn, now: DateTime<Utc>, ) -> Result<Option<Path<Bytes>>>

Returns a path to the destination from the path cache. If the path is not in the cache, it returns Ok(None), possibly causing the path to be fetched in the background. If the cache is locked an io error WouldBlock is returned.

Implementors§