DUP

Struct DUP 

Source
pub struct DUP {
    pub name: String,
    pub description: String,
    pub version: String,
    /* private fields */
}
Expand description

Represents a Data Usage Policy (DUP)

Fields§

§name: String

The common name of the Data Usage Policy, (e.g.: For Billing Purpose)

§description: String

A textual description of the Data Usage Policy

§version: String

The version of the policy, (e.g.: 1.0.0)

Implementations§

Source§

impl DUP

Source

pub fn new(nme: String, descr: String, ver: String) -> Self

Constructs a new Data Usage Policy object

§Arguments
  • nme: String - The textual name of the Data Usage Policy.
  • descr: String - A textual description of the Data Usage Policy.
  • ver: String - The version of the policy, (e.g.: 1.0.0).

#Example

extern crate pbd;

use pbd::dua::policy::DUP;

fn main() {
    let dup = DUP::new(
        "General Policy".to_string(),
        "This is a high-level policy.".to_string(),
        "1.0.1".to_string()
    );
}
Source

pub fn associate_category(&mut self, category: DataCategory)

Associates a DataCategory object to the policy NOTE: Call this function to associate a new DataCategory objects or replace pre-associated DataCategory objects

§Arguments
  • category: DataCategory - The Data Category to associate.

#Example

extern crate pbd;

use pbd::dua::policy::DUP;
use pbd::dua::data_category::DataCategory;

fn main() {
    let mut dup = DUP::new(
        "General Policy".to_string(),
        "This is a high-level policy.".to_string(),
        "1.0.1".to_string()
    );

    dup.associate_category(DataCategory::new(
       "Authentication Data".to_string(),
       "Data used to manage access to the system.".to_string(),
       "system.authentication".to_string(),
       "default_organization".to_string(),
       Some("system".to_string()),
       None,                       
       false,
       true,
   ));
}
Source

pub fn associate_subject(&mut self, subject: DataSubject)

Associates a DataSubject object to the policy NOTE: Call this function to associate a new DataSubject objects or replace pre-associated DataSubject objects

§Arguments
  • subject: DataSubject - The Data Subject to associate.

#Example

extern crate pbd;

use pbd::dua::policy::DUP;
use pbd::dua::data_subject::{DataRights, DataSubject, Right, Strategy};

fn main() {
    let mut dup = DUP::new(
        "General Policy".to_string(),
        "This is a high-level policy.".to_string(),
        "1.0.1".to_string()
    );

    let subject = DataSubject::new(
        "Consultant".to_string(),
        "An individual employed in a consultative/temporary capacity by the organization.".to_string(),
        "consultant".to_string(),
        "default_organization".to_string(),
        Some(vec!["work".to_string(), "temporary".to_string()]),
        Some(DataRights::new(Strategy::ALL, vec![Right::Informed, Right::Access])),
        false,
        false,
        true
    );

    dup.associate_subject(subject);
}
Source

pub fn associate_use(&mut self, usage: DataUse)

Associates a DataUse object to the policy NOTE: Call this function to associate a new DataUse objects or replace pre-associated DataUse objects

§Arguments
  • usage: DataUse - The Data Use to associate.

#Example

extern crate pbd;

use pbd::dua::policy::DUP;
use pbd::dua::data_use::{DataUse, LegalBasis, SpecialCategory};

fn main() {
    let mut dup = DUP::new(
        "General Policy".to_string(),
        "This is a high-level policy.".to_string(),
        "1.0.1".to_string()
    );

    let datause = DataUse::new(
        "Provide the capability".to_string(),
        "Provide, give, or make available the product, service, application or system.".to_string(),
        "provide".to_string(),
        "default_organization".to_string(),
        None,
        Some(LegalBasis::LegitimateInterest),
        Some(SpecialCategory::VitalInterests),
        Some(vec!("marketing team".to_string(), "dog shelter".to_string())),
        false,
        Some("https://example.org/legitimate_interest_assessment".to_string()),
        None,
        false,
        true
    );

    dup.associate_use(datause);
}
Source

pub fn as_html(&mut self) -> String

Converts the policy to a human readable format as html NOTE: You can apply custom styling by referencing the class attribute of the elements.

#Example

extern crate pbd;

