pub struct ConsciousnessStream {
pub state: Arc<Mutex<StreamState>>,
/* private fields */
}Expand description
Thread-safe wrapper
Fields§
§state: Arc<Mutex<StreamState>>Implementations§
Source§impl ConsciousnessStream
impl ConsciousnessStream
Sourcepub fn start(config: &Config) -> Arc<Mutex<StreamState>> ⓘ
pub fn start(config: &Config) -> Arc<Mutex<StreamState>> ⓘ
Start the stream in a background thread. Sets the global stream state so recall can use it.
Sourcepub fn feed_query(state: &Arc<Mutex<StreamState>>, query_hash: u64)
pub fn feed_query(state: &Arc<Mutex<StreamState>>, query_hash: u64)
Feed a query into the stream — triggers surprise if prediction was wrong.
Sourcepub fn format_internal(s: &StreamState) -> String
pub fn format_internal(s: &StreamState) -> String
Internal format implementation (takes &StreamState reference).
Sourcepub fn format(state: &Arc<Mutex<StreamState>>) -> String
pub fn format(state: &Arc<Mutex<StreamState>>) -> String
Get the current stream state as a formatted string.
Sourcepub fn format_snapshot(snapshot: &SharedSnapshot) -> String
pub fn format_snapshot(snapshot: &SharedSnapshot) -> String
Format a snapshot read via seqlock — no Mutex needed on the read path.
Use this from the MCP tool or any other reader that wants lock-free
access. Falls back to “stale data” if the writer is mid-update for
more than SNAPSHOT_MAX_RETRIES iterations.
Auto Trait Implementations§
impl Freeze for ConsciousnessStream
impl RefUnwindSafe for ConsciousnessStream
impl Send for ConsciousnessStream
impl Sync for ConsciousnessStream
impl Unpin for ConsciousnessStream
impl UnsafeUnpin for ConsciousnessStream
impl UnwindSafe for ConsciousnessStream
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<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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