pub struct FieldSchema { /* private fields */ }Expand description
Immutable schema for one catalog-owned context field.
Schemas define the external name, value shape, visibility, and text bound. Their fields and constructor are private so callers can inspect catalog policy but cannot create or alter it.
ⓘ
use rocketmq_error::{ContextVisibility, FieldSchema, FieldValueKind};
let _ = FieldSchema {
name: "external_name",
visibility: ContextVisibility::Public,
value_kind: FieldValueKind::Text,
text_byte_limit: Some(64),
};ⓘ
use rocketmq_error::{ContextVisibility, FieldSchema, FieldValueKind};
let _ = FieldSchema::try_new(
"external_name",
ContextVisibility::Public,
FieldValueKind::Text,
Some(64),
);Implementations§
Source§impl FieldSchema
impl FieldSchema
Sourcepub const fn visibility(self) -> ContextVisibility
pub const fn visibility(self) -> ContextVisibility
Returns the visibility policy for this field.
Sourcepub const fn value_kind(self) -> FieldValueKind
pub const fn value_kind(self) -> FieldValueKind
Returns the field’s closed value shape.
Sourcepub const fn text_byte_limit(self) -> Option<usize>
pub const fn text_byte_limit(self) -> Option<usize>
Returns the maximum retained text size in bytes.
Non-text fields always return None.
Trait Implementations§
Source§impl Clone for FieldSchema
impl Clone for FieldSchema
impl Copy for FieldSchema
Source§impl Debug for FieldSchema
impl Debug for FieldSchema
impl Eq for FieldSchema
Source§impl Hash for FieldSchema
impl Hash for FieldSchema
Source§impl Ord for FieldSchema
impl Ord for FieldSchema
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for FieldSchema
impl PartialEq for FieldSchema
Source§impl PartialOrd for FieldSchema
impl PartialOrd for FieldSchema
impl StructuralPartialEq for FieldSchema
Auto Trait Implementations§
impl Freeze for FieldSchema
impl RefUnwindSafe for FieldSchema
impl Send for FieldSchema
impl Sync for FieldSchema
impl Unpin for FieldSchema
impl UnsafeUnpin for FieldSchema
impl UnwindSafe for FieldSchema
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