pub struct SchemaRegistryClient { /* private fields */ }Expand description
Client for interacting with the Danube Schema Registry.
Obtained via [DanubeClient::schema()]. Provides methods for registering,
retrieving, and managing schemas in the centralized schema registry.
Follows the same connection pattern as other Danube services — a fresh gRPC
connection is obtained from the shared ConnectionManager on each call.
Implementations§
Source§impl SchemaRegistryClient
impl SchemaRegistryClient
Sourcepub fn register_schema(
&self,
subject: impl Into<String>,
) -> SchemaRegistrationBuilder<'_>
pub fn register_schema( &self, subject: impl Into<String>, ) -> SchemaRegistrationBuilder<'_>
Register a new schema or get existing schema ID.
Returns a builder for configuring schema registration.
Sourcepub async fn get_schema_by_id(&self, schema_id: u64) -> Result<SchemaInfo>
pub async fn get_schema_by_id(&self, schema_id: u64) -> Result<SchemaInfo>
Get schema by ID.
Returns schema information for the given schema ID. Schema ID identifies a subject (not a specific version).
Sourcepub async fn get_schema_version(
&self,
schema_id: u64,
version: Option<u32>,
) -> Result<SchemaInfo>
pub async fn get_schema_version( &self, schema_id: u64, version: Option<u32>, ) -> Result<SchemaInfo>
Get specific schema version.
Returns schema information for a specific version of a schema subject.
Sourcepub async fn get_latest_schema(
&self,
subject: impl Into<String>,
) -> Result<SchemaInfo>
pub async fn get_latest_schema( &self, subject: impl Into<String>, ) -> Result<SchemaInfo>
Get latest schema for a subject.
Returns the latest schema version for the given subject.
Sourcepub async fn check_compatibility(
&self,
subject: impl Into<String>,
schema_data: Vec<u8>,
schema_type: SchemaType,
mode: Option<CompatibilityMode>,
) -> Result<CheckCompatibilityResponse>
pub async fn check_compatibility( &self, subject: impl Into<String>, schema_data: Vec<u8>, schema_type: SchemaType, mode: Option<CompatibilityMode>, ) -> Result<CheckCompatibilityResponse>
Check if a schema is compatible with existing versions.
§Arguments
subject- Schema subject nameschema_data- Raw schema contentschema_type- Schema type (Avro, JsonSchema, Protobuf)mode- Optional compatibility mode override (uses subject’s default if None)
Sourcepub async fn set_compatibility_mode(
&self,
subject: impl Into<String>,
mode: CompatibilityMode,
) -> Result<SetCompatibilityModeResponse>
pub async fn set_compatibility_mode( &self, subject: impl Into<String>, mode: CompatibilityMode, ) -> Result<SetCompatibilityModeResponse>
Set compatibility mode for a subject.
§Arguments
subject- Schema subject namemode- Compatibility mode to set
Trait Implementations§
Source§impl Clone for SchemaRegistryClient
impl Clone for SchemaRegistryClient
Source§fn clone(&self) -> SchemaRegistryClient
fn clone(&self) -> SchemaRegistryClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for SchemaRegistryClient
impl !RefUnwindSafe for SchemaRegistryClient
impl Send for SchemaRegistryClient
impl Sync for SchemaRegistryClient
impl Unpin for SchemaRegistryClient
impl !UnwindSafe for SchemaRegistryClient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request