pub struct MocoQueue {
pub capacity: usize,
pub dim: usize,
pub data: Vec<f32>,
pub head: usize,
pub len: usize,
}Expand description
FIFO circular queue of D-dimensional embedding vectors.
Fields§
§capacity: usizeCapacity (max number of stored vectors).
dim: usizeEmbedding dimensionality.
data: Vec<f32>Backing storage: [capacity × dim] flat row-major buffer.
head: usizeIndex where the next enqueue writes (mod capacity).
len: usizeNumber of valid entries currently in the queue (<= capacity).
Implementations§
Source§impl MocoQueue
impl MocoQueue
Sourcepub fn new(capacity: usize, dim: usize) -> SslResult<Self>
pub fn new(capacity: usize, dim: usize) -> SslResult<Self>
Create an empty queue with given capacity and embedding dim.
§Errors
SslError::QueueCapacityTooSmallifcapacity == 0.SslError::InvalidFeatureDimifdim == 0.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MocoQueue
impl RefUnwindSafe for MocoQueue
impl Send for MocoQueue
impl Sync for MocoQueue
impl Unpin for MocoQueue
impl UnsafeUnpin for MocoQueue
impl UnwindSafe for MocoQueue
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