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: common.rs
    path of file: ./repos/CYFS/src/component/cyfs-bdt/src/ndn/download
    
    the code of the file until where you have to start completion: use std::{
    collections::{LinkedList}, 
    io::SeekFrom, 
    ops::Range
};
use async_std::{
    pin::Pin, 
    task::{Context, Poll},
    task
};

use cyfs_base::*;
use crate::{
    types::*
};
use super::super::{
    types::*, 
    chunk::*,
    channel::{DownloadSession, protocol::v0::*}
};


#[derive(Clone, Debug)]
pub struct DownloadSourceFilter {
    pub exclude_target: Option<Vec<DeviceId>>, 
    pub include_target: Option<Vec<DeviceId>>, 
    pub include_codec: Option<Vec<ChunkCodecDesc>
    
    pub fn check(&self, source: &DownloadSource<DeviceDesc>) -> bool {
        if let Some(exclude) = self.exclude_target.as_ref() {
            for target in exclude {
                if source.target.device_id().eq(target) {
                    return false;
                }
            }
        }

        if let Some(include_target) = self.include_target.as_ref() {
            let target_id = source.target.device_id();
            if include_target.iter().any(|include| target_id.eq(include)) {
                if let Some(include) = self.include_codec.as_ref() {
                    for codec in include {
                        if source.codec_desc.support_desc(codec) {
                            return true;
                        }
                    }
                } else {
                    return true;
                }
            }
            false
        } else if let Some(include) = self.include_codec.as_ref() {
            for codec in include {
                if source.codec_desc.support_desc(codec) {
                    return true;
                }
            }
            false
        } else {
            false
        }
    }