pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
Sourcepub fn new(options: ClientOptions) -> Self
pub fn new(options: ClientOptions) -> Self
Examples found in repository?
examples/basic.rs (lines 4-7)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let client = Client::new(ClientOptions {
5 source: Some("example_rust".to_string()),
6 ..Default::default()
7 });
8
9 client.publish_message(
10 "INFO",
11 "Rust worker started",
12 Some("{\"queue\":\"demo\"}".to_string()),
13 )?;
14 Ok(())
15}Sourcepub fn publish_message(
&self,
level: impl Into<String>,
message: impl Into<String>,
attrs_json: Option<String>,
) -> Result<PublishResult, Error>
pub fn publish_message( &self, level: impl Into<String>, message: impl Into<String>, attrs_json: Option<String>, ) -> Result<PublishResult, Error>
Examples found in repository?
examples/basic.rs (lines 9-13)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let client = Client::new(ClientOptions {
5 source: Some("example_rust".to_string()),
6 ..Default::default()
7 });
8
9 client.publish_message(
10 "INFO",
11 "Rust worker started",
12 Some("{\"queue\":\"demo\"}".to_string()),
13 )?;
14 Ok(())
15}pub fn publish(&self, record: Record) -> Result<PublishResult, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl !UnwindSafe for Client
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