pub struct CellServerBuilder { /* private fields */ }Expand description
Builder for creating a CellServer.
Implementations§
Source§impl CellServerBuilder
impl CellServerBuilder
Sourcepub fn with_bind_addr(self, addr: SocketAddr) -> Self
pub fn with_bind_addr(self, addr: SocketAddr) -> Self
Set the WebSocket bind address.
Sourcepub fn with_host_id(self, id: Uuid) -> Self
pub fn with_host_id(self, id: Uuid) -> Self
Set the server host ID (auto-generated if not set).
Sourcepub fn with_postgres(self, config: PostgresConfig) -> Self
pub fn with_postgres(self, config: PostgresConfig) -> Self
Configure Postgres for event persistence/distribution.
Sourcepub fn with_peer_registry(self, config: PeerRegistryConfig) -> Self
pub fn with_peer_registry(self, config: PeerRegistryConfig) -> Self
Configure peer registry for federation.
Sourcepub fn with_default_persister(self, persister: Arc<dyn Persister>) -> Self
pub fn with_default_persister(self, persister: Arc<dyn Persister>) -> Self
Set the default persister used for all entity types without explicit overrides.
Sourcepub fn with_persister_override(
self,
entity_type: impl Into<String>,
persister: Arc<dyn Persister>,
) -> Self
pub fn with_persister_override( self, entity_type: impl Into<String>, persister: Arc<dyn Persister>, ) -> Self
Override persister for a specific entity type (e.g. “Pulse”).
Sourcepub fn with_peer_clients(
self,
peer_clients: Arc<DashMap<Arc<str>, Arc<MykoClient>>>,
) -> Self
pub fn with_peer_clients( self, peer_clients: Arc<DashMap<Arc<str>, Arc<MykoClient>>>, ) -> Self
Provide a pre-constructed peer-client map. The server’s peer
registry will populate it as peers connect. Pass the same Arc
into PeerPersister::new(...) when you register a
with_persister_override(..., PeerPersister) so the persister
shares the live map.
Sourcepub fn after_init(self, f: impl FnOnce(&CellServer) + Send + 'static) -> Self
pub fn after_init(self, f: impl FnOnce(&CellServer) + Send + 'static) -> Self
Register a callback to run after initialization and relation establishment, but before the WebSocket accept loop starts. Use this for starting subsystems that need entity data (e.g., scene engine).
Sourcepub fn with_server_info(self, info: ServerInfo) -> Self
pub fn with_server_info(self, info: ServerInfo) -> Self
Set the MCP ServerInfo advertised on the /myko/mcp initialize
response. Defaults to ServerInfo::default() (myko-mcp /
CARGO_PKG_VERSION / no instructions).
Sourcepub fn build(self) -> CellServer
pub fn build(self) -> CellServer
Build the server.
Trait Implementations§
Source§impl Default for CellServerBuilder
impl Default for CellServerBuilder
Source§fn default() -> CellServerBuilder
fn default() -> CellServerBuilder
Auto Trait Implementations§
impl !RefUnwindSafe for CellServerBuilder
impl !Sync for CellServerBuilder
impl !UnwindSafe for CellServerBuilder
impl Freeze for CellServerBuilder
impl Send for CellServerBuilder
impl Unpin for CellServerBuilder
impl UnsafeUnpin for CellServerBuilder
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> 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