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 PartialEq for Node
impl PartialEq for Node
source§impl PartialOrd for Node
impl PartialOrd for Node
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq for Node
Auto Trait Implementations§
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