Struct veilid_core::DHTSchemaSMPL
source · pub struct DHTSchemaSMPL { /* private fields */ }
Expand description
Simple DHT Schema (SMPL)
Implementations§
source§impl DHTSchemaSMPL
impl DHTSchemaSMPL
pub const FCC: [u8; 4] = _
pub const FIXED_SIZE: usize = 6usize
sourcepub fn new(
o_cnt: u16,
members: Vec<DHTSchemaSMPLMember>
) -> VeilidAPIResult<Self>
pub fn new( o_cnt: u16, members: Vec<DHTSchemaSMPLMember> ) -> VeilidAPIResult<Self>
Make a schema
sourcepub fn validate(&self) -> VeilidAPIResult<()>
pub fn validate(&self) -> VeilidAPIResult<()>
Validate the data representation
sourcepub fn members(&self) -> &[DHTSchemaSMPLMember]
pub fn members(&self) -> &[DHTSchemaSMPLMember]
Get the members of the schema
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 DHTSchemaSMPL
impl Clone for DHTSchemaSMPL
source§fn clone(&self) -> DHTSchemaSMPL
fn clone(&self) -> DHTSchemaSMPL
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 DHTSchemaSMPL
impl Debug for DHTSchemaSMPL
source§impl<'de> Deserialize<'de> for DHTSchemaSMPL
impl<'de> Deserialize<'de> for DHTSchemaSMPL
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 DHTSchemaSMPL
impl JsonSchema for DHTSchemaSMPL
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 DHTSchemaSMPL
impl Ord for DHTSchemaSMPL
source§fn cmp(&self, other: &DHTSchemaSMPL) -> Ordering
fn cmp(&self, other: &DHTSchemaSMPL) -> 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 DHTSchemaSMPL
impl PartialEq for DHTSchemaSMPL
source§fn eq(&self, other: &DHTSchemaSMPL) -> bool
fn eq(&self, other: &DHTSchemaSMPL) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for DHTSchemaSMPL
impl PartialOrd for DHTSchemaSMPL
source§fn partial_cmp(&self, other: &DHTSchemaSMPL) -> Option<Ordering>
fn partial_cmp(&self, other: &DHTSchemaSMPL) -> 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 DHTSchemaSMPL
impl Serialize for DHTSchemaSMPL
source§impl TryFrom<&[u8]> for DHTSchemaSMPL
impl TryFrom<&[u8]> for DHTSchemaSMPL
impl Eq for DHTSchemaSMPL
impl StructuralPartialEq for DHTSchemaSMPL
Auto Trait Implementations§
impl Freeze for DHTSchemaSMPL
impl RefUnwindSafe for DHTSchemaSMPL
impl Send for DHTSchemaSMPL
impl Sync for DHTSchemaSMPL
impl Unpin for DHTSchemaSMPL
impl UnwindSafe for DHTSchemaSMPL
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