Skip to main content

AlertKind

Enum AlertKind 

Source
pub enum AlertKind {
Show 57 variants TorrentAdded { info_hash: Id20, name: String, }, TorrentRemoved { info_hash: Id20, }, TorrentPaused { info_hash: Id20, }, TorrentResumed { info_hash: Id20, }, TorrentFinished { info_hash: Id20, }, StateChanged { info_hash: Id20, prev_state: TorrentState, new_state: TorrentState, }, MetadataReceived { info_hash: Id20, name: String, }, MetadataFailed { info_hash: Id20, }, TorrentChecked { info_hash: Id20, pieces_have: u32, pieces_total: u32, }, CheckingProgress { info_hash: Id20, progress: f32, }, PieceFinished { info_hash: Id20, piece: u32, }, BlockFinished { info_hash: Id20, piece: u32, offset: u32, }, HashFailed { info_hash: Id20, piece: u32, contributors: Vec<IpAddr>, }, PeerConnected { info_hash: Id20, addr: SocketAddr, }, PeerDisconnected { info_hash: Id20, addr: SocketAddr, reason: Option<String>, }, PeerBanned { info_hash: Id20, addr: SocketAddr, }, TrackerReply { info_hash: Id20, url: String, num_peers: usize, }, TrackerWarning { info_hash: Id20, url: String, message: String, }, TrackerError { info_hash: Id20, url: String, message: String, }, ScrapeReply { info_hash: Id20, url: String, complete: u32, incomplete: u32, downloaded: u32, }, ScrapeError { info_hash: Id20, url: String, message: String, }, DhtBootstrapComplete, DhtGetPeers { info_hash: Id20, num_peers: usize, }, DhtNodeIdViolation { node_id: Id20, addr: SocketAddr, }, DhtSampleInfohashes { num_samples: usize, total_estimate: i64, }, ListenSucceeded { port: u16, }, ListenFailed { port: u16, message: String, }, SessionStatsUpdate(SessionStats), FileRenamed { info_hash: Id20, index: usize, new_path: PathBuf, }, FileCompleted { info_hash: Id20, file_index: usize, }, StorageMoved { info_hash: Id20, new_path: PathBuf, }, FileError { info_hash: Id20, path: PathBuf, message: String, }, DiskStatsUpdate(DiskStats), ResumeDataSaved { info_hash: Id20, }, TorrentError { info_hash: Id20, message: String, }, PerformanceWarning { info_hash: Id20, message: String, }, TorrentQueuePositionChanged { info_hash: Id20, old_pos: i32, new_pos: i32, }, TorrentAutoManaged { info_hash: Id20, paused: bool, }, PeerBlocked { addr: SocketAddr, }, PeerTurnover { info_hash: Id20, disconnected: usize, replaced: usize, }, WebSeedBanned { info_hash: Id20, url: String, }, PortMappingSucceeded { port: u16, protocol: String, }, PortMappingFailed { port: u16, message: String, }, InconsistentHashes { info_hash: Id20, piece: u32, }, DhtPutComplete { target: Id20, }, DhtMutablePutComplete { target: Id20, seq: i64, }, DhtGetResult { target: Id20, value: Option<Vec<u8>>, }, DhtMutableGetResult { target: Id20, value: Option<Vec<u8>>, seq: Option<i64>, public_key: [u8; 32], }, DhtItemError { target: Id20, message: String, }, HolepunchSucceeded { info_hash: Id20, addr: SocketAddr, }, HolepunchFailed { info_hash: Id20, addr: SocketAddr, error_code: Option<u32>, message: String, }, I2pSessionCreated { b32_address: String, }, I2pError { message: String, }, SslTorrentError { info_hash: Id20, message: String, }, SessionStatsAlert { values: Vec<i64>, }, ExternalIpDetected { ip: IpAddr, }, SettingsChanged,
}
Expand description

The specific event that occurred.

Variants§

§

TorrentAdded

A torrent was added to the session.

Fields

§info_hash: Id20

Info hash of the added torrent.

§name: String

Display name of the torrent.

§

TorrentRemoved

A torrent was removed from the session.

Fields

§info_hash: Id20

Info hash of the removed torrent.

§

TorrentPaused

A torrent was paused.

Fields

§info_hash: Id20

Info hash of the paused torrent.

§

TorrentResumed

A torrent was resumed.

Fields

§info_hash: Id20

Info hash of the resumed torrent.

§

TorrentFinished

A torrent finished downloading all pieces.

Fields

§info_hash: Id20

Info hash of the finished torrent.

§

StateChanged

A torrent changed state.

Fields

§info_hash: Id20

Info hash of the affected torrent.

§prev_state: TorrentState

Previous torrent state.

§new_state: TorrentState

New torrent state.

§

MetadataReceived

Torrent metadata received via BEP 9 extension protocol.

Fields

§info_hash: Id20

Info hash of the torrent whose metadata was received.

§name: String

Display name from the received metadata.

§

MetadataFailed

