Skip to main content

ddwaf_object

Type Alias ddwaf_object 

Source
pub type ddwaf_object = _ddwaf_object;

Aliased Type§

#[repr(C)]
pub union ddwaf_object { pub type_: u8, pub via: _ddwaf_object__bindgen_ty_1, }

Fields§

§type_: u8§via: _ddwaf_object__bindgen_ty_1

Implementations§

Source§

impl ddwaf_object

Source

pub unsafe fn drop_array(&mut self)

Drops the array data associated with the receiving ddwaf_object.

§Safety
§Panics

Panics if the capacity is too large to construct a valid allocation layout. This is only possible on 32-bit targets because the capacity is limited to 28 bits.

Source

pub unsafe fn drop_map(&mut self)

Drops the map data associated with the receiving ddwaf_object.

§Safety
§Panics

Panics if the capacity is too large to construct a valid allocation layout. This is only possible on 32-bit targets because the capacity is limited to 28 bits.

Source

pub unsafe fn drop_object(&mut self)

Drops the value associated with the receiving ddwaf_object.

§Safety

If the ddwaf_object is a string, array, or map, the respective requirements of the ddwaf_object::drop_string, ddwaf_object::drop_array, or ddwaf_object::drop_map methods apply. The method can’t be called more than once.

Source

pub unsafe fn drop_string(&mut self)

Drops the regular string associated with the receiving ddwaf_object.

§Safety
Source

pub fn obj_type(&self) -> DDWAF_OBJ_TYPE

Returns the type of the ddwaf_object

Source

pub fn is_string(&self) -> bool

Returns true if the ddwaf_object is a string.

Source

pub fn is_array(&self) -> bool

Returns true if the ddwaf_object is either array representation.

Source

pub fn is_map(&self) -> bool

Returns true if the ddwaf_object is either map representation.

Source

pub fn array_len(&self) -> usize

Returns the length of the array associated with the receiving ddwaf_object.

§Panics

Panics if the object is not an array.

Source

pub fn array_capacity(&self) -> usize

Returns the capacity of the array associated with the receiving ddwaf_object.

§Panics

Panics if the object is not an array.

Source

pub fn array_ptr(&self) -> *mut ddwaf_object

Returns the element pointer of the array associated with the receiving ddwaf_object.

§Panics

Panics if the object is not an array.

Source

pub unsafe fn set_array_len(&mut self, new_len: usize)

Changes the length of the array associated with the receiving ddwaf_object.

§Safety

Every element before new_len must be initialized and valid to drop.

§Panics

Panics if new_len exceeds the array’s capacity.

Source

pub fn map_len(&self) -> usize

Returns the length of the map associated with the receiving ddwaf_object.

§Panics

Panics if the object is not a map.

Source

pub fn map_capacity(&self) -> usize

Returns the capacity of the map associated with the receiving ddwaf_object.

§Panics

Panics if the object is not a map.

Source

pub fn map_ptr(&self) -> *mut _ddwaf_object_kv

Returns the entry pointer of the map associated with the receiving ddwaf_object.

§Panics

Panics if the object is not a map.

Source

pub unsafe fn set_map_len(&mut self, new_len: usize)

Changes the length of the map associated with the receiving ddwaf_object.

§Safety

Every entry before new_len must be initialized and valid to drop.

§Panics

Panics if new_len exceeds the map’s capacity.

Trait Implementations§

Source§

impl Debug for ddwaf_object

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ddwaf_object

Source§

fn eq(&self, other: &ddwaf_object) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Send for ddwaf_object

Source§

impl Sync for ddwaf_object