pub struct PortRef { /* private fields */ }Expand description
A reference to one input or output port of one node.
§Examples
use astrs_wire::{DataId, NodeId, PortRef};
let port = PortRef::new(NodeId::new("detector")?, DataId::new("boxes")?);
assert_eq!(port.to_string(), "detector/boxes");
assert_eq!("detector/boxes".parse::<PortRef>()?, port);Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PortRef
impl<'de> Deserialize<'de> for PortRef
Source§fn deserialize<D>(
deserializer: D,
) -> Result<PortRef, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<PortRef, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Accepts both the short string form ("camera/image") and the explicit
map form ({"node": "camera", "port": "image"}).
Manifests use the short form; machine-generated JSON tends to use the
map. Accepting both keeps --json output round-trippable without
forcing either style on a human editor.
impl Eq for PortRef
Source§impl FromStr for PortRef
impl FromStr for PortRef
Source§impl Ord for PortRef
impl Ord for PortRef
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for PortRef
impl PartialOrd for PortRef
Source§impl Serialize for PortRef
impl Serialize for PortRef
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for PortRef
Auto Trait Implementations§
impl Freeze for PortRef
impl RefUnwindSafe for PortRef
impl Send for PortRef
impl Sync for PortRef
impl Unpin for PortRef
impl UnsafeUnpin for PortRef
impl UnwindSafe for PortRef
Blanket Implementations§
impl<T> Allocation for T
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