pub struct ExternalResourceVec {
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 ExternalResourceVec
impl ExternalResourceVec
pub fn new() -> ExternalResourceVec
pub fn with_capacity(cap: usize) -> ExternalResourceVec
pub const fn from_const_slice( input: &'static [ExternalResource], ) -> ExternalResourceVec
pub fn from_vec(input: Vec<ExternalResource>) -> ExternalResourceVec
pub fn iter(&self) -> Iter<'_, ExternalResource>
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<&ExternalResource>
pub fn get(&self, index: usize) -> Option<&ExternalResource>
Returns a reference to the element at the given index (Rust-only, inline).
Sourcepub fn c_get(&self, index: usize) -> OptionExternalResourcewhere
ExternalResource: Clone,
pub fn c_get(&self, index: usize) -> OptionExternalResourcewhere
ExternalResource: 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) -> &[ExternalResource]
pub fn as_slice(&self) -> &[ExternalResource]
Returns the vec as a Rust slice (Rust-only, not C-API compatible).
Sourcepub fn as_c_slice(&self) -> ExternalResourceVecSlice
pub fn as_c_slice(&self) -> ExternalResourceVecSlice
Returns a C-compatible slice of the entire Vec.
Sourcepub fn as_c_slice_range(
&self,
start: usize,
end: usize,
) -> ExternalResourceVecSlice
pub fn as_c_slice_range( &self, start: usize, end: usize, ) -> ExternalResourceVecSlice
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 ExternalResource
pub fn as_ptr(&self) -> *const ExternalResource
Returns a pointer to the Vec’s data.
Use len() to get the number of elements.
Source§impl ExternalResourceVec
impl ExternalResourceVec
pub fn as_mut_slice_extended<'a>(&mut self) -> &'a mut [ExternalResource]
pub fn as_mut_ptr(&mut self) -> *mut ExternalResource
pub fn sort_by<F>(&mut self, compare: F)
pub fn push(&mut self, value: ExternalResource)
pub fn insert(&mut self, index: usize, element: ExternalResource)
pub fn remove(&mut self, index: usize)
pub fn pop(&mut self) -> Option<ExternalResource>
pub fn iter_mut(&mut self) -> IterMut<'_, ExternalResource>
pub fn into_iter(self) -> IntoIter<ExternalResource>
pub fn append(&mut self, other: &mut ExternalResourceVec)
pub fn reserve(&mut self, additional: usize)
pub fn truncate(&mut self, len: usize)
pub fn retain<F>(&mut self, f: F)
Source§impl ExternalResourceVec
impl ExternalResourceVec
pub fn from_copy_on_write( input: Cow<'static, [ExternalResource]>, ) -> ExternalResourceVec
Sourcepub fn from_item(item: ExternalResource) -> ExternalResourceVec
pub fn from_item(item: ExternalResource) -> ExternalResourceVec
Creates a Vec containing a single element
Sourcepub unsafe fn copy_from_ptr(
ptr: *const ExternalResource,
len: usize,
) -> ExternalResourceVec
pub unsafe fn copy_from_ptr( ptr: *const ExternalResource, len: usize, ) -> ExternalResourceVec
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) -> ExternalResourceVec
pub fn clone_self(&self) -> ExternalResourceVec
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<ExternalResource>
pub fn into_library_owned_vec(self) -> Vec<ExternalResource>
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 AsMut<[ExternalResource]> for ExternalResourceVec
impl AsMut<[ExternalResource]> for ExternalResourceVec
Source§fn as_mut(&mut self) -> &mut [ExternalResource]
fn as_mut(&mut self) -> &mut [ExternalResource]
Source§impl AsRef<[ExternalResource]> for ExternalResourceVec
impl AsRef<[ExternalResource]> for ExternalResourceVec
Source§fn as_ref(&self) -> &[ExternalResource]
fn as_ref(&self) -> &[ExternalResource]
Source§impl Clone for ExternalResourceVec
impl Clone for ExternalResourceVec
Source§fn clone(&self) -> ExternalResourceVec
fn clone(&self) -> ExternalResourceVec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExternalResourceVec
impl Debug for ExternalResourceVec
Source§impl Default for ExternalResourceVec
impl Default for ExternalResourceVec
Source§fn default() -> ExternalResourceVec
fn default() -> ExternalResourceVec
Source§impl Drop for ExternalResourceVec
impl Drop for ExternalResourceVec
Source§impl Extend<ExternalResource> for ExternalResourceVec
impl Extend<ExternalResource> for ExternalResourceVec
Source§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = ExternalResource>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = ExternalResource>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl From<&'static [ExternalResource]> for ExternalResourceVec
impl From<&'static [ExternalResource]> for ExternalResourceVec
Source§fn from(input: &'static [ExternalResource]) -> ExternalResourceVec
fn from(input: &'static [ExternalResource]) -> ExternalResourceVec
Source§impl From<ExternalResourceVec> for Vec<ExternalResource>
impl From<ExternalResourceVec> for Vec<ExternalResource>
Source§fn from(input: ExternalResourceVec) -> Vec<ExternalResource>
fn from(input: ExternalResourceVec) -> Vec<ExternalResource>
Source§impl From<Vec<ExternalResource>> for ExternalResourceVec
impl From<Vec<ExternalResource>> for ExternalResourceVec
Source§fn from(input: Vec<ExternalResource>) -> ExternalResourceVec
fn from(input: Vec<ExternalResource>) -> ExternalResourceVec
Source§impl FromIterator<ExternalResource> for ExternalResourceVec
impl FromIterator<ExternalResource> for ExternalResourceVec
Source§fn from_iter<T>(iter: T) -> ExternalResourceVecwhere
T: IntoIterator<Item = ExternalResource>,
fn from_iter<T>(iter: T) -> ExternalResourceVecwhere
T: IntoIterator<Item = ExternalResource>,
Source§impl Hash for ExternalResourceVec
impl Hash for ExternalResourceVec
Source§impl Ord for ExternalResourceVec
impl Ord for ExternalResourceVec
Source§fn cmp(&self, rhs: &ExternalResourceVec) -> Ordering
fn cmp(&self, rhs: &ExternalResourceVec) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ExternalResourceVec
impl PartialEq for ExternalResourceVec
Source§impl PartialOrd for ExternalResourceVec
impl PartialOrd for ExternalResourceVec
impl Eq for ExternalResourceVec
impl Send for ExternalResourceVec
impl Sync for ExternalResourceVec
Auto Trait Implementations§
impl Freeze for ExternalResourceVec
impl RefUnwindSafe for ExternalResourceVec
impl Unpin for ExternalResourceVec
impl UnsafeUnpin for ExternalResourceVec
impl UnwindSafe for ExternalResourceVec
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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