pub struct ProtocolLibrary { /* private fields */ }Expand description
Protocol library containing all available protocol definitions
Implementations§
Source§impl ProtocolLibrary
impl ProtocolLibrary
Sourcepub fn load(protocol_dir: &Path) -> Result<Self, NooshdarooError>
pub fn load(protocol_dir: &Path) -> Result<Self, NooshdarooError>
Load protocol library from directory
Sourcepub fn get(&self, id: &ProtocolId) -> Option<&ProtocolMeta>
pub fn get(&self, id: &ProtocolId) -> Option<&ProtocolMeta>
Get protocol by ID
Sourcepub fn all(&self) -> Vec<&ProtocolMeta>
pub fn all(&self) -> Vec<&ProtocolMeta>
Get all protocols
Sourcepub fn iter(&self) -> impl Iterator<Item = (&ProtocolId, &ProtocolMeta)>
pub fn iter(&self) -> impl Iterator<Item = (&ProtocolId, &ProtocolMeta)>
Iterate over all protocols (id, meta)
Sourcepub fn by_category(&self, category: &str) -> Vec<&ProtocolMeta>
pub fn by_category(&self, category: &str) -> Vec<&ProtocolMeta>
Get protocols by category
Sourcepub fn evasion_candidates(&self, min_score: f64) -> Vec<&ProtocolMeta>
pub fn evasion_candidates(&self, min_score: f64) -> Vec<&ProtocolMeta>
Get protocols suitable for evasion (sorted by score)
Sourcepub fn add(&mut self, protocol: ProtocolMeta)
pub fn add(&mut self, protocol: ProtocolMeta)
Add protocol to library
Auto Trait Implementations§
impl Freeze for ProtocolLibrary
impl RefUnwindSafe for ProtocolLibrary
impl Send for ProtocolLibrary
impl Sync for ProtocolLibrary
impl Unpin for ProtocolLibrary
impl UnwindSafe for ProtocolLibrary
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more