LogStore::read takes a reference to namespace (#126)

This commit is contained in:
Lei, Huang
2022-08-02 12:59:08 +08:00
committed by GitHub
parent 868098d2b7
commit b5fcdae01d
4 changed files with 15 additions and 14 deletions

View File

@@ -28,22 +28,22 @@ pub trait LogStore: Send + Sync + 'static + std::fmt::Debug {
// Append a batch of entries atomically and return the offset of first entry.
async fn append_batch(
&self,
ns: Self::Namespace,
ns: &Self::Namespace,
e: Vec<Self::Entry>,
) -> Result<Id, Self::Error>;
// Create a new `EntryStream` to asynchronously generates `Entry` with ids starting from `id`.
async fn read(
&self,
ns: Self::Namespace,
ns: &Self::Namespace,
id: Id,
) -> Result<SendableEntryStream<Self::Entry, Self::Error>, Self::Error>;
// Create a new `Namespace`.
async fn create_namespace(&mut self, ns: Self::Namespace) -> Result<(), Self::Error>;
async fn create_namespace(&mut self, ns: &Self::Namespace) -> Result<(), Self::Error>;
// Delete an existing `Namespace` with given ref.
async fn delete_namespace(&mut self, ns: Self::Namespace) -> Result<(), Self::Error>;
async fn delete_namespace(&mut self, ns: &Self::Namespace) -> Result<(), Self::Error>;
// List all existing namespaces.
async fn list_namespaces(&self) -> Result<Vec<Self::Namespace>, Self::Error>;