Skip to main content

OperationManager

Struct OperationManager 

Source
pub struct OperationManager { /* private fields */ }

Implementations§

Source§

impl OperationManager

Source

pub fn cache_capacity(&self) -> usize

Source

pub fn set_cache_capacity(&self, capacity: usize)

Source

pub fn clear_cache(&self)

Source

pub fn invalidate<O: OperationDeclaration>(&self, key: &CacheKey) -> Result<()>

Source

pub fn invalidate_from<O: OperationDeclaration>( &self, owner: &str, key: &CacheKey, ) -> Result<()>

Source§

impl OperationManager

Source

pub fn register_middleware(&self, middleware: Arc<dyn Middleware>) -> Result<()>

Source

pub fn register_authorizer(&self, authorizer: Arc<dyn Authorizer>) -> Result<()>

Source

pub fn with_context(&self, context: CallContext) -> Self

Source

pub fn status(&self, id: OperationInstanceId) -> Option<OperationStatus>

Source§

impl OperationManager

Source

pub fn definition(&self, id: &str) -> Result<Definition>

Source

pub fn definition_from(&self, owner: &str, id: &str) -> Result<Definition>

Source

pub fn submit_from<O: OperationDeclaration>( &self, owner: &str, request: O, ) -> Result<OperationInstance<O>>

Source

pub fn definitions(&self) -> Vec<Definition>

Source

pub fn owner(&self, id: &str) -> Result<Identifier>

Source§

impl OperationManager

Source

pub fn register_operation<T>( &self, owner: impl Into<String>, lane: impl Lane, resources: Arc<T::Resources>, ) -> Result<()>
where T: for<'ctx> Operation<Context<'ctx> = Context<'ctx>>,

Source

pub fn register_operation_id<T>( &self, owner: impl Into<String>, id: impl Into<String>, lane: impl Lane, resources: Arc<T::Resources>, ) -> Result<()>
where T: for<'ctx> Operation<Context<'ctx> = Context<'ctx>>,

Source

pub fn register_wire_operation<T>( &self, owner: impl Into<String>, lane: impl Lane, resources: Arc<T::Resources>, ) -> Result<()>
where T: for<'ctx> Operation<Context<'ctx> = Context<'ctx>>,

Source

pub fn register_wire_contract<T>( &self, owner: impl Into<String>, contract: &Contract, lane: impl Lane, resources: Arc<T::Resources>, ) -> Result<()>
where T: for<'ctx> Operation<Context<'ctx> = Context<'ctx>>,

Source§

impl OperationManager

Source

pub async fn unregister(&self, id: &str) -> Result<()>

Source

pub async fn unregister_from(&self, owner: &str, id: &str) -> Result<()>

Source§

impl OperationManager

Source

pub async fn shutdown(&self) -> Result<()>

Source§

impl OperationManager

Source

pub fn submit<O: OperationDeclaration>( &self, request: O, ) -> Result<OperationInstance<O>>

Source

pub fn submit_endpoints<O: OperationDeclaration, P: Send + 'static>( &self, request: O, endpoints: P, ) -> Result<OperationInstance<O>>

Source

pub fn submit_charged<O: OperationDeclaration, P: Send + 'static>( &self, request: StreamItem<O>, endpoints: P, ) -> Result<OperationInstance<O>>

Source

pub fn submit_at<O: OperationDeclaration>( &self, id: &str, request: O, ) -> Result<OperationInstance<O>>

Source

pub async fn call<O: OperationDeclaration>( &self, request: O, ) -> Result<Response<O::Response>>

Source

pub fn submit_caused<O: OperationDeclaration>( &self, request: O, cause: Position, ) -> Result<OperationInstance<O>>

Source

pub async fn call_caused<O: OperationDeclaration>( &self, request: O, cause: Position, ) -> Result<Response<O::Response>>

Source§

impl OperationManager

Source

pub fn register_observer<B: ObserverBackend>(&self, backend: B) -> Result<()>

Source

pub fn stage_observers<B: ObserverBackend>( &self, resources: &Arc<B::Resources>, backends: impl IntoIterator<Item = B>, ) -> Result<ObserverRegistration>

Source

