pub struct ServiceDefinition { /* private fields */ }Expand description
Representation of a comma-separated service definition string.
Implementations§
Source§impl ServiceDefinition
impl ServiceDefinition
Sourcepub fn parse(input: &str) -> Result<Self, String>
pub fn parse(input: &str) -> Result<Self, String>
Parse a string like "tcp/80, udp/53, tcp/1000-1005" into tokens.
Sourcepub fn tokens(&self) -> &[ServiceToken]
pub fn tokens(&self) -> &[ServiceToken]
Return the parsed tokens.
Sourcepub fn iter(&self) -> impl Iterator<Item = &ServiceToken>
pub fn iter(&self) -> impl Iterator<Item = &ServiceToken>
Iterate over tokens.
Sourcepub fn expand(&self) -> Vec<TransportService>
pub fn expand(&self) -> Vec<TransportService>
Expand all tokens into explicit TransportService values.
Ranges will produce one element per port in the span, while aliases and single entries retain their normalized representation.
Trait Implementations§
Source§impl Clone for ServiceDefinition
impl Clone for ServiceDefinition
Source§fn clone(&self) -> ServiceDefinition
fn clone(&self) -> ServiceDefinition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServiceDefinition
impl Debug for ServiceDefinition
Source§impl FromStr for ServiceDefinition
impl FromStr for ServiceDefinition
Source§impl PartialEq for ServiceDefinition
impl PartialEq for ServiceDefinition
impl Eq for ServiceDefinition
impl StructuralPartialEq for ServiceDefinition
Auto Trait Implementations§
impl Freeze for ServiceDefinition
impl RefUnwindSafe for ServiceDefinition
impl Send for ServiceDefinition
impl Sync for ServiceDefinition
impl Unpin for ServiceDefinition
impl UnwindSafe for ServiceDefinition
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