pub struct CidrMap<V>where
V: Clone,{ /* private fields */ }
Implementations§
source§impl<V> CidrMap<V>where
V: Clone,
impl<V> CidrMap<V>where
V: Clone,
pub fn new() -> Self
pub fn contains(&self, ip: IpAddr) -> bool
pub fn get_prefix_match(&self, ip: IpAddr) -> Option<&V>
pub fn get_prefix_match_cidr(&self, key: &AnyIpCidr) -> Option<&V>
sourcepub fn insert_uncompressed(&mut self, key: AnyIpCidr, value: V)where
V: Clone,
pub fn insert_uncompressed(&mut self, key: AnyIpCidr, value: V)where
V: Clone,
Add a new prefix => value mapping.
As values can’t be compared for equality it cannot merge neighbour prefixes that map to the same value.
sourcepub fn insert(&mut self, key: AnyIpCidr, value: V)
pub fn insert(&mut self, key: AnyIpCidr, value: V)
Add a new prefix => value mapping. (Partially) overwrites old mappings.
Trait Implementations§
source§impl<T: Ord + Into<AnyIpCidr>, const N: usize, V: Clone + Ord> From<[(T, V); N]> for CidrMap<V>
impl<T: Ord + Into<AnyIpCidr>, const N: usize, V: Clone + Ord> From<[(T, V); N]> for CidrMap<V>
source§impl UserData for CidrMap<CacheValue>
impl UserData for CidrMap<CacheValue>
source§fn add_methods<M: UserDataMethods<Self>>(methods: &mut M)
fn add_methods<M: UserDataMethods<Self>>(methods: &mut M)
Adds custom methods and operators specific to this userdata.
§fn add_fields<F>(fields: &mut F)where
F: UserDataFields<Self>,
fn add_fields<F>(fields: &mut F)where
F: UserDataFields<Self>,
Adds custom fields specific to this userdata.
impl<V> StructuralPartialEq for CidrMap<V>where
V: Clone,
Auto Trait Implementations§
impl<V> Freeze for CidrMap<V>where
V: Freeze,
impl<V> RefUnwindSafe for CidrMap<V>where
V: RefUnwindSafe,
impl<V> Send for CidrMap<V>where
V: Send,
impl<V> Sync for CidrMap<V>where
V: Sync,
impl<V> Unpin for CidrMap<V>where
V: Unpin,
impl<V> UnwindSafe for CidrMap<V>where
V: UnwindSafe,
Blanket Implementations§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoLua for Twhere
T: UserData + MaybeSend + 'static,
impl<T> IntoLua for Twhere
T: UserData + MaybeSend + 'static,
§impl<T> IntoLuaMulti for Twhere
T: IntoLua,
impl<T> IntoLuaMulti for Twhere
T: IntoLua,
§fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>
fn into_lua_multi(self, lua: &Lua) -> Result<MultiValue, Error>
Performs the conversion.