pub struct Node {
pub title: String,
pub navigation_hint: String,
pub narrative: String,
pub connections: Vec<Connection>,
}Fields§
§title: String§narrative: String§connections: Vec<Connection>Implementations§
Source§impl Node
impl Node
pub fn new( title: impl Into<String>, navigation_hint: impl Into<String>, narrative: impl Into<String>, connections: Vec<Connection>, ) -> Result<Self>
pub fn from_specs( title: impl Into<String>, navigation_hint: impl Into<String>, narrative: impl Into<String>, specs: Vec<ConnectionSpec>, ) -> Result<Self>
pub fn validate(&self) -> Result<()>
pub fn apply_connection_updates( &mut self, updates: &[ConnectionSpec], ) -> Result<()>
pub fn apply_measurement( &mut self, target: NodeId, useful: bool, importance: MeasurementImportance, ) -> Result<MeasurementOutcome>
pub fn encode(&self) -> Result<Vec<u8>>
pub fn decode(bytes: &[u8]) -> Result<Self>
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
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 UnsafeUnpin 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