Metadata download failed for a magnet link torrent.

Fields

§info_hash: Id20

Info hash of the torrent whose metadata download failed.

§

TorrentChecked

A torrent finished checking (verifying existing data on disk).

Fields

§info_hash: Id20

Info hash of the checked torrent.

§pieces_have: u32

Number of pieces that passed hash verification.

§pieces_total: u32

Total number of pieces in the torrent.

§

CheckingProgress

Progress update during piece hash checking.

Fields

§info_hash: Id20

Info hash of the torrent being checked.

§progress: f32

Fraction complete (0.0 to 1.0).

§

PieceFinished

A piece passed hash verification and is now complete.

Fields

§info_hash: Id20

Info hash of the affected torrent.

§piece: u32

Zero-based piece index.

§

BlockFinished

A block (sub-piece chunk) was received and written.

Fields

§info_hash: Id20

Info hash of the affected torrent.

§piece: u32

Zero-based piece index containing the block.

§offset: u32

Byte offset of the block within the piece.

§

HashFailed

A piece failed hash verification.

Fields

§info_hash: Id20

Info hash of the affected torrent.

§piece: u32

Zero-based piece index that failed.

§contributors: Vec<IpAddr>

IP addresses of peers that contributed data to this piece.

§

PeerConnected

A new peer connection was established.

Fields

§info_hash: Id20

Info hash of the torrent swarm.

§addr: SocketAddr

Socket address of the connected peer.

§

PeerDisconnected

A peer disconnected.

Fields

§info_hash: Id20

Info hash of the torrent swarm.

§addr: SocketAddr

Socket address of the disconnected peer.

§reason: Option<String>

Human-readable reason for disconnection, if available.

§

PeerBanned

A peer was banned (e.g. for sending corrupt data).

Fields

§info_hash: Id20

Info hash of the torrent swarm.

§addr: SocketAddr

Socket address of the banned peer.

§

TrackerReply

A tracker announce completed successfully.

Fields

§info_hash: Id20

Info hash announced to the tracker.

§url: String

Tracker URL.

§num_peers: usize

Number of peers returned by the tracker.

§

TrackerWarning

A tracker returned a warning message.

Fields

§info_hash: Id20

Info hash announced to the tracker.

§url: String

Tracker URL.

§message: String

Warning message from the tracker.

§

TrackerError

A tracker announce failed.

Fields

§info_hash: Id20

Info hash announced to the tracker.

§url: String

Tracker URL.

§message: String

Error description.

§

ScrapeReply

A tracker scrape completed successfully.

Fields

§info_hash: Id20

Info hash that was scraped.

§url: String

Tracker URL.

§complete: u32

Number of complete peers (seeders).

§incomplete: u32

Number of incomplete peers (leechers).

§downloaded: u32

Total number of completed downloads reported by the tracker.

§

ScrapeError

A tracker scrape failed.

Fields

§info_hash: Id20

Info hash that was scraped.

§url: String

Tracker URL.

§message: String

Error description.

§

DhtBootstrapComplete

DHT routing table bootstrapping finished.

§

DhtGetPeers

DHT get_peers query returned peers for a torrent.

Fields

§info_hash: Id20

Info hash that was queried.

§num_peers: usize

Number of peers returned.

§

DhtNodeIdViolation

BEP 42: A DHT node was rejected because its ID doesn’t match its IP.

Fields

§node_id: Id20

Node ID that violated the BEP 42 constraint.

§addr: SocketAddr

Socket address of the violating node.

§

DhtSampleInfohashes

BEP 51: sample_infohashes response received from a DHT node.

Fields

§num_samples: usize

Number of sampled info hashes received.

§total_estimate: i64

The remote node’s estimate of its total stored info hashes.

§

ListenSucceeded

The session successfully started listening on a port.

Fields

§port: u16

The port number now being listened on.

§

ListenFailed

The session failed to listen on a port.

Fields

§port: u16

The port number that failed to bind.

§message: String

Error description.

§

SessionStatsUpdate(SessionStats)

Periodic session statistics snapshot.

§

FileRenamed

A file within a torrent was renamed.

Fields

§info_hash: Id20

Info hash of the affected torrent.

§index: usize

Zero-based file index within the torrent.

§new_path: PathBuf

The new filesystem path of the file.

§

FileCompleted

All pieces belonging to a file have been downloaded and verified.

Fields

§info_hash: Id20

Info hash of the affected torrent.

§file_index: usize

Zero-based file index that is now complete.

§

StorageMoved

A torrent’s storage was moved to a new directory.

Fields

§info_hash: Id20

Info hash of the affected torrent.

§new_path: PathBuf

The new root directory path.

§

FileError

A file I/O error occurred.

Fields

§info_hash: Id20

Info hash of the affected torrent.

§path: PathBuf

Filesystem path where the error occurred.

§message: String

Error description.

§

DiskStatsUpdate(DiskStats)

Periodic disk I/O statistics snapshot.

§

ResumeDataSaved

