pub struct Context {
pub client: Client,
pub synthesize: SynthesizeFn,
pub chain: Arc<Mutex<OutcomeChain<OutcomePayload, InMemorySink<OutcomePayload>, NoSigning>>>,
}Expand description
Per-controller shared context. The chain handle is Arc<Mutex>
so every reconcile pass appends through the same sink — across
every LavaArchitecture CR on this operator instance, every
receipt links to the same monotonic sequence.
In production this is typically a FilesystemSink rooted at
/var/lib/lava-operator/chains/<resource-key>/ with an Ed25519
signer loaded from the lava-operator-signing-key Secret. The
default (Context::with_in_memory_chain) uses an InMemorySink + NoSigning so the controller is runnable end-to-end without
configuration.
Fields§
§client: Client§synthesize: SynthesizeFn§chain: Arc<Mutex<OutcomeChain<OutcomePayload, InMemorySink<OutcomePayload>, NoSigning>>>Implementations§
Source§impl Context
impl Context
Sourcepub fn with_in_memory_chain(client: Client, synthesize: SynthesizeFn) -> Self
pub fn with_in_memory_chain(client: Client, synthesize: SynthesizeFn) -> Self
Construct a context with an in-memory chain + no signing.
Production callers replace chain with a typed
FilesystemSink + Ed25519Signer after construction.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Context
impl !UnwindSafe for Context
impl Freeze for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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 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> ⓘ
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