src/pxar/fuse.rs: rename from_decoder into new, new into from_path
This commit is contained in:
@ -159,7 +159,7 @@ impl Session {
|
||||
/// default signal handlers.
|
||||
/// Options have to be provided as comma separated OsStr, e.g.
|
||||
/// ("ro,default_permissions").
|
||||
pub fn new(archive_path: &Path, options: &OsStr, verbose: bool) -> Result<Self, Error> {
|
||||
pub fn from_path(archive_path: &Path, options: &OsStr, verbose: bool) -> Result<Self, Error> {
|
||||
let file = File::open(archive_path)?;
|
||||
let args = Self::setup_args(options, verbose)?;
|
||||
let oprs = Self::setup_callbacks();
|
||||
@ -171,6 +171,22 @@ impl Session {
|
||||
Self::setup_session(decoder, args, oprs, verbose)
|
||||
}
|
||||
|
||||
/// Create a new low level fuse session using the given `Decoder`.
|
||||
///
|
||||
/// `Session` is created using the provided mount options and sets the
|
||||
/// default signal handlers.
|
||||
/// Options have to be provided as comma separated OsStr, e.g.
|
||||
/// ("ro,default_permissions").
|
||||
pub fn new(
|
||||
decoder: Decoder,
|
||||
options: &OsStr,
|
||||
verbose: bool,
|
||||
) -> Result<Self, Error> {
|
||||
let args = Self::setup_args(options, verbose)?;
|
||||
let oprs = Self::setup_callbacks();
|
||||
Self::setup_session(decoder, args, oprs, verbose)
|
||||
}
|
||||
|
||||
fn setup_args(options: &OsStr, verbose: bool) -> Result<Vec<CString>, Error> {
|
||||
// First argument should be the executable name
|
||||
let mut arguments = vec![
|
||||
@ -246,22 +262,6 @@ impl Session {
|
||||
})
|
||||
}
|
||||
|
||||
/// Create a new low level fuse session using the given `Decoder`.
|
||||
///
|
||||
/// `Session` is created using the provided mount options and sets the
|
||||
/// default signal handlers.
|
||||
/// Options have to be provided as comma separated OsStr, e.g.
|
||||
/// ("ro,default_permissions").
|
||||
pub fn from_decoder(
|
||||
decoder: Decoder,
|
||||
options: &OsStr,
|
||||
verbose: bool,
|
||||
) -> Result<Self, Error> {
|
||||
let args = Self::setup_args(options, verbose)?;
|
||||
let oprs = Self::setup_callbacks();
|
||||
Self::setup_session(decoder, args, oprs, verbose)
|
||||
}
|
||||
|
||||
/// Mount the filesystem on the given mountpoint.
|
||||
///
|
||||
/// Actually mount the filesystem for this session on the provided mountpoint
|
||||
|
Reference in New Issue
Block a user