MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / put_actor

Method put_actor

atomic-core/src/operation/codec.rs:660–681  ·  view source on GitHub ↗
(&mut self, actor: &ActorRef)

Source from the content-addressed store, hash-verified

658 }
659
660 fn put_actor(&mut self, actor: &ActorRef) -> Result<(), OperationCodecError> {
661 match actor {
662 ActorRef::Human { did } => {
663 self.put_u8(0)?;
664 self.put_string(did, "human actor DID")
665 }
666 ActorRef::Agent { did, session, turn } => {
667 self.put_u8(1)?;
668 self.put_string(did, "agent actor DID")?;
669 self.put_string(session, "agent session")?;
670 self.put_optional_tag(turn.is_some())?;
671 if let Some(turn) = turn {
672 self.put_u64(*turn)?;
673 }
674 Ok(())
675 }
676 ActorRef::System { name } => {
677 self.put_u8(2)?;
678 self.put_string(name, "system actor name")
679 }
680 }
681 }
682
683 fn put_loss_note(&mut self, note: &OperationLossNote) -> Result<(), OperationCodecError> {
684 ensure_strictly_sorted(&note.evidence, "loss-note evidence")?;

Callers 1

encode_operation_payloadFunction · 0.80

Calls 4

put_u8Method · 0.80
put_stringMethod · 0.80
put_optional_tagMethod · 0.80
put_u64Method · 0.80

Tested by

no test coverage detected