Fast resume data was saved for a torrent.

Fields

§info_hash: Id20

Info hash of the torrent whose resume data was saved.

§

TorrentError

A torrent encountered a fatal error.

Fields

§info_hash: Id20

Info hash of the affected torrent.

§message: String

Error description.

§

PerformanceWarning

A performance warning was detected (e.g. too many hash failures).

Fields

§info_hash: Id20

Info hash of the affected torrent.

§message: String

Warning description.

§

TorrentQueuePositionChanged

Queue position changed (manual move or torrent removal shifted positions).

Fields

§info_hash: Id20

Info hash of the affected torrent.

§old_pos: i32

Previous queue position.

§new_pos: i32

New queue position.

§

TorrentAutoManaged

Torrent was paused or resumed by the auto-manage system.

Fields

§info_hash: Id20

Info hash of the affected torrent.

§paused: bool

Whether the torrent was paused (true) or resumed (false).

§

PeerBlocked

An incoming connection was blocked by the IP filter.

Fields

§addr: SocketAddr

Socket address that was blocked.

§

PeerTurnover

Periodic turnover disconnected underperforming peers and connected replacements.

Fields

§info_hash: Id20

Info hash of the affected torrent.

§disconnected: usize

Number of peers disconnected during turnover.

§replaced: usize

Number of replacement peers connected.

§

WebSeedBanned

A web seed was banned (e.g. for serving corrupt data).

Fields

§info_hash: Id20

Info hash of the affected torrent.

§url: String

URL of the banned web seed.

§

PortMappingSucceeded

A UPnP/NAT-PMP port mapping succeeded.

Fields

§port: u16

The mapped external port.

§protocol: String

Protocol name (e.g. “TCP” or “UDP”).

§

PortMappingFailed

A UPnP/NAT-PMP port mapping failed.

Fields

§port: u16

The port that failed to map.

§message: String

Error description.

§

InconsistentHashes

v1 and v2 hashes disagree on the same piece — the .torrent data is inconsistent.

Fields

§info_hash: Id20

Info hash of the affected torrent.

§piece: u32

Zero-based piece index with inconsistent hashes.

§

DhtPutComplete

An immutable DHT put completed.

Fields

§target: Id20

SHA-1 target hash of the stored item.

§

DhtMutablePutComplete

A mutable DHT put completed.

Fields

§target: Id20

SHA-1 target hash derived from the public key and salt.

§seq: i64

Sequence number of the stored value.

§

DhtGetResult

Result of a DHT get (immutable). value is None if not found.

Fields

§target: Id20

SHA-1 target hash that was queried.

§value: Option<Vec<u8>>

The retrieved value, or None if not found.

§

DhtMutableGetResult

Result of a DHT mutable get. value is None if not found.

Fields

§target: Id20

SHA-1 target hash derived from the public key and salt.

§value: Option<Vec<u8>>

The retrieved value, or None if not found.

§seq: Option<i64>

Sequence number of the value, if found.

§public_key: [u8; 32]

Ed25519 public key of the item author.

§

DhtItemError

A BEP 44 DHT operation failed.

Fields

§target: Id20

SHA-1 target hash of the failed operation.

§message: String

Error description.

§

HolepunchSucceeded

A holepunch connection attempt succeeded.

Fields

§info_hash: Id20

Info hash of the torrent swarm.

§addr: SocketAddr

Socket address of the peer reached via holepunch.

§

HolepunchFailed

A holepunch connection attempt failed.

Fields

§info_hash: Id20

Info hash of the torrent swarm.

§addr: SocketAddr

Socket address of the peer we attempted to reach.

§error_code: Option<u32>

BEP 55 error code, if provided by the relay.

§message: String

Human-readable error description.

§

I2pSessionCreated

SAM session successfully created with an ephemeral destination.

Fields

§b32_address: String

The b32 address of our I2P destination.

§

I2pError

I2P error (SAM bridge unreachable, tunnel failure, etc.)

Fields

§message: String

Error description.

§

SslTorrentError

SSL/TLS error for an SSL torrent (handshake failure, cert validation, etc.).

Fields

§info_hash: Id20

Info hash of the affected SSL torrent.

§message: String

Error description.

§

SessionStatsAlert

Session-level statistics counters snapshot (one value per metric).

Fields

§values: Vec<i64>

Counter values indexed by MetricKind ordinal.

§

ExternalIpDetected

An external IP address was detected or updated (e.g. from tracker/NAT/DHT).

Fields

§ip: IpAddr

The detected external IP address.

§

SettingsChanged

Session settings were changed via apply_settings().

Implementations§

Source§

impl AlertKind

Source

pub fn category(&self) -> AlertCategory

Returns the category bitmask for this alert kind.

Trait Implementations§

Source§

impl Clone for AlertKind

Source§

fn clone(&self) -> AlertKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for AlertKind

Source§

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

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

impl<'de> Deserialize<'de> for AlertKind

Source§

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

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

impl Serialize for AlertKind

Source§

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

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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