diff --git a/iceoryx2/src/payload.rs b/iceoryx2/src/payload.rs deleted file mode 100644 index 5c88ca34a..000000000 --- a/iceoryx2/src/payload.rs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2024 Contributors to the Eclipse Foundation -// -// See the NOTICE file(s) distributed with this work for additional -// information regarding copyright ownership. -// -// This program and the accompanying materials are made available under the -// terms of the Apache Software License 2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license -// which is available at https://opensource.org/licenses/MIT. -// -// SPDX-License-Identifier: Apache-2.0 OR MIT - -//! # Example -//! -//! ``` -//! use iceoryx2::prelude::*; -//! # fn main() -> Result<(), Box> { -//! # let service_name = ServiceName::new("My/Funk/ServiceName")?; -//! # let service = zero_copy::Service::new(&service_name) -//! # .publish_subscribe() -//! # .open_or_create::()?; -//! # let subscriber = service.subscriber().create()?; -//! -//! let mut received_samples: Vec>> = vec![]; -//! -//! while let Some(sample) = subscriber.receive()? { -//! println!("received: {:?}", *sample); -//! println!("header timestamp {:?}, publisher id {:?}", -//! sample.header().time_stamp(), sample.header().publisher_id()); -//! received_samples.push(Box::new(sample)); -//! } -//! -//! # Ok(()) -//! # } -//! ``` -//! -//! See also [`crate::sample::Sample`]. - -use crate::service::header::publish_subscribe::Header; - -/// 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::subscribe::Subscribe::receive()`]. -pub trait Payload { - /// Returns a reference to the payload of the sample - fn payload(&self) -> &MessageType; - - /// Returns a reference to the header of the sample. - fn header(&self) -> &Header; -} diff --git a/iceoryx2/src/port/mod.rs b/iceoryx2/src/port/mod.rs index 66d632719..875ecc1e2 100644 --- a/iceoryx2/src/port/mod.rs +++ b/iceoryx2/src/port/mod.rs @@ -24,8 +24,6 @@ pub mod listener; pub mod notifier; /// Defines port specific unique ids. Used to identify source/destination while communicating. pub mod port_identifiers; -/// The interface of the sending endpoint for publish-subscribe based communication -pub mod publish; /// Sending endpoint (port) for publish-subscribe based communication pub mod publisher; /// Receiving endpoint (port) for publish-subscribe based communication diff --git a/iceoryx2/src/port/publish.rs b/iceoryx2/src/port/publish.rs deleted file mode 100644 index 23c209701..000000000 --- a/iceoryx2/src/port/publish.rs +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) 2024 Contributors to the Eclipse Foundation -// -// See the NOTICE file(s) distributed with this work for additional -// information regarding copyright ownership. -// -// This program and the accompanying materials are made available under the -// terms of the Apache Software License 2.0 which is available at -// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license -// which is available at https://opensource.org/licenses/MIT. -// -// SPDX-License-Identifier: Apache-2.0 OR MIT - -//! # Example -//! -//! ``` -//! use iceoryx2::prelude::*; -//! -//! # fn main() -> Result<(), Box> { -//! # let service_name = ServiceName::new("My/Funk/ServiceName").unwrap(); -//! # -//! let pubsub_ipc = zero_copy::Service::new(&service_name) -//! .publish_subscribe() -//! .open_or_create::()?; -//! -//! let pubsub_local = process_local::Service::new(&service_name) -//! .publish_subscribe() -//! .open_or_create::()?; -//! -//! let mut publishers: Vec>> = vec![]; -//! -//! publishers.push(Box::new(pubsub_ipc.publisher().create()?)); -//! publishers.push(Box::new(pubsub_local.publisher().create()?)); -//! -//! for publisher in publishers { -//! publisher.send_copy(1234); -//! } -//! -//! # Ok(()) -//! # } -//! ``` -//! -//! See also, [`crate::port::publisher::Publisher`]. - -use crate::port::update_connections::UpdateConnections; -use std::{fmt::Debug, mem::MaybeUninit}; - -use iceoryx2_bb_elementary::enum_gen; - -use crate::sample_mut::SampleMut; - -use super::update_connections::ConnectionFailure; - -/// Defines a failure that can occur when a [`Publish`] is created with -/// [`crate::service::port_factory::publisher::PortFactoryPublisher`]. -#[derive(Debug, PartialEq, Eq, Copy, Clone)] -pub enum PublisherCreateError { - ExceedsMaxSupportedPublishers, - UnableToCreateDataSegment, -} - -impl std::fmt::Display for PublisherCreateError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - std::write!(f, "{}::{:?}", std::stringify!(Self), self) - } -} - -impl std::error::Error for PublisherCreateError {} - -/// Defines a failure that can occur in [`DefaultLoan::loan()`] and [`UninitLoan::loan_uninit()`] -/// or is part of [`PublisherSendError`] emitted in [`SendCopy::send_copy()`]. -#[derive(Debug, PartialEq, Eq, Copy, Clone, Hash)] -pub enum PublisherLoanError { - OutOfMemory, - ExceedsMaxLoanedChunks, - InternalFailure, -} - -impl std::fmt::Display for PublisherLoanError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - std::write!(f, "{}::{:?}", std::stringify!(Self), self) - } -} - -impl std::error::Error for PublisherLoanError {} - -enum_gen! { - /// Failure that can be emitted when a [`crate::sample::Sample`] is sent via [`Publisher::send()`]. - PublisherSendError - mapping: - PublisherLoanError to LoanError, - ConnectionFailure to ConnectionError -} - -impl std::fmt::Display for PublisherSendError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - std::write!(f, "{}::{:?}", std::stringify!(Self), self) - } -} - -impl std::error::Error for PublisherSendError {} - -pub(crate) mod internal { - use std::fmt::Debug; - - use iceoryx2_cal::zero_copy_connection::PointerOffset; - - use crate::port::update_connections::ConnectionFailure; - - pub(crate) trait PublishMgmt: Debug { - fn return_loaned_sample(&self, distance_to_chunk: PointerOffset); - fn send_impl(&self, address_to_chunk: usize) -> Result; - } -} - -/// Interface of the sending endpoint of a publish-subscriber based communication. -pub trait Publish: - DefaultLoan + UninitLoan + UpdateConnections + SendCopy -{ -} - -/// Copies the payload into the shared memory and sends it. -pub trait SendCopy { - /// 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 [`PublisherSendError`] describing the failure. - /// - /// # Example - /// - /// ``` - /// use iceoryx2::prelude::*; - /// # fn main() -> Result<(), Box> { - /// # let service_name = ServiceName::new("My/Funk/ServiceName").unwrap(); - /// # - /// # let service = zero_copy::Service::new(&service_name) - /// # .publish_subscribe() - /// # .open_or_create::()?; - /// # - /// # let publisher = service.publisher().create()?; - /// - /// publisher.send_copy(1234)?; - /// # Ok(()) - /// # } - /// ``` - fn send_copy(&self, value: MessageType) -> Result; -} - -/// Allows loaning of uninitialized shared memory that can be used for storing the payload of the message. -pub trait UninitLoan { - /// Loans/allocates a [`crate::sample_mut::SampleMut`] from the underlying data segment of the [`Publish`]er. - /// The user has to initialize the payload before it can be sent. - /// - /// On failure it returns [`PublisherLoanError`] describing the failure. - /// - /// # Example - /// - /// ``` - /// use iceoryx2::prelude::*; - /// # fn main() -> Result<(), Box> { - /// # let service_name = ServiceName::new("My/Funk/ServiceName").unwrap(); - /// # - /// # let service = zero_copy::Service::new(&service_name) - /// # .publish_subscribe() - /// # .open_or_create::()?; - /// # - /// # let publisher = service.publisher().create()?; - /// - /// let sample = publisher.loan_uninit()?; - /// let sample = sample.write_payload(42); // alternatively `sample.payload_mut()` can be use to access the `MaybeUninit` - /// - /// sample.send()?; - /// - /// # Ok(()) - /// # } - /// ``` - fn loan_uninit(&self) -> Result>, PublisherLoanError>; -} - -/// Allows loaning shared memory that can be used for storing the payload of the message. -pub trait DefaultLoan { - /// Loans/allocates a [`crate::sample_mut::SampleMut`] from the underlying data segment of the [`Publish`] - /// and initialize it with the default value. This can be a performance hit and [`UninitLoan::loan_uninit`] - /// can be used to loan a [`core::mem::MaybeUninit`]. - /// - /// On failure it returns [`PublisherLoanError`] describing the failure. - /// - /// # Example - /// - /// ``` - /// use iceoryx2::prelude::*; - /// # fn main() -> Result<(), Box> { - /// # let service_name = ServiceName::new("My/Funk/ServiceName").unwrap(); - /// # - /// # let service = zero_copy::Service::new(&service_name) - /// # .publish_subscribe() - /// # .open_or_create::()?; - /// # - /// # let publisher = service.publisher().create()?; - /// - /// let mut sample = publisher.loan()?; - /// *sample.payload_mut() = 42; - /// - /// sample.send()?; - /// - /// # Ok(()) - /// # } - /// ``` - fn loan(&self) -> Result, PublisherLoanError>; -} diff --git a/iceoryx2/src/port/publisher.rs b/iceoryx2/src/port/publisher.rs index 5be35639a..715984277 100644 --- a/iceoryx2/src/port/publisher.rs +++ b/iceoryx2/src/port/publisher.rs @@ -62,11 +62,6 @@ use std::sync::atomic::{AtomicU64, AtomicUsize, Ordering}; use std::{alloc::Layout, marker::PhantomData, mem::MaybeUninit}; use super::port_identifiers::{UniquePublisherId, UniqueSubscriberId}; -use super::publish::internal::PublishMgmt; -use super::publish::{ - DefaultLoan, Publish, PublisherCreateError, PublisherLoanError, PublisherSendError, SendCopy, - UninitLoan, -}; use crate::message::Message; use crate::payload_mut::{internal::PayloadMgmt, PayloadMut, UninitPayloadMut}; use crate::port::details::subscriber_connections::*; @@ -82,6 +77,7 @@ use crate::service::static_config::publish_subscribe; use crate::{config, sample_mut::SampleMut}; use iceoryx2_bb_container::queue::Queue; use iceoryx2_bb_elementary::allocator::AllocationError; +use iceoryx2_bb_elementary::enum_gen; use iceoryx2_bb_lock_free::mpmc::container::{ContainerHandle, ContainerState}; use iceoryx2_bb_log::{fail, fatal_panic, warn}; use iceoryx2_cal::dynamic_storage::DynamicStorage; @@ -95,6 +91,55 @@ use iceoryx2_cal::zero_copy_connection::{ ZeroCopyConnection, ZeroCopyCreationError, ZeroCopySendError, ZeroCopySender, }; +/// Defines a failure that can occur when a [`Publish`] is created with +/// [`crate::service::port_factory::publisher::PortFactoryPublisher`]. +#[derive(Debug, PartialEq, Eq, Copy, Clone)] +pub enum PublisherCreateError { + ExceedsMaxSupportedPublishers, + UnableToCreateDataSegment, +} + +impl std::fmt::Display for PublisherCreateError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::write!(f, "{}::{:?}", std::stringify!(Self), self) + } +} + +impl std::error::Error for PublisherCreateError {} + +/// Defines a failure that can occur in [`DefaultLoan::loan()`] and [`UninitLoan::loan_uninit()`] +/// or is part of [`PublisherSendError`] emitted in [`SendCopy::send_copy()`]. +#[derive(Debug, PartialEq, Eq, Copy, Clone, Hash)] +pub enum PublisherLoanError { + OutOfMemory, + ExceedsMaxLoanedChunks, + InternalFailure, +} + +impl std::fmt::Display for PublisherLoanError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::write!(f, "{}::{:?}", std::stringify!(Self), self) + } +} + +impl std::error::Error for PublisherLoanError {} + +enum_gen! { + /// Failure that can be emitted when a [`crate::sample::Sample`] is sent via [`Publisher::send()`]. + PublisherSendError + mapping: + PublisherLoanError to LoanError, + ConnectionFailure to ConnectionError +} + +impl std::fmt::Display for PublisherSendError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::write!(f, "{}::{:?}", std::stringify!(Self), self) + } +} + +impl std::error::Error for PublisherSendError {} + #[derive(Debug)] pub(crate) struct DataSegment { sample_reference_counter: Vec, @@ -170,7 +215,7 @@ impl DataSegment { } } - fn return_loaned_sample(&self, distance_to_chunk: PointerOffset) { + pub(crate) fn return_loaned_sample(&self, distance_to_chunk: PointerOffset) { self.release_sample(distance_to_chunk); self.loan_counter.fetch_sub(1, Ordering::Relaxed); } @@ -315,7 +360,7 @@ impl DataSegment { } } - fn send_sample(&self, address_to_chunk: usize) -> Result { + pub(crate) fn send_sample(&self, address_to_chunk: usize) -> Result { fail!(from self, when self.update_connections(), "Unable to send sample since the connections could not be updated."); @@ -327,7 +372,7 @@ impl DataSegment { /// Sending endpoint of a publish-subscriber based communication. #[derive(Debug)] pub struct Publisher { - pub(crate) data_segment: DataSegment, + pub(crate) data_segment: Rc>, dynamic_publisher_handle: ContainerHandle, _phantom_message_type: PhantomData, } @@ -387,7 +432,7 @@ impl Publisher>(), message_type_layout: Layout::new::(), @@ -414,7 +459,7 @@ impl Publisher Publisher Publish - for Publisher -{ -} - -impl UpdateConnections - for Publisher -{ - fn update_connections(&self) -> Result<(), ConnectionFailure> { - self.data_segment.update_connections() - } -} -impl SendCopy - for Publisher -{ - fn send_copy(&self, value: MessageType) -> Result { + /// 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 [`PublisherSendError`] describing the failure. + /// + /// # Example + /// + /// ``` + /// use iceoryx2::prelude::*; + /// # fn main() -> Result<(), Box> { + /// # let service_name = ServiceName::new("My/Funk/ServiceName").unwrap(); + /// # + /// # let service = zero_copy::Service::new(&service_name) + /// # .publish_subscribe() + /// # .open_or_create::()?; + /// # + /// # let publisher = service.publisher().create()?; + /// + /// publisher.send_copy(1234)?; + /// # Ok(()) + /// # } + /// ``` + pub fn send_copy(&self, value: MessageType) -> Result { let msg = "Unable to send copy of message"; let mut sample = fail!(from self, when self.loan_uninit(), "{} since the loan of a sample failed.", msg); sample.payload_mut().write(value); Ok( - fail!(from self, when self.send_impl(sample.offset_to_chunk().value()), + fail!(from self, when self.data_segment.send_sample(sample.offset_to_chunk().value()), "{} since the underlying send operation failed.", msg), ) } -} -impl UninitLoan - for Publisher -{ - fn loan_uninit(&self) -> Result>, PublisherLoanError> { + /// Loans/allocates a [`crate::sample_mut::SampleMut`] from the underlying data segment of the [`Publish`]er. + /// The user has to initialize the payload before it can be sent. + /// + /// On failure it returns [`PublisherLoanError`] describing the failure. + /// + /// # Example + /// + /// ``` + /// use iceoryx2::prelude::*; + /// # fn main() -> Result<(), Box> { + /// # let service_name = ServiceName::new("My/Funk/ServiceName").unwrap(); + /// # + /// # let service = zero_copy::Service::new(&service_name) + /// # .publish_subscribe() + /// # .open_or_create::()?; + /// # + /// # let publisher = service.publisher().create()?; + /// + /// let sample = publisher.loan_uninit()?; + /// let sample = sample.write_payload(42); // alternatively `sample.payload_mut()` can be use to access the `MaybeUninit` + /// + /// sample.send()?; + /// + /// # Ok(()) + /// # } + /// ``` + pub fn loan_uninit( + &self, + ) -> Result, Service>, PublisherLoanError> { self.data_segment.retrieve_returned_samples(); let msg = "Unable to loan Sample"; @@ -513,7 +586,7 @@ impl UninitLoan self.data_segment .loan_counter .fetch_add(1, Ordering::Relaxed); - Ok(SampleMut::new(self, sample, chunk.offset)) + Ok(SampleMut::new(&self.data_segment, sample, chunk.offset)) } Err(ShmAllocationError::AllocationError(AllocationError::OutOfMemory)) => { fail!(from self, with PublisherLoanError::OutOfMemory, @@ -531,22 +604,43 @@ impl UninitLoan } } -impl PublishMgmt - for Publisher -{ - fn return_loaned_sample(&self, distance_to_chunk: PointerOffset) { - self.data_segment.return_loaned_sample(distance_to_chunk); - } - - fn send_impl(&self, address_to_chunk: usize) -> Result { - self.data_segment.send_sample(address_to_chunk) +impl Publisher { + /// Loans/allocates a [`crate::sample_mut::SampleMut`] from the underlying data segment of the [`Publish`] + /// and initialize it with the default value. This can be a performance hit and [`UninitLoan::loan_uninit`] + /// can be used to loan a [`core::mem::MaybeUninit`]. + /// + /// On failure it returns [`PublisherLoanError`] describing the failure. + /// + /// # Example + /// + /// ``` + /// use iceoryx2::prelude::*; + /// # fn main() -> Result<(), Box> { + /// # let service_name = ServiceName::new("My/Funk/ServiceName").unwrap(); + /// # + /// # let service = zero_copy::Service::new(&service_name) + /// # .publish_subscribe() + /// # .open_or_create::()?; + /// # + /// # let publisher = service.publisher().create()?; + /// + /// let mut sample = publisher.loan()?; + /// *sample.payload_mut() = 42; + /// + /// sample.send()?; + /// + /// # Ok(()) + /// # } + /// ``` + pub fn loan(&self) -> Result, PublisherLoanError> { + Ok(self.loan_uninit()?.write_payload(MessageType::default())) } } -impl DefaultLoan +impl UpdateConnections for Publisher { - fn loan(&self) -> Result, PublisherLoanError> { - Ok(self.loan_uninit()?.write_payload(MessageType::default())) + fn update_connections(&self) -> Result<(), ConnectionFailure> { + self.data_segment.update_connections() } } diff --git a/iceoryx2/src/prelude.rs b/iceoryx2/src/prelude.rs index 57b85341b..9e23b4e88 100644 --- a/iceoryx2/src/prelude.rs +++ b/iceoryx2/src/prelude.rs @@ -13,8 +13,5 @@ pub use crate::iox2::Iox2; pub use crate::iox2::Iox2Event; pub use crate::payload_mut::{PayloadMut, UninitPayloadMut}; -pub use crate::port::{ - event_id::EventId, publish::DefaultLoan, publish::Publish, publish::SendCopy, - publish::UninitLoan, -}; +pub use crate::port::event_id::EventId; pub use crate::service::{process_local, service_name::ServiceName, zero_copy, Service}; diff --git a/iceoryx2/src/sample_mut.rs b/iceoryx2/src/sample_mut.rs index 8bf415632..ecb8a5fd1 100644 --- a/iceoryx2/src/sample_mut.rs +++ b/iceoryx2/src/sample_mut.rs @@ -38,12 +38,12 @@ use crate::{ payload_mut::{internal::PayloadMgmt, PayloadMut, UninitPayloadMut}, - port::{publish::internal::PublishMgmt, update_connections::ConnectionFailure}, + port::{publisher::DataSegment, update_connections::ConnectionFailure}, raw_sample::RawSampleMut, service::header::publish_subscribe::Header, }; use iceoryx2_cal::shared_memory::*; -use std::{fmt::Debug, mem::MaybeUninit}; +use std::{fmt::Debug, mem::MaybeUninit, rc::Rc}; /// Acquired by a [`crate::port::publisher::Publisher`] via /// [`crate::port::publish::DefaultLoan::loan()`] or @@ -59,62 +59,65 @@ use std::{fmt::Debug, mem::MaybeUninit}; /// The generic parameter `M` is either a `MessageType` or a [`core::mem::MaybeUninit`], depending /// which API is used to obtain the sample. #[derive(Debug)] -pub struct SampleMut<'publisher, M: Debug> { - pub(crate) publisher: &'publisher dyn PublishMgmt, - ptr: RawSampleMut, +pub struct SampleMut { + data_segment: Rc>, + ptr: RawSampleMut, offset_to_chunk: PointerOffset, } -impl Drop for SampleMut<'_, M> { +impl Drop + for SampleMut +{ fn drop(&mut self) { - self.publisher.return_loaned_sample(self.offset_to_chunk); + self.data_segment.return_loaned_sample(self.offset_to_chunk); } } -impl<'publisher, MessageType: Debug> SampleMut<'publisher, MaybeUninit> { +impl + SampleMut, Service> +{ pub(crate) fn new( - publisher: &'publisher dyn PublishMgmt, + data_segment: &Rc>, ptr: RawSampleMut>, offset_to_chunk: PointerOffset, ) -> Self { - // SAFETY: the transmute is not nice but safe since MaybeUninit is #[repr(transparent)} to the inner type - let publisher = unsafe { std::mem::transmute(publisher) }; - Self { - publisher, + data_segment: Rc::clone(data_segment), ptr, offset_to_chunk, } } } -impl<'publisher, MessageType: Debug> PayloadMgmt for SampleMut<'publisher, MessageType> { +impl PayloadMgmt + for SampleMut +{ fn offset_to_chunk(&self) -> PointerOffset { self.offset_to_chunk } } -impl<'publisher, MessageType: Debug> UninitPayloadMut - for SampleMut<'publisher, MaybeUninit> +impl UninitPayloadMut + for SampleMut, Service> { - type InitializedSample = SampleMut<'publisher, MessageType>; + type InitializedSample = SampleMut; - fn write_payload(mut self, value: MessageType) -> SampleMut<'publisher, MessageType> { + fn write_payload(mut self, value: MessageType) -> SampleMut { self.payload_mut().write(value); // SAFETY: this is safe since the payload was initialized on the line above unsafe { self.assume_init() } } - unsafe fn assume_init(self) -> SampleMut<'publisher, MessageType> { + unsafe fn assume_init(self) -> SampleMut { // the transmute is not nice but safe since MaybeUninit is #[repr(transparent)] to the inner type std::mem::transmute(self) } } impl< - 'publisher, M: Debug, // `M` is either a `MessageType` or a `MaybeUninit` - > PayloadMut for SampleMut<'publisher, M> + Service: crate::service::Service, + > PayloadMut for SampleMut { fn header(&self) -> &Header { self.ptr.as_header_ref() @@ -129,6 +132,6 @@ impl< } fn send(self) -> Result { - self.publisher.send_impl(self.offset_to_chunk.value()) + self.data_segment.send_sample(self.offset_to_chunk.value()) } } diff --git a/iceoryx2/src/service/port_factory/publisher.rs b/iceoryx2/src/service/port_factory/publisher.rs index 3703836b7..7ac4cbf93 100644 --- a/iceoryx2/src/service/port_factory/publisher.rs +++ b/iceoryx2/src/service/port_factory/publisher.rs @@ -39,8 +39,8 @@ use super::publish_subscribe::PortFactory; use crate::{ port::{ port_identifiers::{UniquePublisherId, UniqueSubscriberId}, - publish::PublisherCreateError, publisher::Publisher, + publisher::PublisherCreateError, DegrationAction, DegrationCallback, }, service, diff --git a/iceoryx2/tests/publisher_tests.rs b/iceoryx2/tests/publisher_tests.rs index 1836cc27e..ad1ed1c8e 100644 --- a/iceoryx2/tests/publisher_tests.rs +++ b/iceoryx2/tests/publisher_tests.rs @@ -15,7 +15,7 @@ mod publisher { use std::time::{Duration, Instant}; use iceoryx2::payload_mut::UninitPayloadMut; - use iceoryx2::port::publish::PublisherLoanError; + use iceoryx2::port::publisher::PublisherLoanError; use iceoryx2::prelude::*; use iceoryx2::service::port_factory::publisher::UnableToDeliverStrategy; use iceoryx2::service::{service_name::ServiceName, Service}; diff --git a/iceoryx2/tests/service_publish_subscribe_tests.rs b/iceoryx2/tests/service_publish_subscribe_tests.rs index c28e0931b..a20fef6de 100644 --- a/iceoryx2/tests/service_publish_subscribe_tests.rs +++ b/iceoryx2/tests/service_publish_subscribe_tests.rs @@ -13,7 +13,7 @@ #[generic_tests::define] mod service_publish_subscribe { use iceoryx2::config::Config; - use iceoryx2::port::publish::{PublisherCreateError, PublisherLoanError}; + use iceoryx2::port::publisher::{PublisherCreateError, PublisherLoanError}; use iceoryx2::port::subscriber::SubscriberCreateError; use iceoryx2::port::update_connections::UpdateConnections; use iceoryx2::prelude::*;