pub struct DebugMessageVec {
pub run_destructor: bool,
/* private fields */
}Fields§
§run_destructor: boolWhether to run the destructor on drop (prevents double-free when cloned to C)
Implementations§
Source§impl DebugMessageVec
impl DebugMessageVec
pub fn new() -> DebugMessageVec
pub fn with_capacity(cap: usize) -> Self
pub const fn from_const_slice(input: &'static [DebugMessage]) -> Self
pub fn from_vec(input: Vec<DebugMessage>) -> Self
pub fn iter(&self) -> Iter<'_, DebugMessage>
pub fn ptr_as_usize(&self) -> usize
pub const fn len(&self) -> usize
pub const fn capacity(&self) -> usize
pub const fn is_empty(&self) -> bool
Sourcepub fn get(&self, index: usize) -> Option<&DebugMessage>
pub fn get(&self, index: usize) -> Option<&DebugMessage>
Returns a reference to the element at the given index (Rust-only, inline).
Sourcepub fn c_get(&self, index: usize) -> OptionDebugMessagewhere
DebugMessage: Clone,
pub fn c_get(&self, index: usize) -> OptionDebugMessagewhere
DebugMessage: Clone,
C-API compatible get function. Returns a copy of the element at the given index. Returns None if the index is out of bounds.
Sourcepub fn as_slice(&self) -> &[DebugMessage]
pub fn as_slice(&self) -> &[DebugMessage]
Returns the vec as a Rust slice (Rust-only, not C-API compatible).
Sourcepub fn as_c_slice(&self) -> DebugMessageVecSlice
pub fn as_c_slice(&self) -> DebugMessageVecSlice
Returns a C-compatible slice of the entire Vec.
Sourcepub fn as_c_slice_range(&self, start: usize, end: usize) -> DebugMessageVecSlice
pub fn as_c_slice_range(&self, start: usize, end: usize) -> DebugMessageVecSlice
Returns a C-compatible slice of a range within the Vec. If the range is out of bounds, it is clamped to the valid range.
Sourcepub fn as_ptr(&self) -> *const DebugMessage
pub fn as_ptr(&self) -> *const DebugMessage
Returns a pointer to the Vec’s data.
Use len() to get the number of elements.
Source§impl DebugMessageVec
impl DebugMessageVec
pub fn from_copy_on_write( input: Cow<'static, [DebugMessage]>, ) -> DebugMessageVec
Sourcepub fn from_item(item: DebugMessage) -> Self
pub fn from_item(item: DebugMessage) -> Self
Creates a Vec containing a single element
Sourcepub unsafe fn copy_from_ptr(ptr: *const DebugMessage, len: usize) -> Self
pub unsafe fn copy_from_ptr(ptr: *const DebugMessage, len: usize) -> Self
Copies elements from a C array pointer into a new Vec.
§Safety
ptrmust be valid for readinglenelements- The memory must be properly aligned for
$struct_type - The elements are cloned, so
$struct_typemust implementClone
Sourcepub fn clone_self(&self) -> Self
pub fn clone_self(&self) -> Self
NOTE: CLONES the memory if the memory is external or &’static Moves the memory out if the memory is library-allocated
Sourcepub fn into_library_owned_vec(self) -> Vec<DebugMessage>
pub fn into_library_owned_vec(self) -> Vec<DebugMessage>
NOTE: CLONES the memory if the memory is external or &’static Moves the memory out if the memory is library-allocated
Trait Implementations§
Source§impl AsRef<[DebugMessage]> for DebugMessageVec
impl AsRef<[DebugMessage]> for DebugMessageVec
Source§fn as_ref(&self) -> &[DebugMessage]
fn as_ref(&self) -> &[DebugMessage]
Source§impl Clone for DebugMessageVec
impl Clone for DebugMessageVec
Source§impl Debug for DebugMessageVec
impl Debug for DebugMessageVec
Source§impl Default for DebugMessageVec
impl Default for DebugMessageVec
Source§impl Drop for DebugMessageVec
impl Drop for DebugMessageVec
Source§impl From<&'static [DebugMessage]> for DebugMessageVec
impl From<&'static [DebugMessage]> for DebugMessageVec
Source§fn from(input: &'static [DebugMessage]) -> DebugMessageVec
fn from(input: &'static [DebugMessage]) -> DebugMessageVec
Source§impl From<Vec<DebugMessage>> for DebugMessageVec
impl From<Vec<DebugMessage>> for DebugMessageVec
Source§fn from(input: Vec<DebugMessage>) -> DebugMessageVec
fn from(input: Vec<DebugMessage>) -> DebugMessageVec
Source§impl FromIterator<DebugMessage> for DebugMessageVec
impl FromIterator<DebugMessage> for DebugMessageVec
Source§fn from_iter<T>(iter: T) -> Selfwhere
T: IntoIterator<Item = DebugMessage>,
fn from_iter<T>(iter: T) -> Selfwhere
T: IntoIterator<Item = DebugMessage>,
Source§impl Hash for DebugMessageVec
impl Hash for DebugMessageVec
Source§impl Ord for DebugMessageVec
impl Ord for DebugMessageVec
Source§impl PartialEq for DebugMessageVec
impl PartialEq for DebugMessageVec
Source§impl PartialOrd for DebugMessageVec
impl PartialOrd for DebugMessageVec
impl Eq for DebugMessageVec
impl Send for DebugMessageVec
impl Sync for DebugMessageVec
Auto Trait Implementations§
impl Freeze for DebugMessageVec
impl RefUnwindSafe for DebugMessageVec
impl Unpin for DebugMessageVec
impl UnsafeUnpin for DebugMessageVec
impl UnwindSafe for DebugMessageVec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more