pub struct ImportObserver;Expand description
Reads a WorldState that something else produced.
Implementations§
Source§impl ImportObserver
impl ImportObserver
pub fn new() -> Self
Sourcepub fn from_json(text: &str, source: &str) -> Result<WorldState>
pub fn from_json(text: &str, source: &str) -> Result<WorldState>
Parse, check, and stamp a world from raw JSON.
Split out from Observer::observe so the daemon and the MCP server can reuse the
same validation on a world that arrived over the wire rather than from a file. One
implementation of “is this a usable world”, not three.
Sourcepub fn from_stdin() -> Result<WorldState>
pub fn from_stdin() -> Result<WorldState>
Read from standard input.
Sourcepub fn from_file(path: &Path) -> Result<WorldState>
pub fn from_file(path: &Path) -> Result<WorldState>
Read from a file.
Trait Implementations§
Source§impl Clone for ImportObserver
impl Clone for ImportObserver
Source§fn clone(&self) -> ImportObserver
fn clone(&self) -> ImportObserver
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ImportObserver
Source§impl Debug for ImportObserver
impl Debug for ImportObserver
Source§impl Default for ImportObserver
impl Default for ImportObserver
Source§fn default() -> ImportObserver
fn default() -> ImportObserver
Returns the “default value” for a type. Read more
Source§impl Observer for ImportObserver
impl Observer for ImportObserver
Source§fn name(&self) -> &str
fn name(&self) -> &str
Stable name; recorded in
WorldState::observer and hashed into the decision record.Source§fn handles(&self, locator: &str) -> bool
fn handles(&self, locator: &str) -> bool
Could this observer handle the locator? Cheap and syntactic — a
true here is a
claim about the shape of the string, not a promise the target exists.fn observe(&self, locator: &str) -> Result<WorldState>
Auto Trait Implementations§
impl Freeze for ImportObserver
impl RefUnwindSafe for ImportObserver
impl Send for ImportObserver
impl Sync for ImportObserver
impl Unpin for ImportObserver
impl UnsafeUnpin for ImportObserver
impl UnwindSafe for ImportObserver
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