Available on crate feature
grpcschema only.Expand description
Fetches the protobuf schema of the Synthient gRPC API using gRPC server
reflection. It needs the grpcschema feature.
let schema = synthient::grpcschema::fetch(std::env::var("SYNTHIENT_API_KEY")?).await?;
for file in &schema.descriptor_set.file {
println!("{}", file.name());
}Schema::descriptor_set can be encoded with
prost::Message::encode_to_vec for tools such as grpcurl and buf.
Unless plaintext is set, the connection uses rustls
with the platform’s trusted certificates, whichever TLS feature the HTTP
client uses.
Re-exports§
pub use prost;pub use prost_types;
Structs§
- Fetch
- A schema fetch that runs when awaited. Create one with
fetch. - Schema
- The protobuf schema returned by
fetch. - Schema
Error - A failed schema fetch.
explaindescribes common causes.
Enums§
Constants§
- DEFAULT_
ENDPOINT - The address of the Synthient gRPC API.