pub struct ClassSchema {
pub class_name: String,
pub fields: IndexMap<String, FieldType>,
}Expand description
The shape of one class: what a transform needs to lower or raise a document.
Order-preserving, because _SCHEMA documents are compared in golden files and because the
order fields were added is the order upstream writes them.
Fields§
§class_name: String§fields: IndexMap<String, FieldType>Implementations§
Source§impl ClassSchema
impl ClassSchema
pub fn new(class_name: impl Into<String>) -> Self
pub fn with_field(self, name: impl Into<String>, ty: FieldType) -> Self
pub fn field(&self, name: &str) -> Option<&FieldType>
Sourcepub fn is_pointer_field(&self, name: &str) -> bool
pub fn is_pointer_field(&self, name: &str) -> bool
Is this field stored under a _p_ prefix?
Note the deliberate narrowness: only a declared Pointer field is prefixed. A pointer
value written to a field the schema does not know about is not prefixed by
transformKey, because that function consults the schema and nothing else.
Trait Implementations§
Source§impl Clone for ClassSchema
impl Clone for ClassSchema
Source§fn clone(&self) -> ClassSchema
fn clone(&self) -> ClassSchema
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ClassSchema
impl Debug for ClassSchema
Source§impl Default for ClassSchema
impl Default for ClassSchema
Source§fn default() -> ClassSchema
fn default() -> ClassSchema
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ClassSchema
impl RefUnwindSafe for ClassSchema
impl Send for ClassSchema
impl Sync for ClassSchema
impl Unpin for ClassSchema
impl UnsafeUnpin for ClassSchema
impl UnwindSafe for ClassSchema
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