use pbd::dua::policy::DUP;
use pbd::dua::data_category::DataCategoryFactory;
use pbd::dua::data_subject::DataSubjectFactory;
use pbd::dua::data_use::DataUseFactory;

fn main() {
    let cfactory = DataCategoryFactory::new();
    let sfactory = DataSubjectFactory::new();
    let ufactory = DataUseFactory::new();
    let mut dup = DUP::new(
        "General Marketing Policy".to_string(),
        "This policy explains the manner in which your data will be used for marketing purposes.".to_string(),
        "1.0.0".to_string()
    );

    dup.associate_category(
        cfactory
            .get_category_by_key("user.behavior.browsing_history".to_string())
            .unwrap(),
    );
    dup.associate_category(
        cfactory
            .get_category_by_key("user.behavior.media_consumption".to_string())
            .unwrap(),
    );
    dup.associate_subject(sfactory.get_subject_by_key("customer".to_string()).unwrap());
    dup.associate_subject(sfactory.get_subject_by_key("prospect".to_string()).unwrap());
    dup.associate_use(
        ufactory
            .get_use_by_key("marketing.advertising.profiling".to_string())
            .unwrap(),
    );
    dup.associate_use(
        ufactory
            .get_use_by_key("marketing.advertising.serving".to_string())
            .unwrap(),
    );
    dup.associate_use(
        ufactory
            .get_use_by_key("marketing.communications.email".to_string())
            .unwrap(),
    );
     
    print!("{}", dup.as_html());

    /* <div class='dup' name='General Policy'>General Policy</div></br>
     * <div class='dup-verion' name='1.0.1'>(version: 1.0.1)</div></br></br>
     * <div class='dup-description' name='General Policy Description'><b>This is a high-level policy.</b></br></br>
     * <p>
     * Data will be collected from the following types of users: Customer and Prospect.</br>
     * The data being collected will be limited to the following data: Browsing History and Media Consumption.</br>
     * The data collected can be used for the following purposes: Profiling for Advertising, Essential for Serving Ads and Marketing Email Communications.</br>
     * </p></div>
    */
}
Source

pub fn as_text(&mut self) -> String

Converts the policy to a human readable format as text

#Example

extern crate pbd;

use pbd::dua::policy::DUP;
use pbd::dua::data_category::DataCategoryFactory;
use pbd::dua::data_subject::DataSubjectFactory;
use pbd::dua::data_use::DataUseFactory;

fn main() {
    let cfactory = DataCategoryFactory::new();
    let sfactory = DataSubjectFactory::new();
    let ufactory = DataUseFactory::new();
    let mut dup = DUP::new(
        "General Marketing Policy".to_string(),
        "This policy explains the manner in which your data will be used for marketing purposes.".to_string(),
        "1.0.0".to_string()
    );

    dup.associate_category(
        cfactory
            .get_category_by_key("user.behavior.browsing_history".to_string())
            .unwrap(),
    );
    dup.associate_category(
        cfactory
            .get_category_by_key("user.behavior.media_consumption".to_string())
            .unwrap(),
    );
    dup.associate_subject(sfactory.get_subject_by_key("customer".to_string()).unwrap());
    dup.associate_subject(sfactory.get_subject_by_key("prospect".to_string()).unwrap());
    dup.associate_use(
        ufactory
            .get_use_by_key("marketing.advertising.profiling".to_string())
            .unwrap(),
    );
    dup.associate_use(
        ufactory
            .get_use_by_key("marketing.advertising.serving".to_string())
            .unwrap(),
    );
    dup.associate_use(
        ufactory
            .get_use_by_key("marketing.communications.email".to_string())
            .unwrap(),
    );
     
    print!("{}", dup.as_text());

    /* General Marketing Policy
     * (version: 1.0.0)
     *
     * This policy explains the manner in which your data will be used for marketing purposes.
     *
     * Data will be collected from the following types of users: Customer and Prospect.
     * The data being collected will be limited to the following data: Browsing History and Media Consumption.
     * The data collected can be used for the following purposes: Profiling for Advertising, Essential for Serving Ads and Marketing Email Communications.
    */
}
Source

pub fn disassociate_category(&mut self, key: String)

Disassociates the specified DataCategory object from the policy using the key

§Arguments
  • key: String - The key of the Data Category to disassociate.

#Example

