pub struct EventV0 {
pub content: EventContentV0,
pub topic_sig: Sig,
pub peer_sig: Sig,
}
Expand description
Pub/sub event published in a topic
Forwarded along event routing table entries
Fields§
§content: EventContentV0
§topic_sig: Sig
Signature over content by topic key
peer_sig: Sig
Signature over content by publisher PeerID priv key
Implementations§
Source§impl EventV0
impl EventV0
pub fn verify(&self) -> Result<(), NgError>
pub fn derive_key( repo_id: &RepoId, branch_id: &BranchId, branch_secret: &ReadCapSecret, publisher: &PubKey, ) -> [u8; 32]
pub fn new( publisher: &PrivKey, seq: u64, commit: &Commit, additional_blocks: &Vec<BlockId>, repo: &Repo, ) -> Result<EventV0, NgError>
Sourcepub fn open_with_info(
&self,
repo: &Repo,
branch: &BranchInfo,
) -> Result<Commit, NgError>
pub fn open_with_info( &self, repo: &Repo, branch: &BranchInfo, ) -> Result<Commit, NgError>
opens an event with the key derived from information kept in Repo.
returns the Commit object and optional list of additional block IDs. Those blocks have been added to the storage of store of repo so they can be retrieved.
pub fn open( &self, store: &Store, repo_id: &RepoId, branch_id: &BranchId, branch_secret: &ReadCapSecret, with_body: bool, ) -> Result<Commit, NgError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EventV0
impl<'de> Deserialize<'de> for EventV0
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EventV0
impl RefUnwindSafe for EventV0
impl Send for EventV0
impl Sync for EventV0
impl Unpin for EventV0
impl UnwindSafe for EventV0
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