Struct remotefs_aws_s3::client::AwsS3Fs
source · pub struct AwsS3Fs { /* private fields */ }
Expand description
Aws s3 file system client
Implementations§
source§impl AwsS3Fs
impl AwsS3Fs
sourcepub fn endpoint<S: AsRef<str>>(self, endpoint: S) -> Self
pub fn endpoint<S: AsRef<str>>(self, endpoint: S) -> Self
Specify custom endpoint
This should be used when trying to connect to minio
or other API compatible endpoints.
sourcepub fn profile<S: AsRef<str>>(self, profile: S) -> Self
pub fn profile<S: AsRef<str>>(self, profile: S) -> Self
Set aws profile. If unset, “default” will be used
sourcepub fn new_path_style(self, new_path_style: bool) -> Self
pub fn new_path_style(self, new_path_style: bool) -> Self
Set whether to use new path style. Required for backends such as MinIO (Default: False)
sourcepub fn access_key<S: AsRef<str>>(self, key: S) -> Self
pub fn access_key<S: AsRef<str>>(self, key: S) -> Self
Specify access key for aws connection.
If unset, will be read from environment variable AWS_ACCESS_KEY_ID
sourcepub fn secret_access_key<S: AsRef<str>>(self, key: S) -> Self
pub fn secret_access_key<S: AsRef<str>>(self, key: S) -> Self
Specify secret access key for aws connection.
If unset, will be read from environment variable AWS_SECRET_ACCESS_KEY
sourcepub fn security_token<S: AsRef<str>>(self, key: S) -> Self
pub fn security_token<S: AsRef<str>>(self, key: S) -> Self
Specify security token for aws connection.
If unset, will be read from environment variable AWS_SECURITY_TOKEN
sourcepub fn session_token<S: AsRef<str>>(self, key: S) -> Self
pub fn session_token<S: AsRef<str>>(self, key: S) -> Self
Specify session token for aws connection.
If unset, will be read from environment variable AWS_SESSION_TOKEN
Trait Implementations§
source§impl RemoteFs for AwsS3Fs
impl RemoteFs for AwsS3Fs
source§fn connect(&mut self) -> RemoteResult<Welcome>
fn connect(&mut self) -> RemoteResult<Welcome>
Connect to the remote server and authenticate.
Can return banner / welcome message on success.
If client has already established connection, then
AlreadyConnected
error is returned.source§fn disconnect(&mut self) -> RemoteResult<()>
fn disconnect(&mut self) -> RemoteResult<()>
Disconnect from the remote server
source§fn is_connected(&mut self) -> bool
fn is_connected(&mut self) -> bool
Gets whether the client is connected to remote
source§fn pwd(&mut self) -> RemoteResult<PathBuf>
fn pwd(&mut self) -> RemoteResult<PathBuf>
Get working directory
source§fn change_dir(&mut self, dir: &Path) -> RemoteResult<PathBuf>
fn change_dir(&mut self, dir: &Path) -> RemoteResult<PathBuf>
Change working directory.
Returns the realpath of new directory
source§fn list_dir(&mut self, path: &Path) -> RemoteResult<Vec<File>>
fn list_dir(&mut self, path: &Path) -> RemoteResult<Vec<File>>
List directory entries at specified
path
source§fn stat(&mut self, path: &Path) -> RemoteResult<File>
fn stat(&mut self, path: &Path) -> RemoteResult<File>
Stat file at specified
path
and return Entrysource§fn setstat(&mut self, _path: &Path, _metadata: Metadata) -> RemoteResult<()>
fn setstat(&mut self, _path: &Path, _metadata: Metadata) -> RemoteResult<()>
Set metadata for file at specifieed
path
source§fn exists(&mut self, path: &Path) -> RemoteResult<bool>
fn exists(&mut self, path: &Path) -> RemoteResult<bool>
Returns whether file at specified
path
exists.source§fn remove_file(&mut self, path: &Path) -> RemoteResult<()>
fn remove_file(&mut self, path: &Path) -> RemoteResult<()>
Remove file at specified
path
.
Fails if is not a file or doesn’t existsource§fn remove_dir(&mut self, path: &Path) -> RemoteResult<()>
fn remove_dir(&mut self, path: &Path) -> RemoteResult<()>
Remove directory at specified
path
Directory is removed only if emptysource§fn remove_dir_all(&mut self, path: &Path) -> RemoteResult<()>
fn remove_dir_all(&mut self, path: &Path) -> RemoteResult<()>
Removes a directory at this path, after removing all its contents. Use carefully! Read more
source§fn create_dir(&mut self, path: &Path, _mode: UnixPex) -> RemoteResult<()>
fn create_dir(&mut self, path: &Path, _mode: UnixPex) -> RemoteResult<()>
Create a directory at
path
with specified mode.source§fn symlink(&mut self, _path: &Path, _target: &Path) -> RemoteResult<()>
fn symlink(&mut self, _path: &Path, _target: &Path) -> RemoteResult<()>
Create a symlink at
path
pointing at target
source§fn mov(&mut self, _src: &Path, _dest: &Path) -> RemoteResult<()>
fn mov(&mut self, _src: &Path, _dest: &Path) -> RemoteResult<()>
move file/directory from
src
to dest
source§fn exec(&mut self, _cmd: &str) -> RemoteResult<(u32, String)>
fn exec(&mut self, _cmd: &str) -> RemoteResult<(u32, String)>
Execute a command on remote host if supported by host.
Returns command exit code and output (stdout)
source§fn append(
&mut self,
_path: &Path,
_metadata: &Metadata
) -> RemoteResult<WriteStream>
fn append( &mut self, _path: &Path, _metadata: &Metadata ) -> RemoteResult<WriteStream>
Open file at
path
for appending data.
If the file doesn’t exist, the file is created. Read moresource§fn create(
&mut self,
_path: &Path,
_metadata: &Metadata
) -> RemoteResult<WriteStream>
fn create( &mut self, _path: &Path, _metadata: &Metadata ) -> RemoteResult<WriteStream>
Create file at path for write.
If the file already exists, its content will be overwritten Read more
source§fn open(&mut self, _path: &Path) -> RemoteResult<ReadStream>
fn open(&mut self, _path: &Path) -> RemoteResult<ReadStream>
Open file at specified path for read.
source§fn create_file(
&mut self,
path: &Path,
metadata: &Metadata,
reader: Box<dyn Read>
) -> RemoteResult<u64>
fn create_file( &mut self, path: &Path, metadata: &Metadata, reader: Box<dyn Read> ) -> RemoteResult<u64>
Blocking implementation of
create
This method SHOULD be implemented ONLY when streams are not supported by the current file transfer.
The developer using the client should FIRST try with create
followed by on_written
If the function returns error of kind UnsupportedFeature
, then he should call this function.
In case of success, returns the amount of bytes written to the remote file Read moresource§fn open_file(
&mut self,
src: &Path,
dest: Box<dyn Write + Send>
) -> RemoteResult<u64>
fn open_file( &mut self, src: &Path, dest: Box<dyn Write + Send> ) -> RemoteResult<u64>
Blocking implementation of
open
This method SHOULD be implemented ONLY when streams are not supported by the current file transfer.
(since it would work thanks to the default implementation)
The developer using the client should FIRST try with open
followed by on_sent
If the function returns error of kind UnsupportedFeature
, then he should call this function.
In case of success, returns the amount of bytes written to the local stream Read moresource§fn on_written(&mut self, _writable: WriteStream) -> Result<(), RemoteError>
fn on_written(&mut self, _writable: WriteStream) -> Result<(), RemoteError>
Finalize
create_file
and append_file
methods.
This method must be implemented only if necessary; in case you don’t need it, just return Ok(())
The purpose of this method is to finalize the connection with the peer when writing data.
This is necessary for some protocols such as FTP.
You must call this method each time you want to finalize the write of the remote file. Read moresource§fn on_read(&mut self, _readable: ReadStream) -> Result<(), RemoteError>
fn on_read(&mut self, _readable: ReadStream) -> Result<(), RemoteError>
Finalize
open_file
method.
This method must be implemented only if necessary; in case you don’t need it, just return Ok(())
The purpose of this method is to finalize the connection with the peer when reading data.
This mighe be necessary for some protocols.
You must call this method each time you want to finalize the read of the remote file. Read moresource§fn append_file(
&mut self,
path: &Path,
metadata: &Metadata,
reader: Box<dyn Read>
) -> Result<u64, RemoteError>
fn append_file( &mut self, path: &Path, metadata: &Metadata, reader: Box<dyn Read> ) -> Result<u64, RemoteError>
Blocking implementation of
append
This method SHOULD be implemented ONLY when streams are not supported by the current file transfer.
The developer using the client should FIRST try with create
followed by on_written
If the function returns error of kind UnsupportedFeature
, then he should call this function.
In case of success, returns the amount of bytes written to the remote file Read moresource§fn find(&mut self, search: &str) -> Result<Vec<File>, RemoteError>
fn find(&mut self, search: &str) -> Result<Vec<File>, RemoteError>
Find files from current directory (in all subdirectories) whose name matches the provided search
Search supports wildcards (‘?’, ‘*’)
source§fn iter_search(
&mut self,
dir: &Path,
filter: &WildMatchPattern<'*', '?'>
) -> Result<Vec<File>, RemoteError>
fn iter_search( &mut self, dir: &Path, filter: &WildMatchPattern<'*', '?'> ) -> Result<Vec<File>, RemoteError>
Search recursively in
dir
for file matching the wildcard. Read moreAuto Trait Implementations§
impl RefUnwindSafe for AwsS3Fs
impl Send for AwsS3Fs
impl Sync for AwsS3Fs
impl Unpin for AwsS3Fs
impl UnwindSafe for AwsS3Fs
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