minor improvements in readme examples

This commit is contained in:
glyph 2022-02-16 14:19:00 +02:00
parent 5d82c85944
commit 4b20caa7cf
1 changed files with 5 additions and 7 deletions

View File

@ -20,8 +20,7 @@ Development efforts are currently oriented towards
Golgi offers the ability to invoke individual RPC methods while also Golgi offers the ability to invoke individual RPC methods while also
providing a number of convenience methods which may involve multiple RPC providing a number of convenience methods which may involve multiple RPC
calls and / or the processing of data received from those calls. The calls and / or the processing of data received from those calls. The
[`Sbot`](crate::sbot::Sbot) `struct` is the primary means of interacting `Sbot` `struct` is the primary means of interacting with the library.
with the library.
Features include the ability to publish messages of various kinds; to Features include the ability to publish messages of various kinds; to
retrieve messages (e.g. `about` and `description` messages) and formulate retrieve messages (e.g. `about` and `description` messages) and formulate
@ -34,13 +33,12 @@ Basic usage is demonstrated below. Visit the [examples directory](https://git.co
more comprehensive examples. more comprehensive examples.
```rust ```rust
use golgi::GolgiError; use golgi::{GolgiError, Sbot};
use golgi::sbot::Sbot;
pub async fn run() -> Result<(), GolgiError> { pub async fn run() -> Result<(), GolgiError> {
// Attempt to connect to an sbot instance using the default IP address, // Attempt to initialise a connection to an sbot instance using the default
// port and network key (aka. capabilities key). // IP address, port and network key (aka. capabilities key).
let mut sbot_client = Sbot::connect(None, None).await?; let mut sbot_client = Sbot::init(None, None).await?;
// Call the `whoami` RPC method to retrieve the public key for the sbot // Call the `whoami` RPC method to retrieve the public key for the sbot
// identity. // identity.