extern crate pbd;

use pbd::dua::policy::DUP;
use pbd::dua::data_category::DataCategory;

fn main() {
    let mut dup = DUP::new(
        "General Policy".to_string(),
        "This is a high-level policy.".to_string(),
        "1.0.1".to_string()
    );
    let cat = DataCategory::new(
       "Authentication Data".to_string(),
       "Data used to manage access to the system.".to_string(),
       "system.authentication".to_string(),
       "default_organization".to_string(),
       Some("system".to_string()),
       None,                       
       false,
       true,
   );

   dup.associate_category(cat.clone());

   dup.disassociate_category(cat.get_key());
}
Source

pub fn disassociate_subject(&mut self, key: String)

Disassociates the specified DataSubject object from the policy using the key

§Arguments
  • key: String - The key of the Data Subject to disassociate.

#Example

extern crate pbd;

use pbd::dua::policy::DUP;
use pbd::dua::data_subject::{DataRights, DataSubject, Right, Strategy};

fn main() {
    let mut dup = DUP::new(
        "General Policy".to_string(),
        "This is a high-level policy.".to_string(),
        "1.0.1".to_string()
    );

    let subject = DataSubject::new(
        "Consultant".to_string(),
        "An individual employed in a consultative/temporary capacity by the organization.".to_string(),
        "consultant".to_string(),
        "default_organization".to_string(),
        Some(vec!["work".to_string(), "temporary".to_string()]),
        Some(DataRights::new(Strategy::ALL, vec![Right::Informed, Right::Access])),
        false,
        false,
        true
    );

   dup.associate_subject(subject.clone());

   dup.disassociate_subject(subject.get_key());
}
Source

pub fn disassociate_use(&mut self, key: String)

Disassociates the specified DataUse object from the policy using the key

§Arguments
  • key: String - The key of the Data Use to disassociate.

#Example

extern crate pbd;

use pbd::dua::policy::DUP;
use pbd::dua::data_use::{DataUse, LegalBasis, SpecialCategory};

fn main() {
    let mut dup = DUP::new(
        "General Policy".to_string(),
        "This is a high-level policy.".to_string(),
        "1.0.1".to_string()
    );

    let datause = DataUse::new(
        "Provide the capability".to_string(),
        "Provide, give, or make available the product, service, application or system.".to_string(),
        "provide".to_string(),
        "default_organization".to_string(),
        None,
        Some(LegalBasis::LegitimateInterest),
        Some(SpecialCategory::VitalInterests),
        Some(vec!("marketing team".to_string(), "dog shelter".to_string())),
        false,
        Some("https://example.org/legitimate_interest_assessment".to_string()),
        None,
        false,
        true
    );

   dup.associate_use(datause.clone());

   dup.disassociate_use(datause.get_key());
}
Source

pub fn from_serialized(serialized: &str) -> DUP

Constructs a DUP object from a serialized string

§Arguments
  • serialized: &str - The string that represents the serialized object.

#Example

extern crate pbd;

use pbd::dua::policy::DUP;

fn main() {
    let serialized = r#"{"name":"General Policy","description":"This is a high-level policy.","version":"1.0.1","categories":{"system.authentication":{"name":"Authentication Data","description":"Data used to manage access to the system.","fides_key":"system.authentication","organization_fides_key":"default_organization","parent_key":"system","tags":null,"is_default":true,"active":true}},"subjects":{"consultant":{"name":"Consultant","description":"An individual employed in a consultative/temporary capacity by the organization.","fides_key":"consultant","organization_fides_key":"default_organization","tags":null,"rights":null,"automated_decisions_or_profiling":false,"is_default":true,"active":true}},"uses":{"essential.service.authentication":{"name":"Essential Service Authentication","description":"Authenticate users to the product, service, application or system.","fides_key":"essential.service.authentication","organization_fides_key":"default_organization","parent_key":"essential.service","legal_basis":null,"special_category":null,"recipent":null,"legitimate_interest":false,"legitimate_interest_impact_assessment":null,"tags":null,"is_default":true,"active":true}}}"#;
    let mut dup = DUP::from_serialized(&serialized);
     
    assert_eq!(dup.get_categories().len(), 1);
}
Source

pub fn get_categories(&mut self) -> Vec<DataCategory>

