pub struct ObjectStoreDirectoryService {
instance_name: String,
object_store: Arc<dyn ObjectStore>,
base_path: Path,
}Expand description
Stores directory closures in an object store.
Notably, this makes use of the option to disallow accessing child directories except when
fetching them recursively via the top-level directory, since all batched writes
(using put_multiple_start) are stored in a single object.
Directories are stored in a length-delimited format with a 1MiB limit. The length field is a
u32 and the directories are stored in root-to-leaves topological order, the same way they will
be returned to the client in get_recursive.
Fields§
§instance_name: String§object_store: Arc<dyn ObjectStore>§base_path: PathImplementations§
Source§impl ObjectStoreDirectoryService
impl ObjectStoreDirectoryService
Sourcepub fn parse_url_opts<I, K, V>(url: &Url, options: I) -> Result<Self, Error>
pub fn parse_url_opts<I, K, V>(url: &Url, options: I) -> Result<Self, Error>
Constructs a new ObjectStoreDirectoryService from a Url supported by object_store. Any path suffix becomes the base path of the object store. additional options, the same as in object_store::parse_url_opts can be passed.
Sourcepub fn parse_url(url: &Url) -> Result<Self, Error>
pub fn parse_url(url: &Url) -> Result<Self, Error>
Like Self::parse_url_opts, except without the options.
pub fn new( instance_name: String, object_store: Arc<dyn ObjectStore>, base_path: Path, ) -> Self
Trait Implementations§
Source§impl Clone for ObjectStoreDirectoryService
impl Clone for ObjectStoreDirectoryService
Source§fn clone(&self) -> ObjectStoreDirectoryService
fn clone(&self) -> ObjectStoreDirectoryService
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl DirectoryService for ObjectStoreDirectoryService
impl DirectoryService for ObjectStoreDirectoryService
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: &'life1 B3Digest,
) -> Pin<Box<dyn Future<Output = Result<Option<Directory>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: &'life1 B3Digest,
) -> Pin<Box<dyn Future<Output = Result<Option<Directory>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
This is the same steps as for get_recursive anyways, so we just call get_recursive and return the first element of the stream and drop the request.
Source§fn put<'life0, 'async_trait>(
&'life0 self,
directory: Directory,
) -> Pin<Box<dyn Future<Output = Result<B3Digest, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
directory: Directory,
) -> Pin<Box<dyn Future<Output = Result<B3Digest, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_recursive(
&self,
root_directory_digest: &B3Digest,
) -> BoxStream<'_, Result<Directory, Error>>
fn get_recursive( &self, root_directory_digest: &B3Digest, ) -> BoxStream<'_, Result<Directory, Error>>
Source§fn put_multiple_start(&self) -> Box<dyn DirectoryPutter + '_>where
Self: Clone,
fn put_multiple_start(&self) -> Box<dyn DirectoryPutter + '_>where
Self: Clone,
Auto Trait Implementations§
impl Freeze for ObjectStoreDirectoryService
impl !RefUnwindSafe for ObjectStoreDirectoryService
impl Send for ObjectStoreDirectoryService
impl Sync for ObjectStoreDirectoryService
impl Unpin for ObjectStoreDirectoryService
impl UnsafeUnpin for ObjectStoreDirectoryService
impl !UnwindSafe for ObjectStoreDirectoryService
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].