fn controller_available<P>(controller: &str, mount_point: P) -> bool
    where
        P: AsRef<Path>,
    {
        let controller_list_file = mount_point.as_ref().join("cgroup.controllers");
        let f = match File::open(controller_list_file) {
            Ok(f) => f,
            Err(_) => return false,
        };

        for l in BufReader::new(f).lines().flatten() {
            let controllers: Vec<&str> = l.split(' ').collect();
            if controllers.contains(&controller) {
                return true;
            }
        }
        false
    }
// Returns true if the controller is available to be enabled from a
// cgroup path specified by the mount_point parameter
Returns true if the controller is available to be enabled from a
cgroup path specified by the mount_point parameter
Returns true if the controller is available to be enabled from a cgroup path specified by the mount_point parameter
fn controller_available<P>(controller: &str, mount_point: P) -> bool
    where
        P: AsRef<Path>,
    {
        let controller_list_file = mount_point.as_ref().join("cgroup.controllers");
        let f = match File::open(controller_list_file) {
            Ok(f) => f,
            Err(_) => return false,
        };
        for l in BufReader::new(f).lines().flatten() {
            let controllers: Vec<&str> = l.split(' ').collect();
            if controllers.contains(&controller) {
                return true;
            }
        }
        false
    }
fn controller_available < P > ( controller : & str , mount_point : P ) -> bool where P : AsRef < Path > , { let controller_list_file = mount_point . as_ref ( ) . join ( " " ) ; let f = match File :: open ( controller_list_file ) { Ok ( f ) => f , Err ( _ ) => return false , } ; for l in BufReader :: new ( f ) . lines ( ) . flatten ( ) { let controllers : Vec < & str > = l . split ( ' ' ) . collect ( ) ; if controllers . contains ( & controller ) { return true ; } } false }
Returns true if the controller is available to be enabled from a
cgroup path specified by the mount_point parameter
Returns true if the controller is available to be enabled from a cgroup path specified by the mount_point parameter
controller
&str
mount_point
P
controller
&str
mount_point
P