pub struct EnvBuilder { /* private fields */ }
Expand description
Struct used to build an environment Environment
This is the crate’s main entry point. An environment must be created
as the first step. An Environment
can only be built
using EnvBuilder
to configure it.
NOTE: If the same configuration method (for example with_name()
)
is called multiple times, the last value will have precedence.
Implementations§
Source§impl EnvBuilder
impl EnvBuilder
Sourcepub fn with_name<S>(self, name: S) -> EnvBuilder
pub fn with_name<S>(self, name: S) -> EnvBuilder
Configure the environment with a given name
NOTE: Since ONNX can only define one environment per process,
creating multiple environments using multiple EnvBuilder
will
end up re-using the same environment internally; a new one will not
be created. New parameters will be ignored.
Sourcepub fn with_log_level(self, log_level: LoggingLevel) -> EnvBuilder
pub fn with_log_level(self, log_level: LoggingLevel) -> EnvBuilder
Configure the environment with a given log level
NOTE: Since ONNX can only define one environment per process,
creating multiple environments using multiple EnvBuilder
will
end up re-using the same environment internally; a new one will not
be created. New parameters will be ignored.
Sourcepub fn build(self) -> Result<Environment>
pub fn build(self) -> Result<Environment>
Commit the configuration to a new Environment