0.1.0-pre.004
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: kb-lib/src/model/replay.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! Source-neutral instruction replay input shared by decoders and stores.
|
||||
|
||||
@@ -123,4 +123,21 @@ impl CoreInstructionReplayInput {
|
||||
}
|
||||
return std::result::Result::Ok(());
|
||||
}
|
||||
|
||||
/// Adds an optional stable surface hint after validation.
|
||||
pub fn with_surface_code_hint(
|
||||
mut self,
|
||||
surface_code_hint: std::option::Option<std::string::String>,
|
||||
) -> kb_core::Result<Self> {
|
||||
if surface_code_hint
|
||||
.as_deref()
|
||||
.is_some_and(|surface| return surface.trim().is_empty())
|
||||
{
|
||||
return std::result::Result::Err(kb_core::Error::invalid_state(
|
||||
"core replay input surface hint must not be empty when present",
|
||||
));
|
||||
}
|
||||
self.surface_code_hint = surface_code_hint;
|
||||
return std::result::Result::Ok(self);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user