pub struct StructSchema {
pub type_name: String,
pub all_fields: Vec<SchemaFieldInfo>,
pub encrypted_fields: Vec<SchemaFieldInfo>,
pub version: u32,
}Expand description
Schema information for a struct type
Fields§
§type_name: StringType name (e.g., “User”)
all_fields: Vec<SchemaFieldInfo>All fields in struct (including non-encrypted)
encrypted_fields: Vec<SchemaFieldInfo>Only encrypted fields (subset of all_fields)
version: u32Schema version for evolution tracking
Implementations§
Source§impl StructSchema
impl StructSchema
Sourcepub fn add_field(&mut self, field: SchemaFieldInfo)
pub fn add_field(&mut self, field: SchemaFieldInfo)
Add field to schema
Sourcepub fn with_fields(self, fields: Vec<SchemaFieldInfo>) -> Self
pub fn with_fields(self, fields: Vec<SchemaFieldInfo>) -> Self
Add multiple fields
Sourcepub fn with_version(self, version: u32) -> Self
pub fn with_version(self, version: u32) -> Self
Set schema version for evolution tracking
Sourcepub fn get_field(&self, field_name: &str) -> Option<&SchemaFieldInfo>
pub fn get_field(&self, field_name: &str) -> Option<&SchemaFieldInfo>
Get field by name
Sourcepub fn get_encrypted_field(&self, field_name: &str) -> Option<&SchemaFieldInfo>
pub fn get_encrypted_field(&self, field_name: &str) -> Option<&SchemaFieldInfo>
Get encrypted field by name
Sourcepub fn is_field_encrypted(&self, field_name: &str) -> bool
pub fn is_field_encrypted(&self, field_name: &str) -> bool
Check if field is encrypted
Sourcepub fn encrypted_field_names(&self) -> Vec<&str>
pub fn encrypted_field_names(&self) -> Vec<&str>
Get list of encrypted field names
Sourcepub fn nullable_encrypted_fields(&self) -> Vec<&SchemaFieldInfo>
pub fn nullable_encrypted_fields(&self) -> Vec<&SchemaFieldInfo>
Get fields that are marked as nullable
Sourcepub fn fields_for_key(&self, key_ref: &str) -> Vec<&SchemaFieldInfo>
pub fn fields_for_key(&self, key_ref: &str) -> Vec<&SchemaFieldInfo>
Get fields requiring specific encryption key
Sourcepub fn encrypted_field_count(&self) -> usize
pub fn encrypted_field_count(&self) -> usize
Count encrypted fields
Sourcepub fn total_field_count(&self) -> usize
pub fn total_field_count(&self) -> usize
Count total fields
Sourcepub fn validate(&self) -> Result<(), SecretsError>
pub fn validate(&self) -> Result<(), SecretsError>
Validate schema configuration
Trait Implementations§
Source§impl Clone for StructSchema
impl Clone for StructSchema
Source§fn clone(&self) -> StructSchema
fn clone(&self) -> StructSchema
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 StructSchema
impl RefUnwindSafe for StructSchema
impl Send for StructSchema
impl Sync for StructSchema
impl Unpin for StructSchema
impl UnwindSafe for StructSchema
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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