pub struct Node {
pub location: Location,
pub id: String,
}Available on crate feature
dns only.Expand description
A Fly.io machine with an ID and region.
Node represents a result returned from querying the vms.<app>.internal
TXT record, as AppResolver::nodes does.
use flytrap::{Node, Region};
let result = "148e21dad76789 sea,4d89699c030518 ams,6e82de14c35038 sin";
let nodes: Vec<Node> = result.split(',').filter_map(|n| n.parse().ok()).collect();
assert_eq!(
&nodes,
&[
Node::new(Region::Seattle, "148e21dad76789"),
Node::new(Region::Amsterdam, "4d89699c030518"),
Node::new(Region::Singapore, "6e82de14c35038")
]
);Fields§
§location: Location§id: StringImplementations§
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
impl Eq 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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.