pub struct RadixTarget { /* private fields */ }Implementations§
Source§impl RadixTarget
impl RadixTarget
pub fn new(hosts: &[&str], scope_mode: ScopeMode) -> Result<Self, String>
Sourcepub fn insert(&mut self, value: &str) -> Result<Option<String>, String>
pub fn insert(&mut self, value: &str) -> Result<Option<String>, String>
Insert a target (IP network, IP address, or DNS name). Returns the canonicalized value.
pub fn len(&self) -> usize
pub fn strict_scope(&self) -> bool
pub fn is_empty(&self) -> bool
pub fn contains(&self, value: &str) -> bool
pub fn contains_target(&self, other: &Self) -> bool
Sourcepub fn delete(&mut self, value: &str) -> bool
pub fn delete(&mut self, value: &str) -> bool
Delete a target (IP network, IP address, or DNS name). Returns true if deleted.
Sourcepub fn get(&self, value: &str) -> Option<String>
pub fn get(&self, value: &str) -> Option<String>
Get the most specific match for a target (IP network, IP address, or DNS name). Returns the canonical value if found.
pub fn prune(&mut self) -> usize
pub fn defrag(&mut self) -> (HashSet<String>, HashSet<String>)
pub fn hosts(&self) -> HashSet<String>
pub fn hash(&self) -> u64
Trait Implementations§
Source§impl Clone for RadixTarget
impl Clone for RadixTarget
Source§fn clone(&self) -> RadixTarget
fn clone(&self) -> RadixTarget
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RadixTarget
impl Debug for RadixTarget
Source§impl PartialEq for RadixTarget
impl PartialEq for RadixTarget
impl Eq for RadixTarget
Auto Trait Implementations§
impl Freeze for RadixTarget
impl RefUnwindSafe for RadixTarget
impl Send for RadixTarget
impl Sync for RadixTarget
impl Unpin for RadixTarget
impl UnwindSafe for RadixTarget
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)