Retrieves all the associated DataCategory objects

#Example

extern crate pbd;

use pbd::dua::policy::DUP;
use pbd::dua::data_category::DataCategory;

fn main() {
    let mut dup = DUP::new(
        "General Policy".to_string(),
        "This is a high-level policy.".to_string(),
        "1.0.1".to_string()
    );

    dup.associate_category(DataCategory::new(
       "Authentication Data".to_string(),
       "Data used to manage access to the system.".to_string(),
       "system.authentication".to_string(),
       "default_organization".to_string(),
       Some("system".to_string()),
       None,                       
       false,
       true,
   ));

   assert_eq!(dup.get_categories().len(), 1);
}
Source

pub fn get_subjects(&mut self) -> Vec<DataSubject>

Retrieves all the associated DataSubject objects

#Example

extern crate pbd;

use pbd::dua::policy::DUP;
use pbd::dua::data_subject::{DataRights, DataSubject, Right, Strategy};

fn main() {
    let mut dup = DUP::new(
        "General Policy".to_string(),
        "This is a high-level policy.".to_string(),
        "1.0.1".to_string()
    );

    let subject = DataSubject::new(
        "Consultant".to_string(),
        "An individual employed in a consultative/temporary capacity by the organization.".to_string(),
        "consultant".to_string(),
        "default_organization".to_string(),
        Some(vec!["work".to_string(), "temporary".to_string()]),
        Some(DataRights::new(Strategy::ALL, vec![Right::Informed, Right::Access])),
        false,
        false,
        true
    );

    dup.associate_subject(subject);

   assert_eq!(dup.get_subjects().len(), 1);
}
Source

pub fn get_uses(&mut self) -> Vec<DataUse>

Retrieves all the associated DataUse objects

#Example

extern crate pbd;

use pbd::dua::policy::DUP;
use pbd::dua::data_use::{DataUse, LegalBasis, SpecialCategory};

fn main() {
    let mut dup = DUP::new(
        "General Policy".to_string(),
        "This is a high-level policy.".to_string(),
        "1.0.1".to_string()
    );

    let datause = DataUse::new(
        "Provide the capability".to_string(),
        "Provide, give, or make available the product, service, application or system.".to_string(),
        "provide".to_string(),
        "default_organization".to_string(),
        None,
        Some(LegalBasis::LegitimateInterest),
        Some(SpecialCategory::VitalInterests),
        Some(vec!("marketing team".to_string(), "dog shelter".to_string())),
        false,
        Some("https://example.org/legitimate_interest_assessment".to_string()),
        None,
        false,
        true
    );

    dup.associate_use(datause);

   assert_eq!(dup.get_uses().len(), 1);
}
Source

pub fn get_category(&mut self, key: String) -> Option<&DataCategory>

Retrieves a reference to the specified DataCategory that is associated with the policy

§Arguments
  • key: String - The key of the Data Category to retrieve.

#Example

extern crate pbd;

use pbd::dua::policy::DUP;
use pbd::dua::data_category::DataCategory;

fn main() {
    let mut dup = DUP::new(
        "General Policy".to_string(),
        "This is a high-level policy.".to_string(),
        "1.0.1".to_string()
    );

    let cat = DataCategory::new(
       "Authentication Data".to_string(),
       "Data used to manage access to the system.".to_string(),
       "system.authentication".to_string(),
       "default_organization".to_string(),
       Some("system".to_string()),
       None,                       
       false,
       true,
   );

   dup.associate_category(cat.clone());

   let retrieved_category = dup.get_category(cat.get_key()).unwrap();
   println!("{}", retrieved_category.description);
}
Source

pub fn get_subject(&mut self, key: String) -> Option<&DataSubject>

Retrieves a reference to the specified DataSubject that is associated with the policy

§Arguments
  • key: String - The key of the Data Subject to retrieve.

#Example

extern crate pbd;

use pbd::dua::policy::DUP;
use pbd::dua::data_subject::{DataRights, DataSubject, Right, Strategy};

