mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
docs: fix broken references in documentation comments
This commit is contained in:
@@ -449,7 +449,8 @@ mod tests {
|
|||||||
assert_ne!(keypair0.public, keypair1.public);
|
assert_ne!(keypair0.public, keypair1.public);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// [Key] objects to use in tests.
|
/// [SignedSecretKey] and [SignedPublicKey] objects
|
||||||
|
/// to use in tests.
|
||||||
struct TestKeys {
|
struct TestKeys {
|
||||||
alice_secret: SignedSecretKey,
|
alice_secret: SignedSecretKey,
|
||||||
alice_public: SignedPublicKey,
|
alice_public: SignedPublicKey,
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ use crate::stock_str::StockStrings;
|
|||||||
#[allow(non_upper_case_globals)]
|
#[allow(non_upper_case_globals)]
|
||||||
pub const AVATAR_900x900_BYTES: &[u8] = include_bytes!("../test-data/image/avatar900x900.png");
|
pub const AVATAR_900x900_BYTES: &[u8] = include_bytes!("../test-data/image/avatar900x900.png");
|
||||||
|
|
||||||
/// Map of [`Context::id`] to names for [`TestContext`]s.
|
/// Map of context IDs to names for [`TestContext`]s.
|
||||||
static CONTEXT_NAMES: Lazy<std::sync::RwLock<BTreeMap<u32, String>>> =
|
static CONTEXT_NAMES: Lazy<std::sync::RwLock<BTreeMap<u32, String>>> =
|
||||||
Lazy::new(|| std::sync::RwLock::new(BTreeMap::new()));
|
Lazy::new(|| std::sync::RwLock::new(BTreeMap::new()));
|
||||||
|
|
||||||
@@ -190,6 +190,7 @@ impl TestContextManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Builder for the [TestContext].
|
||||||
#[derive(Debug, Clone, Default)]
|
#[derive(Debug, Clone, Default)]
|
||||||
pub struct TestContextBuilder {
|
pub struct TestContextBuilder {
|
||||||
key_pair: Option<KeyPair>,
|
key_pair: Option<KeyPair>,
|
||||||
@@ -199,21 +200,21 @@ pub struct TestContextBuilder {
|
|||||||
impl TestContextBuilder {
|
impl TestContextBuilder {
|
||||||
/// Configures as alice@example.org with fixed secret key.
|
/// Configures as alice@example.org with fixed secret key.
|
||||||
///
|
///
|
||||||
/// This is a shortcut for `.with_key_pair(alice_keypair()).
|
/// This is a shortcut for `.with_key_pair(alice_keypair())`.
|
||||||
pub fn configure_alice(self) -> Self {
|
pub fn configure_alice(self) -> Self {
|
||||||
self.with_key_pair(alice_keypair())
|
self.with_key_pair(alice_keypair())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Configures as bob@example.net with fixed secret key.
|
/// Configures as bob@example.net with fixed secret key.
|
||||||
///
|
///
|
||||||
/// This is a shortcut for `.with_key_pair(bob_keypair()).
|
/// This is a shortcut for `.with_key_pair(bob_keypair())`.
|
||||||
pub fn configure_bob(self) -> Self {
|
pub fn configure_bob(self) -> Self {
|
||||||
self.with_key_pair(bob_keypair())
|
self.with_key_pair(bob_keypair())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Configures as fiona@example.net with fixed secret key.
|
/// Configures as fiona@example.net with fixed secret key.
|
||||||
///
|
///
|
||||||
/// This is a shortcut for `.with_key_pair(bob_keypair()).
|
/// This is a shortcut for `.with_key_pair(fiona_keypair())`.
|
||||||
pub fn configure_fiona(self) -> Self {
|
pub fn configure_fiona(self) -> Self {
|
||||||
self.with_key_pair(fiona_keypair())
|
self.with_key_pair(fiona_keypair())
|
||||||
}
|
}
|
||||||
@@ -257,13 +258,13 @@ impl TestContextBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A Context and temporary directory.
|
/// A Context and temporary directory.
|
||||||
///
|
|
||||||
/// The temporary directory can be used to store the SQLite database,
|
|
||||||
/// see e.g. [test_context] which does this.
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TestContext {
|
pub struct TestContext {
|
||||||
pub ctx: Context,
|
pub ctx: Context,
|
||||||
|
|
||||||
|
/// Temporary directory used to store SQLite database.
|
||||||
pub dir: TempDir,
|
pub dir: TempDir,
|
||||||
|
|
||||||
pub evtracker: EventTracker,
|
pub evtracker: EventTracker,
|
||||||
/// Channels which should receive events from this context.
|
/// Channels which should receive events from this context.
|
||||||
event_senders: Arc<RwLock<Vec<Sender<Event>>>>,
|
event_senders: Arc<RwLock<Vec<Sender<Event>>>>,
|
||||||
@@ -298,9 +299,7 @@ impl TestContext {
|
|||||||
|
|
||||||
/// Creates a new configured [`TestContext`].
|
/// Creates a new configured [`TestContext`].
|
||||||
///
|
///
|
||||||
/// This is a shortcut which automatically calls [`TestContext::configure_alice`] after
|
/// This is a shortcut which configures alice@example.org with a fixed key.
|
||||||
/// creating the context.
|
|
||||||
/// alice-email: alice@example.org
|
|
||||||
pub async fn new_alice() -> Self {
|
pub async fn new_alice() -> Self {
|
||||||
Self::builder().configure_alice().build().await
|
Self::builder().configure_alice().build().await
|
||||||
}
|
}
|
||||||
@@ -498,7 +497,7 @@ impl TestContext {
|
|||||||
///
|
///
|
||||||
/// Parsing a message does not run the entire receive pipeline, but is not without
|
/// Parsing a message does not run the entire receive pipeline, but is not without
|
||||||
/// side-effects either. E.g. if the message includes autocrypt headers the relevant
|
/// side-effects either. E.g. if the message includes autocrypt headers the relevant
|
||||||
/// peerstates will be updated. Later receiving the message using [recv_msg] is
|
/// peerstates will be updated. Later receiving the message using [Self.recv_msg()] is
|
||||||
/// unlikely to be affected as the peerstate would be processed again in exactly the
|
/// unlikely to be affected as the peerstate would be processed again in exactly the
|
||||||
/// same way.
|
/// same way.
|
||||||
pub(crate) async fn parse_msg(&self, msg: &SentMessage<'_>) -> MimeMessage {
|
pub(crate) async fn parse_msg(&self, msg: &SentMessage<'_>) -> MimeMessage {
|
||||||
|
|||||||
Reference in New Issue
Block a user