Skip to content

Commit

Permalink
Fix rustdoc links
Browse files Browse the repository at this point in the history
  • Loading branch information
asomers committed Oct 5, 2023
1 parent f390c66 commit 2c2e95d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/notification/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub struct EventMeta {
}

/// An listener for [`DataEvent`](crate::notification::DataEvent)s. Implementations can
/// be passed to [`Server::notify_data`](crate::Server::notify_data)
/// be passed to [`ServerBuilder::notify_data`](crate::ServerBuilder::notify_data)
/// in order to receive notifications.
#[async_trait]
pub trait DataListener: Sync + Send + Debug {
Expand All @@ -79,8 +79,8 @@ pub trait DataListener: Sync + Send + Debug {
async fn receive_data_event(&self, e: DataEvent, m: EventMeta);
}

/// An listener for [`PresenceEvent`](crate::notification::PresenceEvent)s. Implementations can
/// be passed to [`Server::notify_presence`](crate::Server::notify_presence)
/// A listener for [`PresenceEvent`](crate::notification::PresenceEvent)s. Implementations can
/// be passed to [`ServerBuilder::notify_presence`](crate::ServerBuilder::notify_presence)
/// in order to receive notifications.
#[async_trait]
pub trait PresenceListener: Sync + Send + Debug {
Expand Down
4 changes: 2 additions & 2 deletions src/notification/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
//! Allows users to listen to events emitted by libunftp.
//!
//! To listen for changes in data implement the [`DataListener`](crate::notification::DataListener)
//! trait and use the [`Server::notify_data`](crate::Server::notify_data) method
//! trait and use the [`ServerBuilder::notify_data`](crate::ServerBuilder::notify_data) method
//! to make libunftp notify it.
//!
//! To listen to logins and logouts implement the [`PresenceListener`](crate::notification::PresenceListener)
//! trait and use the [`Server::notify_presence`](crate::Server::notify_data) method
//! trait and use the [`ServerBuilder::notify_presence`](crate::ServerBuilder::notify_data) method
//! to make libunftp use it.
//!

Expand Down
2 changes: 1 addition & 1 deletion src/server/ftpserver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ where
///
/// Preallocate a socket suitable for servicing the PASV command as received from the given IP
/// address. This method is completely optional, but it is necessary in order to use the
/// [`service`] method when the server is running in capability mode.
/// [`Server::service`] method when the server is running in capability mode.
// In the future, this could be extended to accept multiple invocations, allocating a
// collection of sockets.
pub async fn pasv_listener(self, addr: std::net::IpAddr) -> Self {
Expand Down
22 changes: 12 additions & 10 deletions src/server/ftpserver/options.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Contains code pertaining to the setup options that can be given to the [`Server`](crate::Server)
//! Contains code pertaining to the setup options that can be given to the [`ServerBuilder`](crate::ServerBuilder)

use bitflags::bitflags;
use std::time::Duration;
Expand All @@ -18,7 +18,7 @@ pub(crate) const DEFAULT_PASSIVE_PORTS: Range<u16> = 49152..65535;
pub(crate) const DEFAULT_FTPS_REQUIRE: FtpsRequired = FtpsRequired::None;
pub(crate) const DEFAULT_FTPS_TRUST_STORE: &str = "./trusted.pem";

/// The option to [Server.passive_host](crate::Server::passive_host). It allows the user to specify how the IP address
/// The option to [ServerBuilder::passive_host](crate::ServerBuilder::passive_host). It allows the user to specify how the IP address
/// communicated in the _PASV_ response is determined.
#[derive(Debug, PartialEq, Clone, Default)]
pub enum PassiveHost {
Expand Down Expand Up @@ -57,7 +57,7 @@ impl From<&str> for PassiveHost {
}
}

/// The option to [Server.ftps_required](crate::Server::ftps_required). It allows the user to specify whether clients are required
/// The option to [ServerBuilder::ftps_required](crate::ServerBuilder::ftps_required). It allows the user to specify whether clients are required
/// to upgrade a to secure TLS connection i.e. use FTPS.
#[derive(Debug, PartialEq, Clone, Copy)]
pub enum FtpsRequired {
Expand Down Expand Up @@ -119,7 +119,7 @@ impl Default for TlsFlags {
}
}

/// The option to [Server.ftps_client_auth](crate::Server::ftps_client_auth). Tells if and how mutual TLS (client certificate
/// The option to [ServerBuilder::ftps_client_auth](crate::ServerBuilder::ftps_client_auth). Tells if and how mutual TLS (client certificate
/// authentication) should be handled.
#[derive(Debug, PartialEq, Clone, Copy, Default)]
pub enum FtpsClientAuth {
Expand All @@ -129,11 +129,11 @@ pub enum FtpsClientAuth {
Off,
/// Mutual TLS is on and whilst the server will request a certificate it will still proceed
/// without one. If a certificate is sent by the client it will be validated against the
/// configured trust anchors (see [Server::ftps_trust_store](crate::Server::ftps_trust_store)).
/// configured trust anchors (see [ServerBuilder::ftps_trust_store](crate::ServerBuilder::ftps_trust_store)).
Request,
/// Mutual TLS is on, the server will request a certificate and it won't proceed without a
/// client certificate that validates against the configured trust anchors (see
/// [Server::ftps_trust_store](crate::Server::ftps_trust_store)).
/// [ServerBuilder::ftps_trust_store](crate::ServerBuilder::ftps_trust_store)).
Require,
}

Expand All @@ -148,7 +148,7 @@ impl From<bool> for FtpsClientAuth {
}
}

/// The options for [Server.sitemd5](crate::Server::sitemd5).
/// The options for [ServerBuilder::sitemd5](crate::ServerBuilder::sitemd5).
/// Allow MD5 either to be used by all, logged in users only or no one.
#[derive(Debug, PartialEq, Eq, Clone, Copy, Default)]
pub enum SiteMd5 {
Expand All @@ -162,7 +162,8 @@ pub enum SiteMd5 {
}

/// Tells how graceful shutdown should happen. An instance of this struct should be returned from
/// the future passed to [Server.shutdown_indicator](crate::Server::shutdown_indicator).
/// the future passed to
/// [ServerBuilder::shutdown_indicator](crate::ServerBuilder::shutdown_indicator).
pub struct Shutdown {
pub(crate) grace_period: Duration,
//pub(crate) handle_new_connections: bool,
Expand Down Expand Up @@ -242,8 +243,9 @@ impl Default for FailedLoginsPolicy {
}
}

/// The options for [Server.active_passive_mode](crate::Server::active_passive_mode).
/// This allows to switch active / passive mode on or off.
/// The options for
/// [ServerBuilder::active_passive_mode](crate::ServerBuilder::active_passive_mode). This allows
/// to switch active / passive mode on or off.
#[derive(Debug, PartialEq, Eq, Clone, Copy, Default)]
pub enum ActivePassiveMode {
/// Only passive mode is enabled
Expand Down

0 comments on commit 2c2e95d

Please sign in to comment.