Brain Docs

Reference

Rust SDKInstallationHTTP clientWire client
whoamicapabilitiesping
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Rust SDKIntrospectionping

ping

A connection-level liveness check that works while streams are in flight.

PURPOSE

A connection-level liveness check. It travels on the connection itself rather than as a request stream, so it works while streams are in flight — which is what makes it the right way to keep an idle pooled connection honest.

Handshake credentialstable
async fn ping(&self, client_timestamp_unix_nanos: Option<u64>) -> Result<PongResponse>

Parameters

ParameterTypeRequired
client_timestamp_unix_nanos64-bit integeroptional

Defaults to now, so a call with no argument is the normal one. Compare it against the pong's timestamps to measure round-trip time.

Returns

FieldTypePresence
—PongResponsealways

The server's reply, carrying its own timestamps.

Wire tier only

There is no HTTP ping. The HTTP client holds no connection, so there is nothing to keep alive — use whoami if you want a cheap reachability check over HTTP.

A pooled connection outlives any single request, so a server restart leaves every borrower holding the same dead socket. ping detects that; the pool's health-checking accessor fixes it. See Wire client.

See also
Wire clientwhoami

Was this page helpful?

capabilities

Which optional capabilities are enabled on this shard, and the vector dimension you must match.

Errors

Both taxonomies — the wire BrainError enum with its nine categories and eighty-odd codes, and the HTTP tier's BrainHttpError.

On this page

ParametersReturns
Suggest an editOpen in Playground