pub struct StorageHandle { /* private fields */ }Expand description
Open storage resources shared by crawler contexts.
let storage = StorageHandle::new(c, d, k, q);
let _default_dataset = storage.dataset();Implementations§
Source§impl StorageHandle
impl StorageHandle
Sourcepub fn new(
client: Arc<dyn StorageClient>,
dataset: Arc<dyn Dataset>,
key_value_store: Arc<dyn KeyValueStore>,
request_queue: Arc<dyn RequestQueue>,
) -> Self
pub fn new( client: Arc<dyn StorageClient>, dataset: Arc<dyn Dataset>, key_value_store: Arc<dyn KeyValueStore>, request_queue: Arc<dyn RequestQueue>, ) -> Self
Wraps a client and its already-opened default resources.
Sourcepub fn key_value_store(&self) -> &Arc<dyn KeyValueStore>
pub fn key_value_store(&self) -> &Arc<dyn KeyValueStore>
Returns the default key-value store.
Sourcepub fn request_queue(&self) -> &Arc<dyn RequestQueue>
pub fn request_queue(&self) -> &Arc<dyn RequestQueue>
Returns the default request queue.
Sourcepub async fn dataset_named(&self, name: &str) -> StorageResult<Arc<dyn Dataset>>
pub async fn dataset_named(&self, name: &str) -> StorageResult<Arc<dyn Dataset>>
Opens a named dataset through the underlying client.
Sourcepub async fn kvs_named(
&self,
name: &str,
) -> StorageResult<Arc<dyn KeyValueStore>>
pub async fn kvs_named( &self, name: &str, ) -> StorageResult<Arc<dyn KeyValueStore>>
Opens a named key-value store through the underlying client.
Sourcepub fn client(&self) -> &Arc<dyn StorageClient>
pub fn client(&self) -> &Arc<dyn StorageClient>
Returns the storage backend client.
Trait Implementations§
Source§impl Clone for StorageHandle
impl Clone for StorageHandle
Source§fn clone(&self) -> StorageHandle
fn clone(&self) -> StorageHandle
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 StorageHandle
impl !UnwindSafe for StorageHandle
impl Freeze for StorageHandle
impl Send for StorageHandle
impl Sync for StorageHandle
impl Unpin for StorageHandle
impl UnsafeUnpin for StorageHandle
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