pub struct Core { /* private fields */ }Expand description
Composition root for a sync-first operation runtime.
Core owns the operation descriptors, the matching handler table, an
optional pre-handler admission guard, and the optional receipt sink shared
with each invocation context. It performs only synchronous dispatch;
handlers run on the caller’s thread.
Implementations§
Source§impl Core
impl Core
Sourcepub fn builder() -> CoreBuilder
pub fn builder() -> CoreBuilder
Start a new runtime builder.
Sourcepub fn contains_operation(&self, name: impl AsRef<str>) -> bool
pub fn contains_operation(&self, name: impl AsRef<str>) -> bool
Return true when an operation descriptor is mounted for name.
Sourcepub fn descriptor(&self, name: impl AsRef<str>) -> Option<&OperationDescriptor>
pub fn descriptor(&self, name: impl AsRef<str>) -> Option<&OperationDescriptor>
Look up an operation descriptor by name.
Sourcepub fn invoke(
&mut self,
name: impl AsRef<str>,
input: OperationInput,
) -> Result<CheckoutResult, RuntimeError>
pub fn invoke( &mut self, name: impl AsRef<str>, input: OperationInput, ) -> Result<CheckoutResult, RuntimeError>
Invoke a registered operation by name.
The dispatch path intentionally stays small: resolve the descriptor,
resolve the handler, borrow a Ctx, and run the handler synchronously.
§Errors
Returns RuntimeError::UnknownOperation when no descriptor is mounted
for name, RuntimeError::MissingHandler when no matching handler is
present, a handler-provided runtime error from the invoked handler, or a
fail-closed receipt-sink error after a resolved handler invocation.
Sourcepub fn checkout_frame(
&mut self,
frame: CheckoutFrame,
) -> Result<CheckoutResult, RuntimeError>
pub fn checkout_frame( &mut self, frame: CheckoutFrame, ) -> Result<CheckoutResult, RuntimeError>
Invoke a checkout frame by resolving it against this runtime.
§Errors
Returns the same errors as Core::invoke.
Sourcepub fn checkout(
&mut self,
checkout: Checkout,
) -> Result<CheckoutResult, RuntimeError>
pub fn checkout( &mut self, checkout: Checkout, ) -> Result<CheckoutResult, RuntimeError>
Invoke a checkout that has already been resolved against a register.
Runtime receipts are owned by this method. Handlers receive only their invocation context and cannot write directly to the configured sink.
§Errors
Returns RuntimeError::UnknownOperation when this runtime does not
mount the checkout descriptor, RuntimeError::MissingHandler when no
matching handler is present, a handler-provided runtime error, or a
fail-closed receipt-sink error after a resolved handler invocation.
Auto Trait Implementations§
impl !RefUnwindSafe for Core
impl !Send for Core
impl !Sync for Core
impl !UnwindSafe for Core
impl Freeze for Core
impl Unpin for Core
impl UnsafeUnpin for Core
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> 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 more