Struct veilid_core::DHTSchemaDFLT
source · pub struct DHTSchemaDFLT { /* private fields */ }
Expand description
Default DHT Schema (DFLT)
Implementations§
source§impl DHTSchemaDFLT
impl DHTSchemaDFLT
pub const FCC: [u8; 4] = _
pub const FIXED_SIZE: usize = 6usize
sourcepub fn new(o_cnt: u16) -> VeilidAPIResult<Self>
pub fn new(o_cnt: u16) -> VeilidAPIResult<Self>
Make a schema
sourcepub fn validate(&self) -> VeilidAPIResult<()>
pub fn validate(&self) -> VeilidAPIResult<()>
Validate the data representation
sourcepub fn max_subkey(&self) -> ValueSubkey
pub fn max_subkey(&self) -> ValueSubkey
Get the maximum subkey this schema allocates
sourcepub fn data_size(&self) -> usize
pub fn data_size(&self) -> usize
Get the data size of this schema beyond the size of the structure itself
sourcepub fn check_subkey_value_data(
&self,
owner: &PublicKey,
subkey: ValueSubkey,
value_data: &ValueData
) -> bool
pub fn check_subkey_value_data( &self, owner: &PublicKey, subkey: ValueSubkey, value_data: &ValueData ) -> bool
Check a subkey value data against the schema
Trait Implementations§
source§impl Clone for DHTSchemaDFLT
impl Clone for DHTSchemaDFLT
source§fn clone(&self) -> DHTSchemaDFLT
fn clone(&self) -> DHTSchemaDFLT
Returns a copy 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 DHTSchemaDFLT
impl Debug for DHTSchemaDFLT
source§impl<'de> Deserialize<'de> for DHTSchemaDFLT
impl<'de> Deserialize<'de> for DHTSchemaDFLT
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 JsonSchema for DHTSchemaDFLT
impl JsonSchema for DHTSchemaDFLT
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl Ord for DHTSchemaDFLT
impl Ord for DHTSchemaDFLT
source§fn cmp(&self, other: &DHTSchemaDFLT) -> Ordering
fn cmp(&self, other: &DHTSchemaDFLT) -> Ordering
1.21.0 · 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
source§impl PartialEq for DHTSchemaDFLT
impl PartialEq for DHTSchemaDFLT
source§fn eq(&self, other: &DHTSchemaDFLT) -> bool
fn eq(&self, other: &DHTSchemaDFLT) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for DHTSchemaDFLT
impl PartialOrd for DHTSchemaDFLT
source§fn partial_cmp(&self, other: &DHTSchemaDFLT) -> Option<Ordering>
fn partial_cmp(&self, other: &DHTSchemaDFLT) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for DHTSchemaDFLT
impl Serialize for DHTSchemaDFLT
source§impl TryFrom<&[u8]> for DHTSchemaDFLT
impl TryFrom<&[u8]> for DHTSchemaDFLT
impl Eq for DHTSchemaDFLT
impl StructuralPartialEq for DHTSchemaDFLT
Auto Trait Implementations§
impl Freeze for DHTSchemaDFLT
impl RefUnwindSafe for DHTSchemaDFLT
impl Send for DHTSchemaDFLT
impl Sync for DHTSchemaDFLT
impl Unpin for DHTSchemaDFLT
impl UnwindSafe for DHTSchemaDFLT
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