Skip to content

Commit

Permalink
[#69] Fix broken links in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
elfenpiff committed Jan 5, 2024
1 parent 29af9c4 commit f2934a0
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 38 deletions.
4 changes: 2 additions & 2 deletions iceoryx2/src/port/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ use crate::service;
///
/// Can be set with:
///
/// * [`publisher::Publisher::set_degration_callback()`]
/// * [`subscriber::Subscriber::set_degration_callback()`]
/// * [`publisher_impl::PublisherImpl::set_degration_callback()`]
/// * [`subscriber_impl::SubscriberImpl::set_degration_callback()`]
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub enum DegrationAction {
/// Ignore the degration completely
Expand Down
18 changes: 9 additions & 9 deletions iceoryx2/src/port/publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ impl std::fmt::Display for PublisherCreateError {

impl std::error::Error for PublisherCreateError {}

/// Defines a failure that can occur in [`Publisher::loan()`] and [`Publisher::loan_uninit()`] or is part of [`SendCopyError`]
/// emitted in [`Publisher::send_copy()`].
/// Defines a failure that can occur in [`PublisherLoan::loan()`] and [`Publisher::loan_uninit()`]
/// or is part of [`PublisherSendError`] emitted in [`Publisher::send_copy()`].
#[derive(Debug, PartialEq, Eq, Copy, Clone, Hash)]
pub enum PublisherLoanError {
OutOfMemory,
Expand Down Expand Up @@ -112,7 +112,7 @@ pub(crate) mod internal {
pub trait Publisher<MessageType: Debug> {
/// Explicitly updates all connections to the [`crate::port::subscriber::Subscriber`]s. This is
/// required to be called whenever a new [`crate::port::subscriber::Subscriber`] connected to
/// the service. It is done implicitly whenever [`Publisher::send()`] or [`Publisher::send_copy()`]
/// the service. It is done implicitly whenever [`crate::sample_mut::SampleMut::send()`] or [`Publisher::send_copy()`]
/// is called.
/// When a [`crate::port::subscriber::Subscriber`] is connected that requires a history this
/// call will deliver it.
Expand Down Expand Up @@ -143,9 +143,9 @@ pub trait Publisher<MessageType: Debug> {
/// ```
fn update_connections(&self) -> Result<(), ZeroCopyCreationError>;

/// Copies the input `value` into a [`SampleMut`] and delivers it.
/// Copies the input `value` into a [`crate::sample_mut::SampleMut`] and delivers it.
/// On success it returns the number of [`crate::port::subscriber::Subscriber`]s that received
/// the data, otherwise a [`SendCopyError`] describing the failure.
/// the data, otherwise a [`PublisherSendError`] describing the failure.
///
/// # Example
///
Expand All @@ -166,10 +166,10 @@ pub trait Publisher<MessageType: Debug> {
/// ```
fn send_copy(&self, value: MessageType) -> Result<usize, PublisherSendError>;

/// Loans/allocates a [`SampleMut`] from the underlying data segment of the [`Publisher`].
/// Loans/allocates a [`crate::sample_mut::SampleMut`] from the underlying data segment of the [`Publisher`].
/// The user has to initialize the payload before it can be sent.
///
/// On failure it returns [`LoanError`] describing the failure.
/// On failure it returns [`PublisherLoanError`] describing the failure.
///
/// # Example
///
Expand Down Expand Up @@ -200,11 +200,11 @@ pub trait Publisher<MessageType: Debug> {
/// Interface of the sending endpoint of a publish-subscriber based communication that
/// provides a `PublisherLoan::loan()` to create default initialized samples.
pub trait PublisherLoan<MessageType: Debug + Default>: Publisher<MessageType> {
/// Loans/allocates a [`SampleMut`] from the underlying data segment of the [`Publisher`]
/// Loans/allocates a [`crate::sample_mut::SampleMut`] from the underlying data segment of the [`Publisher`]
/// and initialize it with the default value. This can be a performance hit and [`Publisher::loan_uninit`]
/// can be used to loan a [`core::mem::MaybeUninit<MessageType>`].
///
/// On failure it returns [`LoanError`] describing the failure.
/// On failure it returns [`PublisherLoanError`] describing the failure.
///
/// # Example
///
Expand Down
2 changes: 1 addition & 1 deletion iceoryx2/src/port/publisher_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
//! # }
//! ```
//!
//! See also, [`Publisher`]
//! See also, [`crate::port::publisher::Publisher`]
use std::cell::UnsafeCell;
use std::fmt::Debug;
Expand Down
2 changes: 1 addition & 1 deletion iceoryx2/src/port/subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub(crate) mod internal {

/// The interface of the receiving endpoint of a publish-subscribe communication.
pub trait Subscriber<MessageType: Debug> {
/// Receives a [`Sample`] from [`crate::port::publisher::Publisher`]. If no sample could be
/// Receives a [`crate::sample::Sample`] from [`crate::port::publisher::Publisher`]. If no sample could be
/// received [`None`] is returned. If a failure occurs [`SubscriberReceiveError`] is returned.
fn receive<'subscriber>(
&'subscriber self,
Expand Down
5 changes: 3 additions & 2 deletions iceoryx2/src/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@
use crate::service::header::publish_subscribe::Header;

/// It stores the payload and is acquired by the [`Subscriber`] whenever it receives new data from a
/// [`crate::port::publisher::Publisher`] via [`Subscriber::receive()`].
/// It stores the payload and is acquired by the [`crate::port::subscriber::Subscriber`] whenever
/// it receives new data from a [`crate::port::publisher::Publisher`] via
/// [`crate::port::subscriber::Subscriber::receive()`].
pub trait Sample<MessageType> {
/// Returns a reference to the payload of the sample
fn payload(&self) -> &MessageType;
Expand Down
5 changes: 3 additions & 2 deletions iceoryx2/src/sample_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ use crate::port::subscriber::internal::SubscriberMgmt;
use crate::service::header::publish_subscribe::Header;
use crate::{raw_sample::RawSample, sample::Sample};

/// It stores the payload and is acquired by the [`Subscriber`] whenever it receives new data from a
/// [`crate::port::publisher::Publisher`] via [`Subscriber::receive()`].
/// It stores the payload and is acquired by the [`crate::port::subscriber::Subscriber`] whenever
/// it receives new data from a [`crate::port::publisher::Publisher`] via
/// [`crate::port::subscriber::Subscriber::receive()`].
#[derive(Debug)]
pub struct SampleImpl<'subscriber, MessageType: Debug> {
pub(crate) subscriber: &'subscriber dyn SubscriberMgmt,
Expand Down
12 changes: 8 additions & 4 deletions iceoryx2/src/sample_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ pub(crate) mod internal {
}
}

/// Acquired by a [`Publisher`] via [`Publisher::loan()`]. It stores the payload that will be sent
/// Acquired by a [`crate::port::publisher::Publisher`] via
/// [`crate::port::publisher::PublisherLoan::loan()`]. It stores the payload that will be sent
/// to all connected [`crate::port::subscriber::Subscriber`]s. If the [`SampleMut`] is not sent
/// it will release the loaned memory when going out of scope.
pub trait SampleMut<MessageType>: internal::SampleMgmt {
Expand Down Expand Up @@ -136,18 +137,21 @@ pub trait SampleMut<MessageType>: internal::SampleMgmt {
/// ```
fn payload_mut(&mut self) -> &mut MessageType;

/// Send a previously loaned [`PublisherLoan::loan_uninit()`] or [`Publisher::loan()`] [`SampleMut`] to all connected
/// Send a previously loaned [`crate::port::publisher::Publisher::loan_uninit()`] or
/// [`crate::port::publisher::PublisherLoan::loan()`] [`SampleMut`] to all connected
/// [`crate::port::subscriber::Subscriber`]s of the service.
///
/// The payload of the [`SampleMut`] must be initialized before it can be sent. Have a look
/// at [`SampleMut::write_payload()`] and [`SampleMut::assume_init()`] for more details.
/// at [`UninitializedSampleMut::write_payload()`] and [`UninitializedSampleMut::assume_init()`]
/// for more details.
///
/// On success the number of [`crate::port::subscriber::Subscriber`]s that received
/// the data is returned, otherwise a [`ZeroCopyCreationError`] describing the failure.
fn send(self) -> Result<usize, ZeroCopyCreationError>;
}

/// Acquired by a [`Publisher`] via [`Publisher::loan_uninit()`]. It stores the payload that will be sent
/// Acquired by a [`crate::port::publisher::Publisher`] via
/// [`crate::port::publisher::Publisher::loan_uninit()`]. It stores the payload that will be sent
/// to all connected [`crate::port::subscriber::Subscriber`]s. If the [`SampleMut`] is not sent
/// it will release the loaned memory when going out of scope.
///
Expand Down
10 changes: 6 additions & 4 deletions iceoryx2/src/sample_mut_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
//! # }
//! ```
//!
//! See also, [`SampleMut`].
//! See also, [`crate::sample_mut::SampleMut`].
use crate::{
port::publisher::internal::PublisherMgmt,
Expand All @@ -45,14 +45,16 @@ use crate::{
use iceoryx2_cal::shared_memory::*;
use std::{fmt::Debug, mem::MaybeUninit};

/// Acquired by a [`Publisher`] via [`Publisher::loan()`] or [`Publisher::loan_uninit()`]. It stores the payload that will be sent
/// Acquired by a [`crate::port::publisher::Publisher`] via
/// [`crate::port::publisher::PublisherLoan::loan()`] or
/// [`crate::port::publisher::Publisher::loan_uninit()`]. It stores the payload that will be sent
/// to all connected [`crate::port::subscriber::Subscriber`]s. If the [`SampleMut`] is not sent
/// it will release the loaned memory when going out of scope.
///
/// # Notes
///
/// Does not implement [`Send`] since it releases unsent samples in the [`Publisher`] and the
/// [`Publisher`] is not thread-safe!
/// Does not implement [`Send`] since it releases unsent samples in the [`crate::port::publisher::Publisher`] and the
/// [`crate::port::publisher::Publisher`] is not thread-safe!
///
/// The generic parameter `M` is either a `MessageType` or a [`core::mem::MaybeUninit<MessageType>`], depending
/// which API is used to obtain the sample.
Expand Down
4 changes: 2 additions & 2 deletions iceoryx2/src/service/port_factory/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use crate::service;

use super::event::PortFactory;

/// Factory to create a new [`Listener`] port/endpoint for
/// Factory to create a new [`ListenerImpl`] port/endpoint for
/// [`MessagingPattern::Event`](crate::service::messaging_pattern::MessagingPattern::Event) based
/// communication.
#[derive(Debug)]
Expand All @@ -45,7 +45,7 @@ pub struct PortFactoryListener<'factory, 'config, Service: service::Details<'con
impl<'factory, 'config, Service: service::Details<'config>>
PortFactoryListener<'factory, 'config, Service>
{
/// Creates the [`Listener`] port or returns a [`ListenerCreateError`] on failure.
/// Creates the [`ListenerImpl`] port or returns a [`ListenerCreateError`] on failure.
pub fn create(&self) -> Result<ListenerImpl<'factory, 'config, Service>, ListenerCreateError> {
Ok(
fail!(from self, when ListenerImpl::new(&self.factory.service),
Expand Down
7 changes: 4 additions & 3 deletions iceoryx2/src/service/port_factory/notifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use crate::service;

use super::event::PortFactory;

/// Factory to create a new [`Notifier`] port/endpoint for
/// Factory to create a new [`NotifierImpl`] port/endpoint for
/// [`MessagingPattern::Event`](crate::service::messaging_pattern::MessagingPattern::Event) based
/// communication.
#[derive(Debug)]
Expand All @@ -56,13 +56,14 @@ impl<'factory, 'config, Service: service::Details<'config>>
}
}

/// Sets a default [`EventId`] for the [`Notifier`] that is used in [`Notifier::notify()`]
/// Sets a default [`EventId`] for the [`NotifierImpl`] that is used in
/// [`crate::port::notifier::Notifier::notify()`]
pub fn default_event_id(mut self, value: EventId) -> Self {
self.default_event_id = value;
self
}

/// Creates a new [`Notifier`] port or returns a [`NotifierCreateError`] on failure.
/// Creates a new [`NotifierImpl`] port or returns a [`NotifierCreateError`] on failure.
pub fn create(&self) -> Result<NotifierImpl<'factory, 'config, Service>, NotifierCreateError> {
Ok(
fail!(from self, when NotifierImpl::new(&self.factory.service, self.default_event_id),
Expand Down
14 changes: 8 additions & 6 deletions iceoryx2/src/service/port_factory/publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ use serde::{de::Visitor, Deserialize, Serialize};
use super::publish_subscribe::PortFactory;
use crate::{port::publisher::PublisherCreateError, port::publisher_impl::PublisherImpl, service};

/// Defines the strategy the [`Publisher`] shall pursue in [`Publisher::send()`] or
/// [`Publisher::send_copy()`] when the buffer of a
/// Defines the strategy the [`PublisherImpl`] shall pursue in
/// [`crate::sample_mut::SampleMut::send()`] or
/// [`crate::port::publisher::Publisher::send_copy()`] when the buffer of a
/// [`crate::port::subscriber::Subscriber`] is full and the service does not overflow.
#[derive(Debug, Eq, PartialEq, Clone, Copy)]
pub enum UnableToDeliverStrategy {
Expand Down Expand Up @@ -98,7 +99,7 @@ pub(crate) struct LocalPublisherConfig {
pub(crate) unable_to_deliver_strategy: UnableToDeliverStrategy,
}

/// Factory to create a new [`Publisher`] port/endpoint for
/// Factory to create a new [`PublisherImpl`] port/endpoint for
/// [`MessagingPattern::PublishSubscribe`](crate::service::messaging_pattern::MessagingPattern::PublishSubscribe) based
/// communication.
#[derive(Debug)]
Expand Down Expand Up @@ -137,8 +138,9 @@ impl<'factory, 'config, Service: service::Details<'config>, MessageType: Debug>
}
}

/// Defines how many [`crate::sample_mut::SampleMut`] the [`Publisher`] can loan with
/// [`Publisher::loan()`] or [`Publisher::loan_uninit()`] in parallel.
/// Defines how many [`crate::sample_mut::SampleMut`] the [`PublisherImpl`] can loan with
/// [`crate::port::publisher::PublisherLoan::loan()`] or
/// [`crate::port::publisher::Publisher::loan_uninit()`] in parallel.
pub fn max_loaned_samples(mut self, value: usize) -> Self {
self.config.max_loaned_samples = value;
self
Expand All @@ -150,7 +152,7 @@ impl<'factory, 'config, Service: service::Details<'config>, MessageType: Debug>
self
}

/// Creates a new [`Publisher`] or returns a [`PublisherCreateError`] on failure.
/// Creates a new [`PublisherImpl`] or returns a [`PublisherCreateError`] on failure.
pub fn create(
self,
) -> Result<PublisherImpl<'factory, 'config, Service, MessageType>, PublisherCreateError> {
Expand Down
4 changes: 2 additions & 2 deletions iceoryx2/src/service/port_factory/subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use crate::{

use super::publish_subscribe::PortFactory;

/// Factory to create a new [`Subscriber`] port/endpoint for
/// Factory to create a new [`SubscriberImpl`] port/endpoint for
/// [`MessagingPattern::PublishSubscribe`](crate::service::messaging_pattern::MessagingPattern::PublishSubscribe) based
/// communication.
#[derive(Debug)]
Expand All @@ -55,7 +55,7 @@ pub struct PortFactorySubscriber<
impl<'factory, 'config, Service: service::Details<'config>, MessageType: Debug>
PortFactorySubscriber<'factory, 'config, Service, MessageType>
{
/// Creates a new [`Subscriber`] or returns a [`SubscriberCreateError`] on failure.
/// Creates a new [`SubscriberImpl`] or returns a [`SubscriberCreateError`] on failure.
pub fn create(
&self,
) -> Result<SubscriberImpl<'factory, 'config, Service, MessageType>, SubscriberCreateError>
Expand Down

0 comments on commit f2934a0

Please sign in to comment.