pub struct DialStringTarget { /* private fields */ }Expand description
Where a dial string is headed: the command carrying it, the block-parser revision of the switch reading it, and the split cutting that command’s arguments.
Implementations§
Source§impl DialStringTarget
impl DialStringTarget
Sourcepub fn new(carrier: DialStringCarrier) -> Self
pub fn new(carrier: DialStringCarrier) -> Self
Target carrier at the default BlockParse.
Sourcepub fn with_argv_separator(
self,
sep: char,
) -> Result<Self, InvalidArgvSeparator>
pub fn with_argv_separator( self, sep: char, ) -> Result<Self, InvalidArgvSeparator>
Split originate’s arguments on sep, as a line opening with ^^<sep> asks the switch.
The dial string is one argument of that split: rendered, it is escaped once for the split’s cleanup; parsed, that cleanup runs first and a second argument is refused.
Refused: separators the switch splits or unescapes wrongly (space, \, ', lowercase
n r t s, controls, non-ASCII) and, as policy, ^ " , | [ ] { } < > = :, which read as
dial-string grammar or quoting, and every other letter or digit, which reads as part of a word.
A ' separator pairs with the next one as quotes.
Sourcepub fn argv_separator(&self) -> Option<char>
pub fn argv_separator(&self) -> Option<char>
The separator cutting originate’s arguments in place of the blank split.
Sourcepub fn escape_argument<'a>(&self, text: &'a str) -> Option<Cow<'a, str>>
pub fn escape_argument<'a>(&self, text: &'a str) -> Option<Cow<'a, str>>
text escaped as one argument of originate’s split, on blanks or on the
argv_separator, or None at a carrier that splits none.
An empty text is written '', which the split keeps as an argument. On blanks a text
opening ^^ is written after '', since a line opening ^^ names its own separator.
Sourcepub fn with_block_parse(self, block_parse: BlockParse) -> Self
pub fn with_block_parse(self, block_parse: BlockParse) -> Self
Target a switch running block_parse.
Sourcepub fn carrier(&self) -> DialStringCarrier
pub fn carrier(&self) -> DialStringCarrier
The command carrying the dial string.
Sourcepub fn block_parse(&self) -> BlockParse
pub fn block_parse(&self) -> BlockParse
The block-parser revision rendered for.
Trait Implementations§
Source§impl Clone for DialStringTarget
impl Clone for DialStringTarget
impl Copy for DialStringTarget
Source§impl Debug for DialStringTarget
impl Debug for DialStringTarget
impl Eq for DialStringTarget
Source§impl From<DialStringCarrier> for DialStringTarget
impl From<DialStringCarrier> for DialStringTarget
Source§fn from(carrier: DialStringCarrier) -> Self
fn from(carrier: DialStringCarrier) -> Self
Source§impl PartialEq for DialStringTarget
impl PartialEq for DialStringTarget
impl StructuralPartialEq for DialStringTarget
Auto Trait Implementations§
impl Freeze for DialStringTarget
impl RefUnwindSafe for DialStringTarget
impl Send for DialStringTarget
impl Sync for DialStringTarget
impl Unpin for DialStringTarget
impl UnsafeUnpin for DialStringTarget
impl UnwindSafe for DialStringTarget
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.