pub struct SchemaContext { /* private fields */ }Expand description
Schema context for multi-tenant isolation
Contexts allow organizing schemas into isolated namespaces, similar to Confluent’s Schema Registry contexts. Each context has its own set of subjects and schemas.
§Examples
use rivven_schema::types::SchemaContext;
// Default context (root)
let default_ctx = SchemaContext::default();
// Tenant-specific context
let tenant_ctx = SchemaContext::new("tenant-123");
// Environment context
let prod_ctx = SchemaContext::new("production");Implementations§
Source§impl SchemaContext
impl SchemaContext
Sourcepub fn default_context() -> Self
pub fn default_context() -> Self
Create the default (root) context
Sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
Check if this is the default context
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the context description
Sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
Get the context description
Sourcepub fn with_active(self, active: bool) -> Self
pub fn with_active(self, active: bool) -> Self
Set the active state
Sourcepub fn qualify_subject(&self, subject: &Subject) -> String
pub fn qualify_subject(&self, subject: &Subject) -> String
Create a fully qualified subject name with context prefix
Format: :.{context}:{subject} (Confluent compatible)
Sourcepub fn parse_qualified(qualified: &str) -> (SchemaContext, Subject)
pub fn parse_qualified(qualified: &str) -> (SchemaContext, Subject)
Parse a qualified subject name into context and subject
Trait Implementations§
Source§impl Clone for SchemaContext
impl Clone for SchemaContext
Source§fn clone(&self) -> SchemaContext
fn clone(&self) -> SchemaContext
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 moreSource§impl Debug for SchemaContext
impl Debug for SchemaContext
Source§impl Default for SchemaContext
impl Default for SchemaContext
Source§impl<'de> Deserialize<'de> for SchemaContext
impl<'de> Deserialize<'de> for SchemaContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for SchemaContext
impl Display for SchemaContext
Source§impl Hash for SchemaContext
impl Hash for SchemaContext
Source§impl PartialEq for SchemaContext
impl PartialEq for SchemaContext
Source§impl Serialize for SchemaContext
impl Serialize for SchemaContext
impl Eq for SchemaContext
impl StructuralPartialEq for SchemaContext
Auto Trait Implementations§
impl Freeze for SchemaContext
impl RefUnwindSafe for SchemaContext
impl Send for SchemaContext
impl Sync for SchemaContext
impl Unpin for SchemaContext
impl UnsafeUnpin for SchemaContext
impl UnwindSafe for SchemaContext
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.