pub struct ScpWorker { /* private fields */ }Expand description
Worker that copies files to/from remote nodes via SCP.
Mirrors ClusterShell’s ScpClient / WorkerSsh copy mode.
Implementations§
Source§impl ScpWorker
impl ScpWorker
Sourcepub fn new(
nodes: Vec<String>,
source: String,
dest: String,
fanout: usize,
timeout: Option<Duration>,
ssh_options: SshOptions,
reverse: bool,
preserve: bool,
directory: bool,
) -> Self
pub fn new( nodes: Vec<String>, source: String, dest: String, fanout: usize, timeout: Option<Duration>, ssh_options: SshOptions, reverse: bool, preserve: bool, directory: bool, ) -> Self
Create a new ScpWorker for file copy.
§Arguments
nodes- Remote nodes to copy to/from.source- Source file/directory path.dest- Destination file/directory path.fanout- Max concurrent SCP operations.timeout- Optional per-node timeout.ssh_options- SSH/SCP options.reverse- If true, copy from remote to local.preserve- If true, preserve file attributes.directory- If true, copy recursively.
Sourcepub fn is_reverse(&self) -> bool
pub fn is_reverse(&self) -> bool
Whether this is a reverse copy.
Trait Implementations§
Source§impl Worker for ScpWorker
impl Worker for ScpWorker
Source§fn state(&self) -> WorkerState
fn state(&self) -> WorkerState
Get the worker’s current state.
Source§fn set_handler(&mut self, handler: Box<dyn EventHandler>)
fn set_handler(&mut self, handler: Box<dyn EventHandler>)
Set the event handler for this worker.
Source§fn handle_read(&mut self, fd: RawFd) -> Result<()>
fn handle_read(&mut self, fd: RawFd) -> Result<()>
Handle a read event on the given file descriptor.
Source§fn handle_write(&mut self, fd: RawFd) -> Result<()>
fn handle_write(&mut self, fd: RawFd) -> Result<()>
Handle a write event on the given file descriptor.
Source§fn take_handler(&mut self) -> Option<Box<dyn EventHandler>>
fn take_handler(&mut self) -> Option<Box<dyn EventHandler>>
Take the event handler out of the worker (used by Task to extract gathered data).
Auto Trait Implementations§
impl !RefUnwindSafe for ScpWorker
impl !Sync for ScpWorker
impl !UnwindSafe for ScpWorker
impl Freeze for ScpWorker
impl Send for ScpWorker
impl Unpin for ScpWorker
impl UnsafeUnpin for ScpWorker
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