Skip to main content

HostBuilder

Struct HostBuilder 

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

Builder that mounts modules and lowers them into a runnable Host.

Implementations§

Source§

impl HostBuilder

Source

pub fn new() -> Self

Create an empty host builder backed by the production ThreadSpawn.

Source

pub fn receipt_sink<S>(self, sink: S) -> Self
where S: ReceiptSink + 'static,

Attach the receipt sink the composed runtime records into.

Source

pub fn status_sink<S>(self, sink: S) -> Self
where S: OperationStatusSink + Send + Sync + 'static,

Wire an operation-status sink through to the composed runtime.

Operations mounted through this host then emit syncbat::OperationStatusFactV1 lifecycle facts (started / terminal) exactly as they would through a bare syncbat::CoreBuilder::status_sink. Without a sink bound, no lifecycle facts are recorded.

Source

pub fn grant_capability(self, capability: impl Into<String>) -> Self

Grant one runtime capability token to the composed runtime (repeatable).

An operation declaring a required capability token (via OperationEffectRow::requires_capability or the #[operation] macro) dispatches only when every named token was granted here; otherwise the runtime fails closed, exactly as with syncbat::CoreBuilder::grant_capability.

Source

pub fn grant_capabilities<I, S>(self, capabilities: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Grant several runtime capability tokens; see Self::grant_capability for the gate semantics.

Source

pub fn effect_backend<B>(self, backend: B) -> Self
where B: EffectBackend + 'static,

Attach the runtime-owned effect backend operations append through.

Operations append events only via Ctx, which performs the append through this backend; without it bound, an append_event call fails closed instead of reaching a store the runtime did not mediate.

Source

pub fn host_control<C>(self, controller: C) -> Self
where C: HostController + 'static,

Attach the controller that performs a Control operation’s declared host controls.

Control operations reach host authority only via Ctx, which performs the identified control through this controller; without it bound, a use_host_control call fails closed instead of touching the host. The composed host-control backend layers OUTER over any effect_backend, so the store axes still flow through that inner backend.

Source

pub fn mount(self, module: HostModule) -> Result<Self, HostError>

Mount a module, validating it against everything already mounted.

§Errors

A HostError collision variant if the module’s id, any operation, receipt namespace, or job kind clashes with a mounted module; or HostError::ModuleHashMismatch if the module’s manifest does not match its declared parts.

Source

pub fn build(self) -> Result<Host, HostError>

Lower the mounted modules into a runnable Host.

§Errors

HostError::EmptyHost if nothing is mounted; HostError::ModuleCoherence if a declared operation has no handler; HostError::Build if the lowered syncbat runtime does not validate; or HostError::CanonicalEncoding if the fingerprint cannot be sealed.

Trait Implementations§

Source§

impl Default for HostBuilder

Source§

fn default() -> Self

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

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<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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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