pub struct InMemoryEventStore { /* private fields */ }streamable-http and non-WebAssembly only.Expand description
In-memory event store implementation.
Implements this module’s three-method EventStore trait — NOT the
six-method crate::shared::event_store::EventStore, and NOT the
same-named crate::shared::event_store::InMemoryEventStore (both spans, not
links: that module is gated behind v1-compat while this doc is not).
§Public path
This type is reachable at pmcp::server::streamable_http_server::InMemoryEventStore
and the example below exists to PIN that path: it is the concrete type the
public StreamableHttpServerConfig::event_store field takes, so moving or
re-exporting it elsewhere would be a MAJOR semver break. Phase 117 gates v1
surface without changing where any of it is reachable from on the default
(v1-compat) build, and this doctest fails to compile if that stops being
true.
The ungated half pins the TYPE PATH, which is public API on both feature sets
(see the EventStore trait doc for why removing it is a 3.0 change):
use pmcp::server::streamable_http_server::InMemoryEventStore;
use std::sync::Arc;
let store = Arc::new(InMemoryEventStore::default());
assert_eq!(Arc::strong_count(&store), 1);The v1-compat half pins the CONFIG WIRING, which is gated — this example does
not compile on --no-default-features --features full-v2, and that is the
severance being asserted rather than a bug:
use pmcp::server::streamable_http_server::{InMemoryEventStore, StreamableHttpServerConfig};
use std::sync::Arc;
let store = Arc::new(InMemoryEventStore::default());
let config = StreamableHttpServerConfig {
event_store: Some(Arc::clone(&store)),
..Default::default()
};
assert!(config.event_store.is_some());