pub struct Domain { /* private fields */ }Expand description
A communication boundary for DDS publish-subscribe traffic.
Implementations§
Source§impl Domain
impl Domain
Sourcepub fn new(domain_id: u32) -> Result<Self>
pub fn new(domain_id: u32) -> Result<Self>
Creates a new domain with the given domain_id using the default
Cyclone DDS configuration.
§Errors
Returns an Error if Cyclone DDS fails to create the domain, for
example if the domain_id is out of range or already in use.
§Examples
use cyclonedds::Domain;
// Create a default domain.
let default_domain = Domain::default();
// Create a new domain with the domain ID of 1.
let domain = Domain::new(1)?;Sourcepub fn new_with_xml_config(domain_id: u32, config: &str) -> Result<Self>
pub fn new_with_xml_config(domain_id: u32, config: &str) -> Result<Self>
Creates a new domain with the given domain_id and an XML config
string passed directly to Cyclone DDS.
The config must be a valid Cyclone DDS XML configuration fragment. See
the Cyclone DDS
documentation
for the full set of configuration options.
§Errors
Returns an Error if the config contains interior null bytes or if
the domain cannot be created with the provided domain ID and
configuration.
§Examples
use cyclonedds::Domain;
let config = r#"
<Domain>
<Tracing>
<Verbosity>warning</Verbosity>
<OutputFile>stderr</OutputFile>
</Tracing>
</Domain>"#;
// Create a new domain with the configuration and a domain ID of 1.
let domain = Domain::new_with_xml_config(1, config)?;Trait Implementations§
Auto Trait Implementations§
impl Freeze for Domain
impl RefUnwindSafe for Domain
impl Send for Domain
impl Sync for Domain
impl Unpin for Domain
impl UnsafeUnpin for Domain
impl UnwindSafe for Domain
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more