pub struct Keyed<T: AsRawMutObject> { /* private fields */ }
Expand description
An WafObject
or TypedWafObject
associated with a key.
Implementations§
Source§impl<T: AsRawMutObject> Keyed<T>
impl<T: AsRawMutObject> Keyed<T>
Sourcepub fn key(&self) -> &[u8] ⓘ
pub fn key(&self) -> &[u8] ⓘ
Obtains the key associated with this Keyed<WafObject>
, as-is.
§Panics
Panics if the underlying object’s key is too long to be represented on this platform. This can only happen on
platforms where usize
is 32-bit wide.
Sourcepub fn key_str(&self) -> Result<&str, Utf8Error>
pub fn key_str(&self) -> Result<&str, Utf8Error>
Obtains the key associated with this Keyed<WafObject>
as a string.
§Errors
Returns an error if the underlying key data is not a valid UTF-8 string, under the same conditions as
std::str::from_utf8
.
Sourcepub fn set_key(&mut self, key: &[u8]) -> &mut Self
pub fn set_key(&mut self, key: &[u8]) -> &mut Self
Sets the key associated with this Keyed<WafObject>
.
Sourcepub fn set_key_str(&mut self, key: &str) -> &mut Self
pub fn set_key_str(&mut self, key: &str) -> &mut Self
Sets the key associated with this Keyed<WafObject>
to the provided string.
Source§impl Keyed<WafObject>
impl Keyed<WafObject>
pub fn as_type<T: TypedWafObject>(&self) -> Option<&Keyed<T>>
pub fn as_type_mut<T: TypedWafObject>(&mut self) -> Option<&mut Keyed<T>>
Trait Implementations§
Source§impl<T: AsRawMutObject> AsRef<_ddwaf_object> for Keyed<T>
impl<T: AsRawMutObject> AsRef<_ddwaf_object> for Keyed<T>
Source§fn as_ref(&self) -> &ddwaf_object
fn as_ref(&self) -> &ddwaf_object
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl IntoIterator for Keyed<WafArray>
impl IntoIterator for Keyed<WafArray>
Source§impl IntoIterator for Keyed<WafMap>
impl IntoIterator for Keyed<WafMap>
Auto Trait Implementations§
impl<T> Freeze for Keyed<T>where
T: Freeze,
impl<T> RefUnwindSafe for Keyed<T>where
T: RefUnwindSafe,
impl<T> Send for Keyed<T>where
T: Send,
impl<T> Sync for Keyed<T>where
T: Sync,
impl<T> Unpin for Keyed<T>where
T: Unpin,
impl<T> UnwindSafe for Keyed<T>where
T: 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