Skip to main content

App

Struct App 

Source
pub struct App { /* private fields */ }
Expand description

An app: one service made of whole domains, for Kernable::app. Every aggregate, read model and reactor created through its domains runs in it. Built with methods that each return the changed app:

let app = kernable.app(App::new().service("shop").version("1.0.0").domain(&shop_domain))?; then app.run().await?. To do something once everything is connected (e.g. in a test), spawn it and wait: let running = tokio::spawn({ let app = app.clone(); async move { app.run().await } }); app.ready().await;.

Implementations§

Source§

impl App

Source

pub fn new() -> App

An app without domains for the connection’s service; add them with App::domain.

Source

pub fn service(self, service: impl Into<String>) -> App

The service it is. Default: the connection’s (crate::Options::service).

Source

pub fn version(self, version: impl Into<String>) -> App

Goes into the membership’s metadata as version.

Source

pub fn description(self, description: impl Into<String>) -> App

Goes into the membership’s metadata as description.

Source

pub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> App

More metadata, after version and description; kept in the order given.

Source

pub fn domain(self, domain: &Domain) -> App

A domain of the app: its aggregates, read models and reactors run in it. Call it once per domain.

Source

pub fn switch(self, switch: Switch) -> App

When the app’s deployment takes the service over from another one that serves it (see Switch): by default once its read models have caught up, if the deployment never served before; meanwhile it runs beside the serving deployment, its workers idle and its read models building. One that served before (an older deployment’s app restarting) runs beside until an operator rolls back. Default: KERNABLE_SWITCH (caught-up, now, never), else Switch::CaughtUp.

Trait Implementations§

Source§

impl Clone for App

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 Default for App

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for App

§

impl Freeze for App

§

impl Move for App

§

impl RefUnwindSafe for App

§

impl Send for App

§

impl Sync for App

§

impl Unpin for App

§

impl UnsafeUnpin for App

§

impl UnwindSafe for App

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<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> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
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