You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: lib.rs
    path of file: ./repos/kanata/interception/src
    
    the code of the file until where you have to start completion: pub extern crate interception_sys;

#[macro_use]
extern crate bitflags;

pub use interception_sys as raw;
pub mod scancode;

pub use scancode::ScanCode;

use
    
    pub fn get_filter(&self, device: Device) -> Filter {
        if is_invalid(device) {
            return Filter::KeyFilter(KeyFilter::empty());
        }

        let raw_filter = unsafe { raw::interception_get_filter(self.ctx, device) };
        if is_mouse(device) {
            let filter = match MouseFilter::from_bits(raw_filter) {
                Some(filter) => filter,
                None => MouseFilter::empty(),
            };

            Filter::MouseFilter(filter)
        } else {
            let filter = match KeyFilter::from_bits(raw_filter) {
                Some(filter) => filter,
                None => KeyFilter::empty(),
            };

            Filter::KeyFilter(filter)
        }
    }