pub struct MirrorArgs {
pub mirror: String,
pub replay: String,
}
Expand description
Convenience cli arguments for setting up a transport with an optional mirror or replay file.
The mirror
argument will write the stdin to the file.
The replay
argument will read the file as input.
§Example
The example below shows the typical usage of the MirrorArgs
struct.
It records an LSP or DAP session and replays it to compare the output.
If the language server has stable output, the replayed output should be the same.
$ my-lsp --mirror /tmp/mirror.log > responses.txt
$ ls /tmp
mirror.log
$ my-lsp --replay /tmp/mirror.log > responses-replayed.txt
$ diff responses.txt responses-replayed.txt
Fields§
§mirror: String
Mirror the stdin to the file
replay: String
Replay input from the file
Trait Implementations§
Source§impl Args for MirrorArgs
impl Args for MirrorArgs
Source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
Report the [
ArgGroup::id
][crate::ArgGroup::id] for this set of argumentsSource§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Append to [
Command
] so it can instantiate self
via
[FromArgMatches::update_from_arg_matches_mut
] Read moreSource§impl Clone for MirrorArgs
impl Clone for MirrorArgs
Source§fn clone(&self) -> MirrorArgs
fn clone(&self) -> MirrorArgs
Returns a copy 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 CommandFactory for MirrorArgs
impl CommandFactory for MirrorArgs
Source§impl Debug for MirrorArgs
impl Debug for MirrorArgs
Source§impl Default for MirrorArgs
impl Default for MirrorArgs
Source§fn default() -> MirrorArgs
fn default() -> MirrorArgs
Returns the “default value” for a type. Read more
Source§impl FromArgMatches for MirrorArgs
impl FromArgMatches for MirrorArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches
to self
.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches
to self
.Source§impl Parser for MirrorArgs
impl Parser for MirrorArgs
§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Parse from iterator, [exit][Error::exit] on error.
§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Parse from iterator, return Err on error.
§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Update from iterator, [exit][Error::exit] on error. Read more
§fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
Update from iterator, return Err on error.
Auto Trait Implementations§
impl Freeze for MirrorArgs
impl RefUnwindSafe for MirrorArgs
impl Send for MirrorArgs
impl Sync for MirrorArgs
impl Unpin for MirrorArgs
impl UnwindSafe for MirrorArgs
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