types.rs - source
Description: Source of the Rust file `src/types.rs`.
Keywords: rust, rustlang, rust-lang

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25

    //! File Type module

    /// FileType
    pub enum FileType {
        Zip,
        Rar,
        Tar,
        Png
    }

    pub enum TestResult {
        Matched,
        Maybe,
        NotMatched
    }

    trait FileTypeAsses {
        fn test(bytes: &[u8]) -> TestResult;
    }

    impl FileTypeAsses for FileType {
        fn test(bytes: &[u8]) -> TestResult {
            todo!()
        }
    }