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<V> PartialEq for CidrMap<V>
impl<V> PartialEq for CidrMap<V>
source§impl UserData for CidrMap<CacheValue>
impl UserData for CidrMap<CacheValue>
source§fn add_methods<'lua, M: UserDataMethods<'lua, Self>>(methods: &mut M)
fn add_methods<'lua, M: UserDataMethods<'lua, Self>>(methods: &mut M)
Adds custom methods and operators specific to this userdata.
§fn add_fields<'lua, F>(fields: &mut F)where
F: UserDataFields<'lua, Self>,
fn add_fields<'lua, F>(fields: &mut F)where
F: UserDataFields<'lua, 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
§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>
§impl<'lua, T> IntoLua<'lua> for Twhere
T: UserData + MaybeSend + 'static,
impl<'lua, T> IntoLua<'lua> for Twhere
T: UserData + MaybeSend + 'static,
§impl<'lua, T> IntoLuaMulti<'lua> for Twhere
T: IntoLua<'lua>,
impl<'lua, T> IntoLuaMulti<'lua> for Twhere
T: IntoLua<'lua>,
§fn into_lua_multi(self, lua: &'lua Lua) -> Result<MultiValue<'lua>, Error>
fn into_lua_multi(self, lua: &'lua Lua) -> Result<MultiValue<'lua>, Error>
Performs the conversion.