pub struct Subscribe<'a> { /* private fields */ }
Implementations§
Source§impl<'a> Subscribe<'a>
impl<'a> Subscribe<'a>
Sourcepub fn new(request: &'a Request) -> Self
pub fn new(request: &'a Request) -> Self
Deleted default constructor equivalent in Rust
This prevents instantiation without arguments, as Rust does not support = delete
.
Sourcepub fn connect(
&mut self,
url: &str,
connection_options: ConnectionOptions,
) -> Result<(), String>
pub fn connect( &mut self, url: &str, connection_options: ConnectionOptions, ) -> Result<(), String>
Establishes a connection to a specified server URL using the given configuration options.
§Arguments:
url
- The server’s address (e.g., “tcp://127.0.0.1:5555”).connection_options
- The connection settings, including TLS certificate and timeouts.
§Returns:
Ok(())
if the connection is successful.Err(String)
with the error message if the operation fails.
Sourcepub fn disconnect(&mut self) -> Result<(), String>
pub fn disconnect(&mut self) -> Result<(), String>
Disconnects the current connection and frees the associated resources.
§Returns:
Ok(())
if the disconnection is successful.Err(String)
with the error message if the operation fails.
pub fn subscribe<I>(
&mut self,
paths: I,
group_name: &str,
frequency_divider: u32,
) -> Result<ReadOnlySubscription, String>where
I: Parameters,
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Subscribe<'a>
impl<'a> !RefUnwindSafe for Subscribe<'a>
impl<'a> !Send for Subscribe<'a>
impl<'a> !Sync for Subscribe<'a>
impl<'a> Unpin for Subscribe<'a>
impl<'a> !UnwindSafe for Subscribe<'a>
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