pub fn register_service<A, R, F, T>( &self, definition: ServiceDefinition, factory: F, ) -> Result<()>
where A: Application, R: Send + Sync + 'static, F: Fn(Arc<R>) -> T + Send + Sync + 'static, T: Resident<A>,

Source

pub async fn submit_with_resources_at<R: Send + Sync + 'static>( &self, id: &str, resources: Arc<R>, ) -> Result<OperationInstance<Activation>>

Source

pub async fn submit_resident( &self, id: &str, ) -> Result<OperationInstance<Activation>>

Source

pub fn resident_definition(&self, id: &str) -> Option<Definition>

Source

pub fn resident_definitions(&self) -> Vec<Definition>

Source

pub fn resident(&self, key: &Key) -> Option<Snapshot>

Source

pub fn residents(&self) -> BTreeMap<Key, Snapshot>

Source

pub fn watch_residents(&self) -> Receiver<BTreeMap<Key, Snapshot>>

Source

pub fn resident_key(&self, instance: OperationInstanceId) -> Option<Key>

Source

pub fn root_resources(&self) -> Arc<()> ⓘ

Source

pub async fn retire_resources<R: Send + Sync + 'static>( &self, resources: &Arc<R>, ) -> Result<()>

Source

pub async fn unregister_resident(&self, id: &str) -> Result<()>

Source

pub async fn stop_observers(&self) -> Result<()>

Source

pub async fn shutdown_residents(&self) -> Result<()>

Source§

impl OperationManager

Source

pub fn upload<O: OperationDeclaration>( &self, request: O, settings: StreamSettings, ) -> Result<Upload<O>>

Source

pub fn download<O: OperationDeclaration>( &self, request: O, settings: StreamSettings, ) -> Result<Download<O>>

Source

pub fn exchange<O: OperationDeclaration>( &self, request: O, input: StreamSettings, output: StreamSettings, ) -> Result<Exchange<O>>

Source§

impl OperationManager

Source

pub fn register_operations<C, R>( &self, owner: impl Into<String>, lane: impl Lane, resources: Arc<R>, ) -> Result<()>
where R: Send + Sync + 'static, C: Catalog<AuthoredDeclarations> + Catalog<Implementations<R>>,

Source

pub fn register_wire_operations<C, R>( &self, owner: impl Into<String>, lane: impl Lane, resources: Arc<R>, ) -> Result<()>

Source§

impl OperationManager

Source

pub fn submit_encoded( &self, operation: &str, payload: Vec<u8>, ) -> Result<EncodedInvocation>

Source

pub async fn call_encoded( &self, operation: &str, payload: Vec<u8>, ) -> Result<Vec<u8>>

Trait Implementations§

Source§

impl Clone for OperationManager

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Host for OperationManager

Source§

type Error = Error

Source§

type Instance<O: OperationDeclaration> = OperationInstance<O>

Source§

fn context(&self) -> &CallContext

Source§

fn with_value<T: ContextValue>(&self, value: T) -> Result<Self, ContextError>

Source§

fn submit<O: OperationDeclaration>( &self, request: O, ) -> impl Future<Output = Result<OperationInstance<O>>> + Send

Source§

fn call<O: OperationDeclaration>( &self, request: O, ) -> impl Future<Output = Result<Response<O::Response>>> + Send

Source§

fn submit_with_resources<O: OperationDeclaration<Response = ()>, R: Send + Sync + 'static>( &self, _: O, resources: Arc<R>, ) -> impl Future<Output = Result<OperationInstance<O>>> + Send

Source§

fn publish_on<S>( &self, row: &<S as StreamSpec>::Row, ) -> impl Future<Output = Result<(), Self::Error>> + Send
where S: StreamSpec, <S as StreamSpec>::Row: Message,

Source§

fn publish<S>( &self, row: &S, ) -> impl Future<Output = Result<(), Self::Error>> + Send
where S: StreamSpec<Row = S> + Message,

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<C, T> Catalogued<C> for T
where T: Into<C>,

Source§

fn catalogued(self) -> C

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Mutual<T> for T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<R> RecordProjection<R> for R

Source§

fn project(&self) -> Option<&R>

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more