gbf_core::moduleStruct ModuleBuilder
Source pub struct ModuleBuilder { }
Expand description
Represents a builder for a Module
.
Source§Public API for ModuleBuilder
.
Create a new ModuleBuilder
.
§Arguments
name
: The name of the module.
§Returns
- A new
ModuleBuilder
instance.
§Example
use gbf_core::module::ModuleBuilder;
let builder = ModuleBuilder::new();
Set the name of the module.
§Arguments
name
: The name of the module.
§Returns
- A reference to the builder.
§Example
use gbf_core::module::ModuleBuilder;
let builder = ModuleBuilder::new().name("test");
Set the reader for the module.
§Arguments
reader
: The reader to use for the module.
§Returns
- A reference to the builder.
§Example
use gbf_core::module::ModuleBuilder;
let builder = ModuleBuilder::new().reader(Box::new(std::io::Cursor::new(vec![0x00, 0x01])));
Build the Module
from the builder.
§Returns
§Example
use gbf_core::module::ModuleBuilder;
let module = ModuleBuilder::new().name("test").build().unwrap();
Source§Default implementation for ModuleBuilder
.
Returns the “default value” for a type.
Read more
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
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.