pub struct Node {
pub metadata: MetaData,
pub resources: Resources,
pub node_api: Endpoint,
pub nic_api: Endpoint,
pub status: NodeStatus,
}Fields§
§metadata: MetaData§resources: ResourcesTotal amount of computational resources offered by the Node
node_api: EndpointEndpoint of the Node API
nic_api: EndpointEndpoint of the SmartNIC API
status: NodeStatusLatest status of the node. Does not need to be specified by the user when creating (POST), as it is initialized with the default values.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Node
impl<'de> Deserialize<'de> for Node
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 Ord for Node
impl Ord for Node
Source§impl PartialOrd for Node
impl PartialOrd for Node
Source§impl SclObject for Node
impl SclObject for Node
Source§fn api_endpoint<'a>(
_sc: impl Into<Option<&'a str>>,
name: impl Into<Option<&'a str>>,
) -> String
fn api_endpoint<'a>( _sc: impl Into<Option<&'a str>>, name: impl Into<Option<&'a str>>, ) -> String
Overrides the default implementation of the SclObject trait to ignore the sc argument
when constructing API endpoints.
§Examples
use scl_lib::api_objects::{Node, SclObject};
assert_eq!(Node::api_endpoint(None, "node-01"), "/nodes/node-01");
assert_eq!(Node::api_endpoint(None, "node-01"), Node::api_endpoint("node-01", "node-01"));
assert_eq!(Node::api_endpoint("node-01", None), Node::api_endpoint(None, None));
assert_eq!(Node::api_endpoint(None, None), Node::PREFIX);Source§fn db_key<'a>(
_sc: impl Into<Option<&'a str>>,
name: impl Into<Option<&'a str>>,
) -> String
fn db_key<'a>( _sc: impl Into<Option<&'a str>>, name: impl Into<Option<&'a str>>, ) -> String
Overrides the default implementation of the SclObject trait to use either the sc or the
name argument for DB key construction.
§Examples
use scl_lib::api_objects::{Node, SclObject};
assert_eq!(Node::db_key(None, "node-01"), "/nodes/node-01");
assert_eq!(Node::db_key(None, "node-01"), Node::db_key("node-01", "node-01"));
assert_eq!(Node::db_key("node-01", None), Node::db_key(None, None));
assert_eq!(Node::db_key(None, None), Node::PREFIX);Source§fn metadata(&self) -> &MetaData
fn metadata(&self) -> &MetaData
Providing access to
MetaData is essential for our optimistic concurrency control.Source§fn metadata_mut(&mut self) -> &mut MetaData
fn metadata_mut(&mut self) -> &mut MetaData
Providing access to
MetaData is essential for our optimistic concurrency control.Source§fn referenced_db_keys(&self) -> Vec<String>
fn referenced_db_keys(&self) -> Vec<String>
Returns all DB keys the object is referencing / depending on.
Source§fn validate_fields_before_create(&self) -> Result<()>
fn validate_fields_before_create(&self) -> Result<()>
Checks if all fields (except references to other SclObjects) are legal initial fields.
Should be called before a create operation.
Source§fn validate_fields_before_update(
current_db_state: &Self,
proposed_new_state: &Self,
) -> Result<()>
fn validate_fields_before_update( current_db_state: &Self, proposed_new_state: &Self, ) -> Result<()>
Checks if a proposed updated is valid. Should be called before a regular (not
related to finalizers / deletion) update operation.
fn uuid(&self) -> Uuid
Source§fn separation_context(&self) -> Option<&SclName>
fn separation_context(&self) -> Option<&SclName>
Returns the
SclName of the separation context if the SclObject is connected to one,
otherwise default None.impl Eq for Node
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnwindSafe for Node
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key and return true if they are equal.