fn main() {
    let mut dup = DUP::new(
        "General Policy".to_string(),
        "This is a high-level policy.".to_string(),
        "1.0.1".to_string()
    );

    let subject = DataSubject::new(
        "Consultant".to_string(),
        "An individual employed in a consultative/temporary capacity by the organization.".to_string(),
        "consultant".to_string(),
        "default_organization".to_string(),
        Some(vec!["work".to_string(), "temporary".to_string()]),
        Some(DataRights::new(Strategy::ALL, vec![Right::Informed, Right::Access])),
        false,
        false,
        true
    );

   dup.associate_subject(subject.clone());

   let retrieved_subject = dup.get_subject(subject.get_key()).unwrap();
   println!("{}", retrieved_subject.description);
}
Source

pub fn get_use(&mut self, key: String) -> Option<&DataUse>

Retrieves a reference to the specified DataUse that is associated with the policy

§Arguments
  • key: String - The key of the Data Use to retrieve.

#Example

extern crate pbd;

use pbd::dua::policy::DUP;
use pbd::dua::data_use::{DataUse, LegalBasis, SpecialCategory};

fn main() {
    let mut dup = DUP::new(
        "General Policy".to_string(),
        "This is a high-level policy.".to_string(),
        "1.0.1".to_string()
    );

    let datause = DataUse::new(
        "Provide the capability".to_string(),
        "Provide, give, or make available the product, service, application or system.".to_string(),
        "provide".to_string(),
        "default_organization".to_string(),
        None,
        Some(LegalBasis::LegitimateInterest),
        Some(SpecialCategory::VitalInterests),
        Some(vec!("marketing team".to_string(), "dog shelter".to_string())),
        false,
        Some("https://example.org/legitimate_interest_assessment".to_string()),
        None,
        false,
        true
    );

   dup.associate_use(datause.clone());

   let retrieved_use = dup.get_use(datause.get_key()).unwrap();
   println!("{}", retrieved_use.description);
}
Source

pub fn has_category(&mut self, key: String) -> bool

Determines if the specified DataCategory key is associated with the policy

§Arguments
  • key: String - The key of the Data Category to check.

#Example

extern crate pbd;

use pbd::dua::policy::DUP;
use pbd::dua::data_category::DataCategory;

fn main() {
    let mut dup = DUP::new(
        "General Policy".to_string(),
        "This is a high-level policy.".to_string(),
        "1.0.1".to_string()
    );

    let cat = DataCategory::new(
       "Authentication Data".to_string(),
       "Data used to manage access to the system.".to_string(),
       "system.authentication".to_string(),
       "default_organization".to_string(),
       Some("system".to_string()),
       None,                       
       false,
       true,
   );

   dup.associate_category(cat.clone());

   assert_eq!(dup.has_category(cat.get_key()), true);
}
Source

pub fn has_subject(&mut self, key: String) -> bool

Determines if the specified DataSubejct key is associated with the policy

§Arguments
  • key: String - The key of the Data Subject to check.

#Example

extern crate pbd;

use pbd::dua::policy::DUP;
use pbd::dua::data_subject::{DataRights, DataSubject, Right, Strategy};

fn main() {
    let mut dup = DUP::new(
        "General Policy".to_string(),
        "This is a high-level policy.".to_string(),
        "1.0.1".to_string()
    );

    let subject = DataSubject::new(
        "Consultant".to_string(),
        "An individual employed in a consultative/temporary capacity by the organization.".to_string(),
        "consultant".to_string(),
        "default_organization".to_string(),
        Some(vec!["work".to_string(), "temporary".to_string()]),
        Some(DataRights::new(Strategy::ALL, vec![Right::Informed, Right::Access])),
        false,
        false,
        true
    );

   dup.associate_subject(subject.clone());

   assert_eq!(dup.has_subject(subject.get_key()), true);
}
Source

pub fn has_use(&mut self, key: String) -> bool

Determines if the specified DataUse key is associated with the policy

§Arguments
  • key: String - The key of the Data Use to check.

#Example

extern crate pbd;

use pbd::dua::policy::DUP;
use pbd::dua::data_use::{DataUse, LegalBasis, SpecialCategory};

