struct WitnessActor {
alias: String,
pre: String,
hby: Habery,
oobi_replies: Vec<u8>,
}Expand description
State owned by the actor thread. Only ever accessed from that one thread.
Fields§
§alias: String§pre: String§hby: Habery§oobi_replies: Vec<u8>Signed /loc/scheme and /end/role replies served with the OOBI (keripy builds these from the config file on startup).
Implementations§
Source§impl WitnessActor
impl WitnessActor
Sourcefn open(
alias: &str,
base_dir: PathBuf,
config: &WitnessNetworkConfig,
) -> Result<Self>
fn open( alias: &str, base_dir: PathBuf, config: &WitnessNetworkConfig, ) -> Result<Self>
Open the witness Habery the way keripy’s kli witness demo does:
Habery(name=alias, salt=Salter(raw=demo_salt).qb64, temp=False) then
makeHab(name=alias, transferable=False) on first start.
fn handle(&mut self, cmd: Command)
Sourcefn guarded<T>(
&mut self,
what: &str,
f: impl FnOnce(&mut Self) -> Result<T, ActorError>,
) -> Result<T, ActorError>
fn guarded<T>( &mut self, what: &str, f: impl FnOnce(&mut Self) -> Result<T, ActorError>, ) -> Result<T, ActorError>
Run one command, turning a panic into an Internal error so a single bad
request (e.g. one that hits a libkeri todo!()) cannot take down the witness.
Sourcefn receipt(
&mut self,
body: &[u8],
attachments: &str,
) -> Result<ReceiptOutcome, ActorError>
fn receipt( &mut self, body: &[u8], attachments: &str, ) -> Result<ReceiptOutcome, ActorError>
keripy ReceiptEnd.on_post.
Source§impl WitnessActor
impl WitnessActor
Sourcefn witnessed_oobi(
&mut self,
aid: &str,
role: Option<&str>,
) -> Result<Vec<u8>, ActorError>
fn witnessed_oobi( &mut self, aid: &str, role: Option<&str>, ) -> Result<Vec<u8>, ActorError>
OOBI for an AID this witness witnesses (keripy OOBIEnd.on_get with
fullyWitnessed): 404 until its latest event holds toad witness
signatures, so a validator never gets a KEL it would have to escrow.
Auto Trait Implementations§
impl !RefUnwindSafe for WitnessActor
impl !UnwindSafe for WitnessActor
impl Freeze for WitnessActor
impl Send for WitnessActor
impl Sync for WitnessActor
impl Unpin for WitnessActor
impl UnsafeUnpin for WitnessActor
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