pub struct RemoteMachine {
pub host: String,
pub user: Option<String>,
pub port: Option<u16>,
pub identity_file: Option<PathBuf>,
pub freenet_binary: Option<PathBuf>,
pub work_dir: Option<PathBuf>,
}Expand description
Configuration for a remote Linux machine accessible via SSH
Fields§
§host: StringSSH hostname or IP address
user: Option<String>SSH username (defaults to current user if None)
port: Option<u16>SSH port (defaults to 22 if None)
identity_file: Option<PathBuf>Path to SSH identity file (private key)
freenet_binary: Option<PathBuf>Path to freenet binary on remote machine (if pre-installed) If None, binary will be deployed via SCP
work_dir: Option<PathBuf>Working directory for peer data on remote machine Defaults to /tmp/freenet-test-network if None
Implementations§
Source§impl RemoteMachine
impl RemoteMachine
Sourcepub fn identity_file(self, path: impl Into<PathBuf>) -> Self
pub fn identity_file(self, path: impl Into<PathBuf>) -> Self
Set the SSH identity file path
Sourcepub fn freenet_binary(self, path: impl Into<PathBuf>) -> Self
pub fn freenet_binary(self, path: impl Into<PathBuf>) -> Self
Set the remote freenet binary path
Sourcepub fn remote_work_dir(&self) -> PathBuf
pub fn remote_work_dir(&self) -> PathBuf
Get the remote work directory
Sourcepub fn exec(&self, command: &str) -> Result<String>
pub fn exec(&self, command: &str) -> Result<String>
Execute a command on the remote machine and return output
Sourcepub fn scp_upload(&self, local_path: &Path, remote_path: &str) -> Result<()>
pub fn scp_upload(&self, local_path: &Path, remote_path: &str) -> Result<()>
Copy a local file to the remote machine via SCP
Sourcepub fn scp_download(&self, remote_path: &str, local_path: &Path) -> Result<()>
pub fn scp_download(&self, remote_path: &str, local_path: &Path) -> Result<()>
Copy a remote file to the local machine via SCP
Sourcepub fn discover_public_address(&self) -> Result<String>
pub fn discover_public_address(&self) -> Result<String>
Discover the public IP address of the remote machine
Trait Implementations§
Source§impl Clone for RemoteMachine
impl Clone for RemoteMachine
Source§fn clone(&self) -> RemoteMachine
fn clone(&self) -> RemoteMachine
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 moreAuto Trait Implementations§
impl Freeze for RemoteMachine
impl RefUnwindSafe for RemoteMachine
impl Send for RemoteMachine
impl Sync for RemoteMachine
impl Unpin for RemoteMachine
impl UnwindSafe for RemoteMachine
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