fn main() {
    let mut dup = DUP::new(
        "General Policy".to_string(),
        "This is a high-level policy.".to_string(),
        "1.0.1".to_string()
    );

    let datause = DataUse::new(
        "Provide the capability".to_string(),
        "Provide, give, or make available the product, service, application or system.".to_string(),
        "provide".to_string(),
        "default_organization".to_string(),
        None,
        Some(LegalBasis::LegitimateInterest),
        Some(SpecialCategory::VitalInterests),
        Some(vec!("marketing team".to_string(), "dog shelter".to_string())),
        false,
        Some("https://example.org/legitimate_interest_assessment".to_string()),
        None,
        false,
        true
    );

   dup.associate_use(datause.clone());

   assert_eq!(dup.has_use(datause.get_key()), true);
}
Source

pub fn match_conditions(&mut self, conditions: Vec<Condition>) -> Vec<Condition>

Determines if the specified Conditions can be met by the policy and returns a list of conditions that conflict wiht the policy.

§Arguments
  • conditions: Vec - The list of Conditions to check against the policy.

#Example

extern crate pbd;

use pbd::dua::policy::{Condition, DUP};
use pbd::dua::data_category::DataCategory;
use pbd::dua::data_subject::{DataRights, DataSubject, Right, Strategy};
use pbd::dua::data_use::{DataUse, LegalBasis, SpecialCategory};

fn main() {
    let mut dup = DUP::new(
        "General Policy".to_string(),
        "This is a high-level policy.".to_string(),
        "1.0.1".to_string()
    );
    let category = DataCategory::new(
       "Authentication Data".to_string(),
       "Data used to manage access to the system.".to_string(),
       "system.authentication".to_string(),
       "default_organization".to_string(),
       Some("system".to_string()),
       None,                       
       false,
       true,
    );
    let subject = DataSubject::new(
        "Consultant".to_string(),
        "An individual employed in a consultative/temporary capacity by the organization.".to_string(),
        "consultant".to_string(),
        "default_organization".to_string(),
        Some(vec!["work".to_string(), "temporary".to_string()]),
        Some(DataRights::new(Strategy::ALL, vec![Right::Informed, Right::Access])),
        false,
        false,
        true
    );
    let datause = DataUse::new(
        "Provide the capability".to_string(),
        "Provide, give, or make available the product, service, application or system.".to_string(),
        "provide".to_string(),
        "default_organization".to_string(),
        None,
        Some(LegalBasis::LegitimateInterest),
        Some(SpecialCategory::VitalInterests),
        Some(vec!("marketing team".to_string(), "dog shelter".to_string())),
        false,
        Some("https://example.org/legitimate_interest_assessment".to_string()),
        None,
        false,
        true
    );

   dup.associate_category(category.clone());
   dup.associate_use(datause.clone());

   let mut conditions: Vec<Condition> = Vec::new();
   conditions.push(Condition::Category(category.get_key()));
   conditions.push(Condition::Subject(subject.get_key()));
   conditions.push(Condition::Use(datause.get_key()));
   let conflicts = dup.match_conditions(conditions);

   assert_eq!(conflicts.len(), 1);
   assert_eq!(conflicts[0].to_string(), subject.get_key());
}
Source

pub fn serialize(&mut self) -> String

Serialize a DUP object

§Arguments
  • serialized: &str - The string that represents the serialized object.

#Example

extern crate pbd;

use pbd::dua::policy::{Condition, DUP};
use pbd::dua::data_category::DataCategoryFactory;
use pbd::dua::data_subject::DataSubjectFactory;
use pbd::dua::data_use::DataUseFactory;

fn main() {
    let mut dup = DUP::new(
        "General Policy".to_string(),
        "This is a high-level policy.".to_string(),
        "1.0.1".to_string()
    );
    let category_factory = DataCategoryFactory::new();
    let subject_factory = DataSubjectFactory::new();
    let use_factory = DataUseFactory::new();

   dup.associate_category(category_factory.get_category_by_key("system.authentication".to_string()).unwrap());
   dup.associate_subject(subject_factory.get_subject_by_key("consultant".to_string()).unwrap());
   dup.associate_use(use_factory.get_use_by_key("analytics.reporting".to_string()).unwrap());
     
    println!("{:?}", dup.serialize());
}

Trait Implementations§

Source§

impl Clone for DUP

Source§

fn clone(&self) -> DUP

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DUP

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DUP

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for DUP

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for DUP

§

impl RefUnwindSafe for DUP

§

impl Send for DUP

§

impl Sync for DUP

§

impl Unpin for DUP

§

impl UnwindSafe for DUP

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,