pub struct SchemaRegistryClient { /* private fields */ }Expand description
Client for interacting with the Danube Schema Registry
Provides methods for registering, retrieving, and managing schemas in the centralized schema registry.
Implementations§
Source§impl SchemaRegistryClient
impl SchemaRegistryClient
Sourcepub async fn new(client: &DanubeClient) -> Result<Self>
pub async fn new(client: &DanubeClient) -> Result<Self>
Create a new SchemaRegistryClient from a DanubeClient
Sourcepub fn register_schema(
&mut self,
subject: impl Into<String>,
) -> SchemaRegistrationBuilder<'_>
pub fn register_schema( &mut 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(&mut self, schema_id: u64) -> Result<SchemaInfo>
pub async fn get_schema_by_id(&mut 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(
&mut self,
schema_id: u64,
version: Option<u32>,
) -> Result<SchemaInfo>
pub async fn get_schema_version( &mut 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(
&mut self,
subject: impl Into<String>,
) -> Result<SchemaInfo>
pub async fn get_latest_schema( &mut 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(
&mut self,
subject: impl Into<String>,
schema_data: Vec<u8>,
schema_type: SchemaType,
mode: Option<CompatibilityMode>,
) -> Result<CheckCompatibilityResponse>
pub async fn check_compatibility( &mut 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(
&mut self,
subject: impl Into<String>,
mode: CompatibilityMode,
) -> Result<SetCompatibilityModeResponse>
pub async fn set_compatibility_mode( &mut self, subject: impl Into<String>, mode: CompatibilityMode, ) -> Result<SetCompatibilityModeResponse>
Trait Implementations§
Source§impl Clone for SchemaRegistryClient
impl Clone for SchemaRegistryClient
Source§fn clone(&self) -> SchemaRegistryClient
fn clone(&self) -> SchemaRegistryClient
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 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
Mutably borrows from an owned value. Read more
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>
Wrap the input message
T in a tonic::Request