5 releases

new 0.1.4 Apr 24, 2024
0.1.3 Apr 15, 2024
0.1.2 Mar 25, 2024
0.1.1 Mar 25, 2024
0.1.0 Mar 24, 2024

#869 in Filesystem

Download history 81/week @ 2024-03-18 281/week @ 2024-03-25 55/week @ 2024-04-01 145/week @ 2024-04-15

562 downloads per month
Used in 4 crates

MIT license

39KB
919 lines

rList VFS library

Basically, it is used to implement the driver for rList and get the Whell as the server state.

How to implement a driver

Step 1: Define the driver struct

First, define the configuration struct, like this:

#[derive(Debug, Deserialize)]
pub struct OnedriveConfig {
    /// The refresh token for the onedrive account.
    /// *For further information, please refer to the official documentation of Microsoft OAuth 2.0 authorization flow.*
    pub refresh_token: String,

    /// The client id for the application.
    /// You can get it from the Azure portal with the client secret.
    pub client_id: String,

    /// The client secret for the application.
    /// You can get it from the Azure portal with the client id.
    pub client_secret: String,
}

You should make sure that the struct can be loaded from the config file.

Besides, you should make sure that there is no driver_name field in the configuration struct, because it is preserved for identifying the driver.

Don't worry about the driver_name field. If you add it into the config struct, there should be a compile error.

Dependencies

~5–13MB
~129K SLoC