Skip to main content

SmbFs

Struct SmbFs 

Source
pub struct SmbFs { /* private fields */ }
Expand description

Address of a Samba share.

§Examples

use rsmount::device::SmbFs;

fn main() -> rsmount::Result<()> {
   let host = "samba.server.internal";
   let share = "/shared";

   // smb://samba.server.internal/shared
   let address = format!("smb://{host}{share}");
   let smbfs = SmbFs::try_from(address)?;

   assert_eq!(smbfs.host(), host);
   assert_eq!(smbfs.share(), share);

   Ok(())
}

Implementations§

Source§

impl SmbFs

Source

pub fn host(&self) -> &str

Address of the host server.

Source

pub fn share(&self) -> &str

Name of the shared file/directory.

Trait Implementations§

Source§

impl AsRef<SmbFs> for SmbFs

Source§

fn as_ref(&self) -> &SmbFs

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Debug for SmbFs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SmbFs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for SmbFs

Source§

impl From<SmbFs> for Source

Source§

fn from(share: SmbFs) -> Source

Converts to this type from the input type.
Source§

impl From<SmbFs> for MountSource

Source§

fn from(share: SmbFs) -> MountSource

Converts to this type from the input type.
Source§

impl FromStr for SmbFs

Source§

type Err = ParserError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl PartialEq for SmbFs

Source§

fn eq(&self, other: &SmbFs) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SmbFs

Source§

impl TryFrom<&String> for SmbFs

Source§

type Error = ParserError

The type returned in the event of a conversion error.
Source§

fn try_from(s: &String) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&str> for SmbFs

Source§

type Error = ParserError

The type returned in the event of a conversion error.
Source§

fn try_from(s: &str) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<String> for SmbFs

Source§

type Error = ParserError

The type returned in the event of a conversion error.
Source§

fn try_from(s: String) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl Freeze for SmbFs

§

impl RefUnwindSafe for SmbFs

§

impl Send for SmbFs

§

impl Sync for SmbFs

§

impl Unpin for SmbFs

§

impl UnsafeUnpin for SmbFs

§

impl UnwindSafe for SmbFs

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.