pub struct BufferStoreHandle { /* private fields */ }Expand description
Concrete service-registry-friendly wrapper around
Arc<dyn BufferStore>. Modes register interest by pulling
Arc<BufferStoreHandle> from
crate::ServiceRegistry::get::<BufferStoreHandle>().
Cheap to clone — internal Arc<dyn BufferStore> is one atomic
bump.
Implementations§
Source§impl BufferStoreHandle
impl BufferStoreHandle
Sourcepub fn new(inner: Arc<dyn BufferStore>) -> Self
pub fn new(inner: Arc<dyn BufferStore>) -> Self
Wrap the host’s store. Called once by the host at boot (the concrete store lives in the host); tests wrap a stub.
Sourcepub fn find_by_name(&self, name: &str) -> Option<BufferId>
pub fn find_by_name(&self, name: &str) -> Option<BufferId>
Forwards to BufferStore::find_by_name.
Sourcepub fn handle_for(&self, id: BufferId) -> Option<Arc<dyn Document>>
pub fn handle_for(&self, id: BufferId) -> Option<Arc<dyn Document>>
Forwards to BufferStore::handle_for.
Sourcepub fn name_for(&self, id: BufferId) -> Option<String>
pub fn name_for(&self, id: BufferId) -> Option<String>
Forwards to BufferStore::name_for (the synthetic-name slot —
None for ordinary file-backed buffers).
Sourcepub fn path_for(&self, id: BufferId) -> Option<PathBuf>
pub fn path_for(&self, id: BufferId) -> Option<PathBuf>
Forwards to BufferStore::path_for.
Sourcepub fn contains_buffer(&self, id: BufferId) -> bool
pub fn contains_buffer(&self, id: BufferId) -> bool
The existence oracle. See BufferStore::contains_buffer for why this
is not name_for(id).is_some().
Sourcepub fn insert_document_buffer(
&self,
id: BufferId,
kind: BufferKind,
handle: Arc<dyn Document>,
flags: BufferFlags,
name: Option<String>,
)
pub fn insert_document_buffer( &self, id: BufferId, kind: BufferKind, handle: Arc<dyn Document>, flags: BufferFlags, name: Option<String>, )
H.1 pass-through wrapper. See
BufferStore::insert_document_buffer.
Trait Implementations§
Source§impl Clone for BufferStoreHandle
impl Clone for BufferStoreHandle
Source§fn clone(&self) -> BufferStoreHandle
fn clone(&self) -> BufferStoreHandle
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§
impl !RefUnwindSafe for BufferStoreHandle
impl !UnwindSafe for BufferStoreHandle
impl Freeze for BufferStoreHandle
impl Send for BufferStoreHandle
impl Sync for BufferStoreHandle
impl Unpin for BufferStoreHandle
impl UnsafeUnpin for BufferStoreHandle
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