pub struct Kernel { /* private fields */ }Expand description
The PunkGo kernel — single-writer append-only event system.
The kernel is the committer (whitepaper §2): a structural role that provides a single linearization point for actions. It is not a judge.
Use Kernel::bootstrap to initialize from a state directory, then
Kernel::handle_request to process IPC requests.
Implementations§
Source§impl Kernel
impl Kernel
Sourcepub async fn bootstrap(config: &KernelConfig) -> KernelResult<Self>
pub async fn bootstrap(config: &KernelConfig) -> KernelResult<Self>
Initialize the kernel from a state directory.
Creates the SQLite database, loads stellar config, and prepares the root actor.
Sourcepub fn stellar_config(&self) -> &StellarConfig
pub fn stellar_config(&self) -> &StellarConfig
Returns a reference to the stellar configuration for external use (e.g., energy producer startup).
Sourcepub fn energy_ledger(&self) -> &EnergyLedger
pub fn energy_ledger(&self) -> &EnergyLedger
Returns a clone of the energy ledger for external use (e.g., energy producer).
Sourcepub fn actor_store(&self) -> &ActorStore
pub fn actor_store(&self) -> &ActorStore
Returns a clone of the actor store for external use (e.g., energy producer).
Sourcepub fn envelope_store(&self) -> &EnvelopeStore
pub fn envelope_store(&self) -> &EnvelopeStore
Returns a reference to the envelope store for external use.
Sourcepub fn pool(&self) -> SqlitePool
pub fn pool(&self) -> SqlitePool
Returns the SQLite pool for external use (e.g., energy producer transaction).
Sourcepub async fn handle_request(&self, req: RequestEnvelope) -> ResponseEnvelope
pub async fn handle_request(&self, req: RequestEnvelope) -> ResponseEnvelope
Handle an incoming IPC request — dispatches to quote, submit, or read.
Auto Trait Implementations§
impl Freeze for Kernel
impl !RefUnwindSafe for Kernel
impl Send for Kernel
impl Sync for Kernel
impl Unpin for Kernel
impl UnsafeUnpin for Kernel
impl !UnwindSafe for Kernel
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