Struct machineid_rs::IdBuilder[][src]

pub struct IdBuilder {
    pub hash: Encryption,
    // some fields omitted
}
Expand description

IdBuilder is the constructor for the HWID. It can be used with the 3 different options of the Encryption enum.

Fields

hash: Encryption

Implementations

Joins every part together and returns a Result that may be the hashed HWID or a HWIDError.

Errors

Returns Err if there is an error while retrieving the component’s strings.

Examples
use machineid_rs::{IdBuilder, Encryption, HWIDComponent};
 
let mut builder = IdBuilder::new(Encryption::MD5);
 
builder.add_component(HWIDComponent::SystemID);
 
 
// Will panic if there is an error when the components return his values.
let key = builder.build("mykey").unwrap();

Adds a component to the IdBuilder that will be hashed once you call the IdBuilder::build function.

You can’t add the same component twice.

Examples
use machineid_rs::{IdBuilder, Encryption, HWIDComponent};
 
let mut builder = IdBuilder::new(Encryption::MD5);
 
builder.add_component(HWIDComponent::SystemID);

Makes a new IdBuilder with the selected Encryption

Examples
use machineid_rs::{IdBuilder, Encryption};
 
let mut builder = IdBuilder::new(Encryption::MD5);

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.