pub struct ServerOptions {
pub thrift_transport: ThriftTransport,
pub auto_close: bool,
pub verbosity: StatusVerbosity,
pub log_file: Option<CString>,
pub env_variables: Option<HashMap<OsString, OsString>>,
pub license_preference: Option<LicensePreference>,
pub connection_count: i32,
pub server_ready_timeout: Option<u32>,
/* private fields */
}Expand description
Configuration used to start or connect to a Thrift HARS server.
Server-start settings such as Self::auto_close, Self::verbosity,
Self::log_file, and Self::server_ready_timeout only affect a server
started with start_engine_server or crate::session::new_thrift_session.
They cannot reconfigure an existing server used by the connect_to_*
helpers.
The default selects shared memory with a random name, enables HARS auto-close, and retries client connection attempts for ten seconds.
Fields§
§thrift_transport: ThriftTransportThrift transport and endpoint configuration.
auto_close: boolAsk a newly started HARS process to exit after its last client closes.
verbosity: StatusVerbosityMaximum HARS log verbosity.
log_file: Option<CString>Optional file to which a newly started HARS writes its log.
env_variables: Option<HashMap<OsString, OsString>>Process environment entries temporarily applied while starting HARS.
license_preference: Option<LicensePreference>Optional Houdini license checkout preference.
connection_count: i32Number of HARC subconnections requested for the session.
server_ready_timeout: Option<u32>Optional HARS readiness timeout, in milliseconds.
When absent, the default supplied by HAPI is retained.
Implementations§
Source§impl ServerOptions
impl ServerOptions
Create options for a shared-memory transport with a random name.
Sourcepub fn pipe_with_defaults() -> Self
pub fn pipe_with_defaults() -> Self
Create options for a named pipe transport.
Sourcepub fn socket_with_defaults(address: SocketAddrV4) -> Self
pub fn socket_with_defaults(address: SocketAddrV4) -> Self
Create options for a socket transport.
Sourcepub fn with_thrift_transport(self, transport: ThriftTransport) -> Self
pub fn with_thrift_transport(self, transport: ThriftTransport) -> Self
Replace the configured Thrift transport.
Sourcepub fn with_connection_timeout(self, timeout: Option<Duration>) -> Self
pub fn with_connection_timeout(self, timeout: Option<Duration>) -> Self
Set the total retry timeout used while establishing a Thrift session.
None retries indefinitely. This is separate from
Self::with_server_ready_timeout, which controls server startup.
Sourcepub fn with_license_preference(
self,
license_preference: LicensePreference,
) -> Self
pub fn with_license_preference( self, license_preference: LicensePreference, ) -> Self
Set the license preference for the server. For more information, see https://www.sidefx.com/docs/houdini//licensing/system.html Default is No preference, the server decides which license to check out.
Sourcepub fn with_log_file(self, file: impl AsRef<Path>) -> Self
pub fn with_log_file(self, file: impl AsRef<Path>) -> Self
Set the log file for the server. BUG: HARS 21.0.685 has a bug where the log file is always created in the working directory
§Panics
Panics if file contains an interior null byte and cannot be converted to a C string.
Sourcepub fn with_env_variables<'a, I, K, V>(self, variables: I) -> Self
pub fn with_env_variables<'a, I, K, V>(self, variables: I) -> Self
Set real environment variables before the server starts.
Unlike crate::session::Session::set_server_var, where the variables are set in the session after the
server starts.
Sourcepub fn with_auto_close(self, auto_close: bool) -> Self
pub fn with_auto_close(self, auto_close: bool) -> Self
Automatically close the server when the last connection drops.
Sourcepub fn with_verbosity(self, verbosity: StatusVerbosity) -> Self
pub fn with_verbosity(self, verbosity: StatusVerbosity) -> Self
Set the verbosity level for the server.
Sourcepub fn with_server_ready_timeout(self, timeout: u32) -> Self
pub fn with_server_ready_timeout(self, timeout: u32) -> Self
Set the timeout for the server to be ready in ms This is the timeout for the server to initialize and be ready to accept connections.