pub struct S3PathBuf { /* private fields */ }Expand description
An owned S3 storage path.
Implementations§
Source§impl S3PathBuf
impl S3PathBuf
pub fn new() -> Self
pub fn try_from<C: Into<Cow<'static, str>>, I: IntoIterator<Item = C>>( components: I, ) -> Result<Self, InvalidS3PathComponent>
pub fn try_from_str( string: impl AsRef<str>, ) -> Result<Self, InvalidS3PathComponent>
pub fn join( &mut self, component: impl Into<Cow<'static, str>>, ) -> Result<&mut Self, InvalidS3PathComponent>
pub fn as_path(&self) -> &S3Path<'_>
Methods from Deref<Target = S3Path<'static>>§
Sourcepub fn join<C: Into<Cow<'static, str>>>(
&self,
component: C,
) -> Result<S3PathBuf, InvalidS3PathComponent>
pub fn join<C: Into<Cow<'static, str>>>( &self, component: C, ) -> Result<S3PathBuf, InvalidS3PathComponent>
Converts to an owned S3PathBuf and tries to append component.
Sourcepub fn components(&'i self) -> impl Iterator<Item = &'i str>
pub fn components(&'i self) -> impl Iterator<Item = &'i str>
Returns an iterator over the components of this path.
Sourcepub fn get(&'i self, index: usize) -> Option<&'i str>
pub fn get(&'i self, index: usize) -> Option<&'i str>
Returns the component at the given index, or None if the index is out of bounds.
Sourcepub fn last(&'i self) -> Option<&'i str>
pub fn last(&'i self) -> Option<&'i str>
Returns the last component of this path, or None if the path is empty.
Sourcepub fn parent(&'i self) -> Option<&'i S3Path<'i>>
pub fn parent(&'i self) -> Option<&'i S3Path<'i>>
Returns all but the last component of this path, or None if the path is empty.
Sourcepub fn to_std_path_buf(&self) -> PathBuf
pub fn to_std_path_buf(&self) -> PathBuf
Convert this S3 path to a std::path::PathBuf, allowing you to use this S3 path as a
system file path.
Our strong guarantee that path components only consist of ascii alphanumeric characters, ‘-’, ‘_’ and ‘.’ and that no path traversal components (‘.’ and ‘..’) are allowed, makes this a safe operation.
Trait Implementations§
impl Eq for S3PathBuf
impl StructuralPartialEq for S3PathBuf
Auto Trait Implementations§
impl Freeze for S3PathBuf
impl RefUnwindSafe for S3PathBuf
impl Send for S3PathBuf
impl Sync for S3PathBuf
impl Unpin for S3PathBuf
impl UnwindSafe for S3PathBuf
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