Struct urbit_http_api::graph::NodeContents[][src]

pub struct NodeContents {
    pub content_list: Vec<JsonValue>,
}

Struct which represents the contents inside of a node

Fields

content_list: Vec<JsonValue>

Implementations

impl NodeContents[src]

Methods for NodeContents

pub fn new() -> NodeContents[src]

Create a new empty NodeContents

pub fn is_empty(&self) -> bool[src]

Check if NodeContents is empty

pub fn add_text(&self, text: &str) -> NodeContents[src]

Appends text to the end of the list of contents

pub fn add_url(&self, url: &str) -> NodeContents[src]

Appends a url to the end of the list of contents

pub fn add_mention(&self, referenced_ship: &str) -> NodeContents[src]

Appends a mention to another @p/ship to the end of the list of contents

pub fn add_code(&self, expression: &str, output: &str) -> NodeContents[src]

Appends a code block to the end of the list of contents

pub fn from_json(json_contents: Vec<JsonValue>) -> NodeContents[src]

Create a NodeContents from a list of JsonValues

pub fn to_json(&self) -> JsonValue[src]

Convert the NodeContents into a json array in a JsonValue

pub fn to_formatted_string(&self) -> String[src]

Convert the NodeContents into a single String that is formatted for human reading.

pub fn to_formatted_words(&self) -> Vec<String>[src]

Converts the NodeContents into a String that is formatted for human reading, which is then split at every whitespace. Useful for parsing a message.

Trait Implementations

impl Clone for NodeContents[src]

impl Debug for NodeContents[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,