pub struct SharedEmbedder(/* private fields */);Expand description
One embedder handed to several databases.
crate::DatabaseBuilder::embedder takes ownership, which is right for one
database and wrong for a workspace: a hundred chats do not want a hundred
HTTP clients pointed at the same endpoint. Each database gets its own
SharedEmbedder over one shared provider instead.
A plain refcount, with no lock in it. Sharing an Embedder needs nothing
more, because embed takes &self; this type used to hold a Mutex and
that mutex was the only reason concurrent embedding serialized. Cloning is
an atomic increment, so handing one out per database costs nothing.
Implementations§
Trait Implementations§
Source§fn clone(&self) -> SharedEmbedder
fn clone(&self) -> SharedEmbedder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
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