Enum Event

Source
pub enum Event {
    RefsFetched {
        remote: PublicKey,
        rid: RepoId,
        updated: Vec<RefUpdate>,
    },
    RefsSynced {
        remote: PublicKey,
        rid: RepoId,
        at: Oid,
    },
    SeedDiscovered {
        rid: RepoId,
        nid: PublicKey,
    },
    SeedDropped {
        rid: RepoId,
        nid: PublicKey,
    },
    PeerConnected {
        nid: PublicKey,
    },
    PeerDisconnected {
        nid: PublicKey,
        reason: String,
    },
    LocalRefsAnnounced {
        rid: RepoId,
        refs: RefsAt,
        timestamp: Timestamp,
    },
    InventoryAnnounced {
        nid: PublicKey,
        inventory: Vec<RepoId>,
        timestamp: Timestamp,
    },
    RefsAnnounced {
        nid: PublicKey,
        rid: RepoId,
        refs: Vec<RefsAt>,
        timestamp: Timestamp,
    },
    NodeAnnounced {
        nid: PublicKey,
        alias: Alias,
        timestamp: Timestamp,
        features: Features,
        addresses: Vec<Address>,
    },
    UploadPack(UploadPack),
}
Expand description

A service event.

The node emits events of this type to its control socket for other programs to consume.

Variants§

§

RefsFetched

The node has received changes to Git references in a repository stored on the node, from another node.

Fields

§remote: PublicKey

The node identifier of the other node.

§rid: RepoId

The identifier of the repository in question.

§updated: Vec<RefUpdate>

The list of Git references that were updated.

§

RefsSynced

The node has sent its list of Git references to another node and the other has fetched the updated references.

Fields

§remote: PublicKey

The node identifier of the other node.

§rid: RepoId

The identifier of the repository in question.

§at: Oid

The rad/sigrefs reference that was fetched.

§

SeedDiscovered

The node has discovered a repository on new node on the Radicle network.

Fields

§rid: RepoId

The identifier of the repository in question.

§nid: PublicKey

The node identifier of the other node.

§

SeedDropped

The node has dropped a repository on a node from its list of known repositories and nodes.

Fields

§rid: RepoId

The identifier of the repository in question.

§nid: PublicKey

The node identifier of the other node.

§

PeerConnected

The node has connected directly to another node.

Fields

§nid: PublicKey

The node identifier of the other node.

§

PeerDisconnected

The node has terminated its direct connection to another node.

Fields

§nid: PublicKey

The node identifier of the other node.

§reason: String

The reason why the connection was terminated.

§

LocalRefsAnnounced

The local node has received changes to Git references from its local user. In other words, the local user has pushed to the node, updated COBs, or otherwise updated refs in their local node.

Fields

§rid: RepoId

The identifier of the repository in question.

§refs: RefsAt

List of changed Git references for the repository.

§timestamp: Timestamp

When were the new references received? In other words, when did the user run git push?

§

InventoryAnnounced

The node has received a message with a list of repositories on another node on the network.

Fields

§nid: PublicKey

The node identifier of the other node.

§inventory: Vec<RepoId>

List of repositories sent.

§timestamp: Timestamp

When was the list sent?

§

RefsAnnounced

The node has received a message about new signed Git references (“sigrefs”) for a repository on another node on the network.

Fields

§nid: PublicKey

The node identifier of the other node.

§rid: RepoId

The identifier of the repository in question.

§refs: Vec<RefsAt>

List of Git references for the repository.

§timestamp: Timestamp

When was the list sent?

§

NodeAnnounced

The node received a message about a new node on the network.

Fields

§nid: PublicKey

The node identifier of the other node.

§alias: Alias

Alias for the other node.

§timestamp: Timestamp

When was the announcement sent?

§features: Features

What features did the node advertise to the other node.

§addresses: Vec<Address>

What of its addresses did the node tell the other node about?

§

UploadPack(UploadPack)

The node has uploaded a Git pack file to another node.

Trait Implementations§

Source§

impl Clone for Event

Source§

fn clone(&self) -> Event

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Event

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Event

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Event, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<Event> for CommandResult<Event>

Source§

fn from(event: Event) -> CommandResult<Event>

Converts to this type from the input type.
Source§

impl From<UploadPack> for Event

Source§

fn from(value: UploadPack) -> Event

Converts to this type from the input type.
Source§

impl Serialize for Event

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoInit<ZeroInit> for T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,