pub struct SchemaRegistrationBuilder<'a> { /* private fields */ }Expand description
Builder for schema registration with fluent API.
§Example
use danube_client::{DanubeClient, SchemaType};
let client = DanubeClient::builder()
.service_url("http://localhost:6650")
.build()
.await?;
let schema_id = client.schema()
.register_schema("user-events-value")
.with_type(SchemaType::Avro)
.with_schema_data(avro_schema_bytes)
.execute()
.await?;§Schema Versioning
The registry automatically handles versioning:
- If the schema definition is new, a new version is created
- If the schema definition already exists, the existing schema_id and version are returned
- Compatibility checks are performed based on the subject’s compatibility mode
Implementations§
Source§impl<'a> SchemaRegistrationBuilder<'a>
impl<'a> SchemaRegistrationBuilder<'a>
Sourcepub fn with_type(self, schema_type: SchemaType) -> Self
pub fn with_type(self, schema_type: SchemaType) -> Self
Set the schema type
Sourcepub fn with_schema_data(self, data: impl Into<Vec<u8>>) -> Self
pub fn with_schema_data(self, data: impl Into<Vec<u8>>) -> Self
Set the schema data (raw schema content)
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set an optional description for the schema
Sourcepub fn with_created_by(self, created_by: impl Into<String>) -> Self
pub fn with_created_by(self, created_by: impl Into<String>) -> Self
Set who created the schema (defaults to “danube-client”)
Set tags for the schema
Auto Trait Implementations§
impl<'a> Freeze for SchemaRegistrationBuilder<'a>
impl<'a> !RefUnwindSafe for SchemaRegistrationBuilder<'a>
impl<'a> Send for SchemaRegistrationBuilder<'a>
impl<'a> Sync for SchemaRegistrationBuilder<'a>
impl<'a> Unpin for SchemaRegistrationBuilder<'a>
impl<'a> !UnwindSafe for SchemaRegistrationBuilder<'a>
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> 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