Struct VersionBuilder Copy item path Source pub struct VersionBuilder { }Expand description Builder for creating Version programmatically.
This builder allows you to construct version strings when building DBC files
programmatically by specifying a complete version string.
§ Examples
use dbc_rs::VersionBuilder;
let version = VersionBuilder::new().version("1.0" ).build()? ;
assert_eq! (version.as_str(), "1.0" );
let version2 = VersionBuilder::new()
.version("1.2.3" )
.build()? ;
assert_eq! (version2.as_str(), "1.2.3" );§ Feature Requirements
This builder requires the std feature to be enabled.
Builds the Version from this builder.
§ Errors
This method currently always succeeds (returns empty version if not set).
Creates a new VersionBuilder with no version set.
§ Examples
use dbc_rs::VersionBuilder;
let builder = VersionBuilder::new();
let version = builder.version("1.0" ).build()? ;Sets the complete version string.
§ Arguments
version - The complete version string (e.g., “1.0”, “1.2.3”, “1.0-beta”)
§ Examples
use dbc_rs::VersionBuilder;
let version = VersionBuilder::new()
.version("1.2.3" )
.build()? ;
assert_eq! (version.as_str(), "1.2.3" );Formats the value using the given formatter.
Read more 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.