pub struct EndpointRecord {
pub allowed: Option<bool>,
pub enabled: Option<bool>,
pub name: String,
}Expand description
Service Endpoint ID (SEID) Record with fields and keys to manage endpoints by cid, role, and eid. Serves as aggregation mechanism for authorization and other functions such as UX naming with regards the endpoint.
The namespace is a tree of branches with each leaf at a specific (cid, role, eid). Retrieval by branch returns groups of leaves as appropriate for a cid branch or cid.role branch. Database Keys are (cid, role, eid) where cid is attributable controller identifier (qb64 prefix) that has role(s) such as watcher, witness etc and eid is the identifier of the controller acting in a role i.e. watcher identifier.
Fields§
§allowed: Option<bool>AuthZ via reply message
Some(true)means eid is allowed as controller of endpoint in roleSome(false)means eid is disallowed as controller of endpoint in roleNonemeans eid is neither allowed or disallowed (no reply msg)
enabled: Option<bool>AuthZ via expose message
Some(true)means eid is enabled as controller of endpoint in roleSome(false)means eid is disabled as controller of endpoint in roleNonemeans eid is neither enabled or disabled (no expose msg)
name: StringOptional user friendly name for eid in role
Implementations§
Source§impl EndpointRecord
impl EndpointRecord
Sourcepub fn with_values(
allowed: Option<bool>,
enabled: Option<bool>,
name: String,
) -> Self
pub fn with_values( allowed: Option<bool>, enabled: Option<bool>, name: String, ) -> Self
Create a new EndpointRecord with specified values
Sourcepub fn is_allowed(&self) -> Option<bool>
pub fn is_allowed(&self) -> Option<bool>
Check if endpoint is allowed (authorized via reply message)
Sourcepub fn is_enabled(&self) -> Option<bool>
pub fn is_enabled(&self) -> Option<bool>
Check if endpoint is enabled (authorized via expose message)
Sourcepub fn set_allowed(&mut self, allowed: bool)
pub fn set_allowed(&mut self, allowed: bool)
Set allowed status (add/cut model)
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Set enabled status
Trait Implementations§
Source§impl Clone for EndpointRecord
impl Clone for EndpointRecord
Source§fn clone(&self) -> EndpointRecord
fn clone(&self) -> EndpointRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EndpointRecord
impl Debug for EndpointRecord
Source§impl Default for EndpointRecord
impl Default for EndpointRecord
Source§impl<'de> Deserialize<'de> for EndpointRecord
impl<'de> Deserialize<'de> for EndpointRecord
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>,
impl Eq for EndpointRecord
Source§impl IntoIterator for EndpointRecord
impl IntoIterator for EndpointRecord
Source§impl PartialEq for EndpointRecord
impl PartialEq for EndpointRecord
Source§impl Serialize for EndpointRecord
impl Serialize for EndpointRecord
impl StructuralPartialEq for EndpointRecord
Auto Trait Implementations§
impl Freeze for EndpointRecord
impl RefUnwindSafe for EndpointRecord
impl Send for EndpointRecord
impl Sync for EndpointRecord
impl Unpin for EndpointRecord
impl UnsafeUnpin for EndpointRecord
impl UnwindSafe for EndpointRecord
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.