pub struct WorkingBuffer { /* private fields */ }Expand description
A reusable working buffer for temporary storage
This buffer manages raw memory that can be interpreted as different types
(f64 or Complex
§Safety
This struct manages raw memory and must be used carefully:
- The buffer is aligned for Complex
(16 bytes) - When casting to different types, ensure alignment requirements are met
Implementations§
Source§impl WorkingBuffer
impl WorkingBuffer
Sourcepub fn with_capacity_bytes(capacity_bytes: usize) -> Self
pub fn with_capacity_bytes(capacity_bytes: usize) -> Self
Create a new working buffer with initial capacity (in bytes)
Sourcepub fn ensure_capacity_bytes(&mut self, required_bytes: usize)
pub fn ensure_capacity_bytes(&mut self, required_bytes: usize)
Ensure the buffer has at least the specified capacity in bytes
If the current capacity is insufficient, the buffer is reallocated. Existing data is NOT preserved.
Sourcepub fn ensure_capacity<T>(&mut self, count: usize)
pub fn ensure_capacity<T>(&mut self, count: usize)
Ensure the buffer can hold at least count elements of type T
Sourcepub unsafe fn as_f64_slice_mut(&mut self, count: usize) -> &mut [f64]
pub unsafe fn as_f64_slice_mut(&mut self, count: usize) -> &mut [f64]
Get the buffer as a mutable slice of f64
§Safety
Caller must ensure:
- The buffer has enough capacity for
countf64 elements - No other references to this buffer exist
Sourcepub unsafe fn as_complex_slice_mut(
&mut self,
count: usize,
) -> &mut [Complex<f64>]
pub unsafe fn as_complex_slice_mut( &mut self, count: usize, ) -> &mut [Complex<f64>]
Get the buffer as a mutable slice of Complex
§Safety
Caller must ensure:
- The buffer has enough capacity for
countComplexelements - No other references to this buffer exist
Sourcepub fn capacity_bytes(&self) -> usize
pub fn capacity_bytes(&self) -> usize
Get current capacity in bytes
Trait Implementations§
Source§impl Default for WorkingBuffer
impl Default for WorkingBuffer
Source§impl Drop for WorkingBuffer
impl Drop for WorkingBuffer
impl Send for WorkingBuffer
impl Sync for WorkingBuffer
Auto Trait Implementations§
impl Freeze for WorkingBuffer
impl RefUnwindSafe for WorkingBuffer
impl Unpin for WorkingBuffer
impl UnwindSafe for WorkingBuffer
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
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> IntoCloned<T> for T
impl<T> IntoCloned<T> for T
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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.