pub struct ForesterHttpClient { /* private fields */ }Expand description
the client to the Forester instance of http server It accepts the api and timeout to request
use forester_http::client::ForesterHttpClient;
async fn main() {
let client = ForesterHttpClient::new("http://localhost:10000".to_string());
client.new_trace_event(1, "test".to_string());
}
Implementations§
Source§impl ForesterHttpClient
impl ForesterHttpClient
pub fn new(base: String) -> Self
pub async fn new_with(base: String, timeout: Duration) -> Self
Sourcepub async fn new_trace_event(
&self,
tick: usize,
text: String,
) -> Result<Response, TickError>
pub async fn new_trace_event( &self, tick: usize, text: String, ) -> Result<Response, TickError>
creates a new trace event
Sourcepub async fn print_trace(&self) -> Result<Response, TickError>
pub async fn print_trace(&self) -> Result<Response, TickError>
prints the trace or if the file is big the tail of the trace (last 100 lines)
Sourcepub async fn lock(&self, id: String) -> Result<Response, TickError>
pub async fn lock(&self, id: String) -> Result<Response, TickError>
lock the key in the blackboard
Sourcepub async fn unlock(&self, id: String) -> Result<Response, TickError>
pub async fn unlock(&self, id: String) -> Result<Response, TickError>
unlock the key in the blackboard
Sourcepub async fn locked(&self, id: String) -> Result<Response, TickError>
pub async fn locked(&self, id: String) -> Result<Response, TickError>
check if the key is locked in the blackboard
Sourcepub async fn contains(&self, id: String) -> Result<Response, TickError>
pub async fn contains(&self, id: String) -> Result<Response, TickError>
check if the key is in the blackboard
Sourcepub async fn take(&self, id: String) -> Result<Response, TickError>
pub async fn take(&self, id: String) -> Result<Response, TickError>
take the key from the blackboard.
Auto Trait Implementations§
impl Freeze for ForesterHttpClient
impl RefUnwindSafe for ForesterHttpClient
impl Send for ForesterHttpClient
impl Sync for ForesterHttpClient
impl Unpin for ForesterHttpClient
impl UnwindSafe for ForesterHttpClient
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