pub struct NatsBlobstoreProvider { /* private fields */ }Expand description
NatsBlobstoreProvider holds the default NATS connection configuration and individual consumer
components’ established NATS JetStream connections.
Implementations§
Source§impl NatsBlobstoreProvider
Implement the NatsBlobstoreProvider and Provider traits
impl NatsBlobstoreProvider
Implement the NatsBlobstoreProvider and Provider traits
pub async fn run() -> Result<()>
Sourcepub fn from_host_data(host_data: &HostData) -> NatsBlobstoreProvider
pub fn from_host_data(host_data: &HostData) -> NatsBlobstoreProvider
Build a NatsBlobstoreProvider from HostData
Trait Implementations§
Source§impl Clone for NatsBlobstoreProvider
impl Clone for NatsBlobstoreProvider
Source§fn clone(&self) -> NatsBlobstoreProvider
fn clone(&self) -> NatsBlobstoreProvider
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for NatsBlobstoreProvider
impl Default for NatsBlobstoreProvider
Source§fn default() -> NatsBlobstoreProvider
fn default() -> NatsBlobstoreProvider
Source§impl Handler<Option<Context>> for NatsBlobstoreProvider
impl Handler<Option<Context>> for NatsBlobstoreProvider
Source§async fn get_container_data(
&self,
context: Option<Context>,
id: ObjectId,
start: u64,
end: u64,
) -> Result<Result<(Pin<Box<dyn Stream<Item = Bytes> + Send>>, Pin<Box<dyn Future<Output = Result<(), String>> + Send>>), String>>
async fn get_container_data( &self, context: Option<Context>, id: ObjectId, start: u64, end: u64, ) -> Result<Result<(Pin<Box<dyn Stream<Item = Bytes> + Send>>, Pin<Box<dyn Future<Output = Result<(), String>> + Send>>), String>>
Retrieve data from an object in the specified NATS blobstore Container Optionally specify start and end byte offsets for partial reads
Source§async fn list_container_objects(
&self,
context: Option<Context>,
name: String,
_offset: Option<u64>,
_limit: Option<u64>,
) -> Result<Result<(Pin<Box<dyn Stream<Item = Vec<String>> + Send>>, Pin<Box<dyn Future<Output = Result<(), String>> + Send>>), String>>
async fn list_container_objects( &self, context: Option<Context>, name: String, _offset: Option<u64>, _limit: Option<u64>, ) -> Result<Result<(Pin<Box<dyn Stream<Item = Vec<String>> + Send>>, Pin<Box<dyn Future<Output = Result<(), String>> + Send>>), String>>
Helper function to list all objects in a NATS blobstore container. This ensures consistent implementation across all functions that need to list objects. Delegates to the core implementation in blobstore.rs.
async fn create_container( &self, context: Option<Context>, name: String, ) -> Result<Result<(), String>>
async fn get_container_info( &self, context: Option<Context>, name: String, ) -> Result<Result<ContainerMetadata, String>>
async fn container_exists( &self, context: Option<Context>, name: String, ) -> Result<Result<bool, String>>
async fn write_container_data( &self, context: Option<Context>, id: ObjectId, data: Pin<Box<dyn Stream<Item = Bytes> + Send>>, ) -> Result<Result<Pin<Box<dyn Future<Output = Result<(), String>> + Send>>, String>>
async fn clear_container( &self, context: Option<Context>, name: String, ) -> Result<Result<(), String>>
async fn delete_container( &self, context: Option<Context>, name: String, ) -> Result<Result<(), String>>
async fn has_object( &self, context: Option<Context>, id: ObjectId, ) -> Result<Result<bool, String>>
async fn get_object_info( &self, context: Option<Context>, id: ObjectId, ) -> Result<Result<ObjectMetadata, String>>
async fn copy_object( &self, context: Option<Context>, source: ObjectId, destination: ObjectId, ) -> Result<Result<(), String>>
async fn move_object( &self, context: Option<Context>, source: ObjectId, destination: ObjectId, ) -> Result<Result<(), String>>
async fn delete_object( &self, context: Option<Context>, id: ObjectId, ) -> Result<Result<(), String>>
async fn delete_objects( &self, context: Option<Context>, name: String, objects: Vec<String>, ) -> Result<Result<(), String>>
Source§impl Provider for NatsBlobstoreProvider
Handle provider control commands
impl Provider for NatsBlobstoreProvider
Handle provider control commands
Source§async fn receive_link_config_as_target(
&self,
link_config: LinkConfig<'_>,
) -> Result<()>
async fn receive_link_config_as_target( &self, link_config: LinkConfig<'_>, ) -> Result<()>
Provider should perform any operations needed for a new link, including setting up per-component resources, and checking authorization. If the link is allowed, return true, otherwise return false to deny the link.
Source§async fn delete_link_as_target(&self, info: impl LinkDeleteInfo) -> Result<()>
async fn delete_link_as_target(&self, info: impl LinkDeleteInfo) -> Result<()>
Provider should perform any operations needed for a link deletion, including cleaning up per-component resources.
Source§async fn on_config_update(
&self,
update: impl ProviderConfigUpdate,
) -> Result<()>
async fn on_config_update( &self, update: impl ProviderConfigUpdate, ) -> Result<()>
Provider should perform any operations needed for configuration updates, including cleaning up invalidated link resources.
Source§fn init(
&self,
init_config: impl ProviderInitConfig,
) -> impl Future<Output = Result<(), E>> + Send
fn init( &self, init_config: impl ProviderInitConfig, ) -> impl Future<Output = Result<(), E>> + Send
Source§fn receive_link_config_as_source(
&self,
config: LinkConfig<'_>,
) -> impl Future<Output = Result<(), E>> + Send
fn receive_link_config_as_source( &self, config: LinkConfig<'_>, ) -> impl Future<Output = Result<(), E>> + Send
Source§fn delete_link_as_source(
&self,
_info: impl LinkDeleteInfo,
) -> impl Future<Output = Result<(), E>> + Send
fn delete_link_as_source( &self, _info: impl LinkDeleteInfo, ) -> impl Future<Output = Result<(), E>> + Send
Source§fn health_request(
&self,
_arg: &HealthCheckRequest,
) -> impl Future<Output = Result<HealthCheckResponse, E>> + Send
fn health_request( &self, _arg: &HealthCheckRequest, ) -> impl Future<Output = Result<HealthCheckResponse, E>> + Send
Auto Trait Implementations§
impl Freeze for NatsBlobstoreProvider
impl !RefUnwindSafe for NatsBlobstoreProvider
impl Send for NatsBlobstoreProvider
impl Sync for NatsBlobstoreProvider
impl Unpin for NatsBlobstoreProvider
impl !UnwindSafe for NatsBlobstoreProvider
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
self file descriptor. Read moreSource§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request