推进 server-rs DDD 分层与新接口接线
This commit is contained in:
@@ -50,6 +50,7 @@ pub mod npc;
|
||||
pub mod puzzle;
|
||||
pub mod runtime;
|
||||
pub mod story;
|
||||
pub mod story_runtime;
|
||||
|
||||
use std::{
|
||||
error::Error,
|
||||
@@ -424,6 +425,20 @@ impl SpacetimeClient {
|
||||
}
|
||||
}
|
||||
|
||||
impl SpacetimeClientError {
|
||||
pub(crate) fn from_sdk_error(error: impl fmt::Display) -> Self {
|
||||
Self::Procedure(error.to_string())
|
||||
}
|
||||
|
||||
pub(crate) fn procedure_failed(message: Option<String>) -> Self {
|
||||
Self::Procedure(message.unwrap_or_else(|| "SpacetimeDB procedure 返回未知错误".to_string()))
|
||||
}
|
||||
|
||||
pub(crate) fn missing_snapshot(label: &'static str) -> Self {
|
||||
Self::Procedure(format!("SpacetimeDB procedure 未返回{label}"))
|
||||
}
|
||||
}
|
||||
|
||||
impl PooledConnection {
|
||||
fn is_broken(&self) -> bool {
|
||||
self.broken.load(Ordering::SeqCst)
|
||||
|
||||
Reference in New Issue
Block a user