pub struct PortUri {
pub scheme: String,
pub authority: String,
pub path: Vec<String>,
pub index: u32,
}Expand description
A structured URI identifying a single channel of a port.
Graph ports use the sim-node://graph/<graph-id>/<node-id>/<port-name>:<index>
form; PortUri::node builds that shape and PortUri::node_id /
PortUri::node_port_name read it back.
Fields§
§scheme: StringURI scheme (for example sim-node).
URI authority (for example graph).
path: Vec<String>Path segments after the authority.
index: u32Channel index within the port.
Implementations§
Source§impl PortUri
impl PortUri
Sourcepub fn new(
scheme: impl Into<String>,
authority: impl Into<String>,
path: Vec<String>,
index: u32,
) -> Result<Self>
pub fn new( scheme: impl Into<String>, authority: impl Into<String>, path: Vec<String>, index: u32, ) -> Result<Self>
Creates and validates a port URI from its parts.
Sourcepub fn node(
graph_id: impl Into<String>,
node_id: impl Into<String>,
port_name: impl Into<String>,
index: u32,
) -> Result<Self>
pub fn node( graph_id: impl Into<String>, node_id: impl Into<String>, port_name: impl Into<String>, index: u32, ) -> Result<Self>
Builds a graph node port URI in the sim-node://graph/... form.
Sourcepub fn node_port_name(&self) -> Option<&str>
pub fn node_port_name(&self) -> Option<&str>
Returns the port name if this is a graph node port URI.
Trait Implementations§
impl Eq for PortUri
Source§impl Ord for PortUri
impl Ord for PortUri
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
Source§impl PartialOrd for PortUri
impl PartialOrd for PortUri
impl StructuralPartialEq for PortUri
Auto Trait Implementations§
impl Freeze for PortUri
impl RefUnwindSafe for PortUri
impl Send for PortUri
impl Sync for PortUri
impl Unpin for PortUri
impl UnsafeUnpin for PortUri
impl UnwindSafe for PortUri
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