Skip to content

Commit

Permalink
add Clone to Actor
Browse files Browse the repository at this point in the history
  • Loading branch information
kayhhh committed Apr 7, 2024
1 parent 6f23104 commit 9b05a49
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/dwn/src/actor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ use self::{
/// Identity actor.
/// Holds a DID and associated keys.
/// Provides methods for interacting with the DID's DWN.
#[derive(Clone)]
pub struct Actor<D: DataStore, M: MessageStore> {
pub attestation: VerifiableCredential,
pub authorization: VerifiableCredential,
Expand Down
7 changes: 7 additions & 0 deletions crates/dwn/src/actor/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ pub struct Remote {
url: String,
}

impl Clone for Remote {
fn clone(&self) -> Self {
let capacity = self.sender.capacity();
Self::new_with_capacity(self.url.clone(), capacity)
}
}

impl Remote {
/// Create a new remote with a message queue size of 100.
pub fn new(url: String) -> Self {
Expand Down

0 comments on commit 9b05a49

Please sign in to comment.