pub struct WafArray { /* private fields */ }Expand description
The WAF object representation of a value of type WafObjectType::Array
Implementations§
Source§impl WafArray
impl WafArray
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Returns true if this WafArray is indeed WafObjectType::Array.
Sourcepub const fn capacity(&self) -> u16
pub const fn capacity(&self) -> u16
Returns the capacity of this WafArray.
The capacity is an implementation detail and is only used to for properly deallocating the memory when the array is dropped.
Sourcepub fn truncate(&mut self, new_size: u16)
pub fn truncate(&mut self, new_size: u16)
Truncates this WafArray to the provided size.
Has no effect is the current length is not greater than the new size.
It does not free the extra memory, except insofar as it drops the extra elements. Useful when you pessimistically allocate a larger array, but later discover that you don’t need all the capacity.
Trait Implementations§
Source§impl AsRef<_ddwaf_object> for WafArray
impl AsRef<_ddwaf_object> for WafArray
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 WafArray
impl IntoIterator for WafArray
Source§impl TypedWafObject for WafArray
impl TypedWafObject for WafArray
Source§const TYPE: WafObjectType = WafObjectType::Array
const TYPE: WafObjectType = WafObjectType::Array
The associated
WafObjectType constant corresponding to the typed
object’s type discriminator.Auto Trait Implementations§
impl Freeze for WafArray
impl RefUnwindSafe for WafArray
impl Send for WafArray
impl Sync for WafArray
impl Unpin for WafArray
impl UnwindSafe for WafArray
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