pub struct MemoryCache { /* private fields */ }Expand description
内存缓存
Implementations§
Source§impl MemoryCache
impl MemoryCache
pub fn new(capacity: usize) -> Self
pub async fn get_vector(&self, id: &str) -> Option<Vector>
pub async fn put_vector(&self, id: String, vector: Vector)
pub async fn get_node(&self, id: &str) -> Option<GraphNode>
pub async fn put_node(&self, id: String, node: GraphNode)
pub async fn get_edge(&self, id: &str) -> Option<GraphEdge>
pub async fn put_edge(&self, id: String, edge: GraphEdge)
pub async fn clear(&self)
pub async fn get_stats(&self) -> (usize, usize, usize, usize)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for MemoryCache
impl !UnwindSafe for MemoryCache
impl Freeze for MemoryCache
impl Send for MemoryCache
impl Sync for MemoryCache
impl Unpin for MemoryCache
impl UnsafeUnpin for MemoryCache
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 more