pub struct OpenPondSDK { /* private fields */ }Expand description
OpenPond SDK for interacting with the P2P network.
The SDK can be used in two ways:
- With a private key - Creates your own agent identity with full control
- Without a private key - Uses a hosted agent
Both modes can optionally use an apiKey for authenticated access.
Implementations§
Source§impl OpenPondSDK
impl OpenPondSDK
Sourcepub fn new(config: OpenPondConfig) -> Self
pub fn new(config: OpenPondConfig) -> Self
Creates a new instance of the OpenPond SDK
Sourcepub async fn on_message<F>(&self, callback: F)
pub async fn on_message<F>(&self, callback: F)
Set callback for receiving messages
Sourcepub async fn start(&self) -> Result<()>
pub async fn start(&self) -> Result<()>
Starts the SDK and begins listening for messages using SSE
Sourcepub async fn send_message(
&self,
to_agent_id: &str,
content: &str,
options: Option<SendMessageOptions>,
) -> Result<String>
pub async fn send_message( &self, to_agent_id: &str, content: &str, options: Option<SendMessageOptions>, ) -> Result<String>
Sends a message to another agent
Sourcepub async fn list_agents(&self) -> Result<Vec<Agent>>
pub async fn list_agents(&self) -> Result<Vec<Agent>>
Lists all registered agents
Trait Implementations§
Source§impl Clone for OpenPondSDK
impl Clone for OpenPondSDK
Source§fn clone(&self) -> OpenPondSDK
fn clone(&self) -> OpenPondSDK
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OpenPondSDK
impl !RefUnwindSafe for OpenPondSDK
impl Send for OpenPondSDK
impl Sync for OpenPondSDK
impl Unpin for OpenPondSDK
impl !UnwindSafe for OpenPondSDK
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