pub struct WHashtable {
pub keys: WArray,
pub vals: WArray,
}
Expand description
A WeeChat Hashtable.
Why is this not just a HashMap
?
While we do provide a function to create a true HashMap
from this object, we do not
use one by default because the spec is under-specified as to how valid such a transformation
is. Namely, the spec does not detail whether it is valid for a hashtable to contain multiple
instances of the same key, or whether ordering is/can be significant. While the answer is almost
certainly “keys cannot be duplicated and ordering is not significant”, as is the case in Rust’s
HashMap
(so you probably almost always want to convert this immediately), it’s possible that
custom extensions could violate these assumptions without violating the spec, so we opt to defer to
the safer interpretation.
Fields§
§keys: WArray
§vals: WArray
Trait Implementations§
Source§impl Clone for WHashtable
impl Clone for WHashtable
Source§fn clone(&self) -> WHashtable
fn clone(&self) -> WHashtable
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for WHashtable
impl Debug for WHashtable
Source§impl Hash for WHashtable
impl Hash for WHashtable
Source§impl MessageType for WHashtable
impl MessageType for WHashtable
Source§impl PartialEq for WHashtable
impl PartialEq for WHashtable
impl Eq for WHashtable
impl StructuralPartialEq for WHashtable
Auto Trait Implementations§
impl Freeze for WHashtable
impl RefUnwindSafe for WHashtable
impl Send for WHashtable
impl Sync for WHashtable
impl Unpin for WHashtable
impl UnwindSafe for WHashtable
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