Skip to main content

RedisServer

Struct RedisServer 

Source
pub struct RedisServer { /* private fields */ }
Expand description

Builder for a Redis server.

Implementations§

Source§

impl RedisServer

Source

pub fn new() -> Self

Create a new builder with default settings.

Source

pub fn port(self, port: u16) -> Self

Set the listening port (default: 6379).

Source

pub fn bind(self, bind: impl Into<String>) -> Self

Set the bind address (default: 127.0.0.1).

Source

pub fn protected_mode(self, protected: bool) -> Self

Enable or disable protected mode (default: off).

Source

pub fn tcp_backlog(self, backlog: u32) -> Self

Set the TCP backlog queue length.

Source

pub fn unixsocket(self, path: impl Into<PathBuf>) -> Self

Set a Unix socket path for connections.

Source

pub fn unixsocketperm(self, perm: u32) -> Self

Set Unix socket permissions (e.g. 700).

Source

pub fn timeout(self, seconds: u32) -> Self

Close idle client connections after this many seconds (0 = disabled).

Source

pub fn tcp_keepalive(self, seconds: u32) -> Self

Set TCP keepalive interval in seconds.

Source

pub fn tls_port(self, port: u16) -> Self

Set TLS listening port.

Source

pub fn tls_cert_file(self, path: impl Into<PathBuf>) -> Self

Set the TLS certificate file path.

Source

pub fn tls_key_file(self, path: impl Into<PathBuf>) -> Self

Set the TLS private key file path.

Source

pub fn tls_ca_cert_file(self, path: impl Into<PathBuf>) -> Self

Set the TLS CA certificate file path.

Source

pub fn tls_auth_clients(self, require: bool) -> Self

Require TLS client authentication.

Source

pub fn tls_key_file_pass(self, pass: impl Into<String>) -> Self

Set the passphrase for the TLS private key file.

Source

pub fn tls_ca_cert_dir(self, path: impl Into<PathBuf>) -> Self

Set the TLS CA certificate directory path.

Source

pub fn tls_client_cert_file(self, path: impl Into<PathBuf>) -> Self

Set the TLS client certificate file path (for outgoing connections).

Source

pub fn tls_client_key_file(self, path: impl Into<PathBuf>) -> Self

Set the TLS client private key file path (for outgoing connections).

Source

pub fn tls_client_key_file_pass(self, pass: impl Into<String>) -> Self

Set the passphrase for the TLS client private key file.

Source

pub fn tls_dh_params_file(self, path: impl Into<PathBuf>) -> Self

Set the DH parameters file path for DHE ciphers.

Source

pub fn tls_ciphers(self, ciphers: impl Into<String>) -> Self

Set the allowed TLS 1.2 ciphers (OpenSSL cipher list format).

Source

pub fn tls_ciphersuites(self, suites: impl Into<String>) -> Self

Set the allowed TLS 1.3 ciphersuites (colon-separated).

Source

pub fn tls_protocols(self, protocols: impl Into<String>) -> Self

Set the allowed TLS protocol versions (e.g. "TLSv1.2 TLSv1.3").

Source

pub fn tls_prefer_server_ciphers(self, prefer: bool) -> Self

Prefer the server’s cipher order over the client’s.

Source

pub fn tls_session_caching(self, enable: bool) -> Self

Enable or disable TLS session caching.

Source

pub fn tls_session_cache_size(self, size: u32) -> Self

Set the number of entries in the TLS session cache.

Source

pub fn tls_session_cache_timeout(self, seconds: u32) -> Self

Set the timeout in seconds for cached TLS sessions.

Source

pub fn tls_replication(self, enable: bool) -> Self

Enable TLS for replication traffic.

Source

pub fn tls_cluster(self, enable: bool) -> Self

Enable TLS for cluster bus communication.

Source

pub fn dir(self, dir: impl Into<PathBuf>) -> Self

Set the working directory for data files.

Source

pub fn loglevel(self, level: LogLevel) -> Self

Set the log level (default: LogLevel::Notice).

Source

pub fn logfile(self, path: impl Into<String>) -> Self

Set the log file path. Defaults to redis.log inside the node directory.

Source

pub fn databases(self, n: u32) -> Self

Set the number of databases (default: 16).

Source

pub fn maxmemory(self, limit: impl Into<String>) -> Self

Set the maximum memory limit (e.g. "256mb", "1gb").

Source

pub fn maxmemory_policy(self, policy: impl Into<String>) -> Self

Set the eviction policy when maxmemory is reached.

Source

pub fn maxmemory_samples(self, n: u32) -> Self

Set the number of keys sampled per eviction round (Redis default: 5).

Source

pub fn maxmemory_clients(self, limit: impl Into<String>) -> Self

Set per-client memory limit (e.g. "0" to disable).

Source

pub fn maxmemory_eviction_tenacity(self, tenacity: u32) -> Self

Set eviction processing effort (1-100, Redis default: 10).

Source

pub fn maxclients(self, n: u32) -> Self

Set the maximum number of simultaneous client connections.

Source

pub fn lfu_log_factor(self, factor: u32) -> Self

Set the logarithmic factor for the LFU frequency counter (Redis default: 10).

Source

pub fn lfu_decay_time(self, minutes: u32) -> Self

Set the LFU counter decay time in minutes (Redis default: 1).

Source

pub fn active_expire_effort(self, effort: u32) -> Self

Set the effort spent on active key expiration (1-100, Redis default: 10).

Source

pub fn lazyfree_lazy_eviction(self, enable: bool) -> Self

Enable or disable background deletion during eviction.

Source

pub fn lazyfree_lazy_expire(self, enable: bool) -> Self

Enable or disable background deletion of expired keys.

Source

pub fn lazyfree_lazy_server_del(self, enable: bool) -> Self

Enable or disable background deletion for implicit DEL (e.g. RENAME).

Source

pub fn lazyfree_lazy_user_del(self, enable: bool) -> Self

Make explicit DEL behave like UNLINK (background deletion).

Source

pub fn lazyfree_lazy_user_flush(self, enable: bool) -> Self

Make FLUSHDB/FLUSHALL default to ASYNC.

Source

pub fn save(self, save: bool) -> Self

Enable or disable RDB snapshots (default: off).

true omits the save directive (Redis built-in defaults apply). false emits save "" to disable RDB entirely.

Source

pub fn save_schedule(self, schedule: Vec<(u64, u64)>) -> Self

Set a custom RDB save schedule.

Each (seconds, changes) pair emits a save <seconds> <changes> line.

Source

pub fn appendonly(self, appendonly: bool) -> Self

Enable or disable AOF persistence.

Source

pub fn appendfsync(self, policy: AppendFsync) -> Self

Set the AOF fsync policy.

Source

pub fn appendfilename(self, name: impl Into<String>) -> Self

Set the AOF filename.

Source

pub fn appenddirname(self, name: impl Into<PathBuf>) -> Self

Set the AOF directory name.

Source

pub fn aof_use_rdb_preamble(self, enable: bool) -> Self

Enable or disable the RDB preamble in AOF files.

Source

pub fn aof_load_truncated(self, enable: bool) -> Self

Control whether truncated AOF files are loaded.

Source

pub fn aof_load_corrupt_tail_max_size(self, size: impl Into<String>) -> Self

Set the maximum allowed size of a corrupt AOF tail (e.g. "32mb").

Source

pub fn aof_rewrite_incremental_fsync(self, enable: bool) -> Self

Enable or disable incremental fsync during AOF rewrites.

Source

pub fn aof_timestamp_enabled(self, enable: bool) -> Self

Enable or disable timestamps in the AOF file.

Source

pub fn auto_aof_rewrite_percentage(self, pct: u32) -> Self

Set the percentage growth that triggers an automatic AOF rewrite.

Source

pub fn auto_aof_rewrite_min_size(self, size: impl Into<String>) -> Self

Set the minimum AOF size before an automatic rewrite is triggered (e.g. "64mb").

Source

pub fn no_appendfsync_on_rewrite(self, enable: bool) -> Self

Control whether fsync is suppressed during AOF rewrites.

Source

pub fn replicaof(self, host: impl Into<String>, port: u16) -> Self

Configure this server as a replica of the given master.

Source

pub fn masterauth(self, password: impl Into<String>) -> Self

Set the password for authenticating with a master.

Source

pub fn masteruser(self, user: impl Into<String>) -> Self

Set the username for authenticating with a master (ACL-based auth).

Source

pub fn repl_backlog_size(self, size: impl Into<String>) -> Self

Set the replication backlog size (e.g. "1mb").

Source

pub fn repl_backlog_ttl(self, seconds: u32) -> Self

Set seconds before the backlog is freed when no replicas are connected.

Source

pub fn repl_disable_tcp_nodelay(self, disable: bool) -> Self

Disable TCP_NODELAY on the replication socket.

Source

pub fn repl_diskless_load(self, policy: ReplDisklessLoad) -> Self

Set the diskless load policy for replicas.

Source

pub fn repl_diskless_sync(self, enable: bool) -> Self

Enable or disable diskless sync from master to replicas.

Source

pub fn repl_diskless_sync_delay(self, seconds: u32) -> Self

Set the delay in seconds before starting a diskless sync.

Source

pub fn repl_diskless_sync_max_replicas(self, n: u32) -> Self

Set the maximum number of replicas to wait for before starting a diskless sync.

Source

pub fn repl_ping_replica_period(self, seconds: u32) -> Self

Set the interval in seconds between PING commands sent to the master.

Source

pub fn repl_timeout(self, seconds: u32) -> Self

Set the replication timeout in seconds.

Source

pub fn replica_announce_ip(self, ip: impl Into<String>) -> Self

Set the IP address a replica announces to the master.

Source

pub fn replica_announce_port(self, port: u16) -> Self

Set the port a replica announces to the master.

Source

pub fn replica_announced(self, announced: bool) -> Self

Control whether the replica is announced to clients.

Source

pub fn replica_full_sync_buffer_limit(self, size: impl Into<String>) -> Self

Set the buffer limit for full synchronization on replicas (e.g. "256mb").

Source

pub fn replica_ignore_disk_write_errors(self, ignore: bool) -> Self

Control whether replicas ignore disk-write errors.

Source

pub fn replica_ignore_maxmemory(self, ignore: bool) -> Self

Control whether replicas ignore the maxmemory setting.

Source

pub fn replica_lazy_flush(self, enable: bool) -> Self

Enable or disable lazy flush on replicas during full sync.

Source

pub fn replica_priority(self, priority: u32) -> Self

Set the replica priority for Sentinel promotion.

Source

pub fn replica_read_only(self, read_only: bool) -> Self

Control whether the replica is read-only.

Source

pub fn replica_serve_stale_data(self, serve: bool) -> Self

Control whether the replica serves stale data while syncing.

Source

pub fn min_replicas_to_write(self, n: u32) -> Self

Set the minimum number of replicas that must acknowledge writes.

Source

pub fn min_replicas_max_lag(self, seconds: u32) -> Self

Set the maximum replication lag (in seconds) for a replica to count toward min-replicas-to-write.

Source

pub fn password(self, password: impl Into<String>) -> Self

Set a requirepass password for client connections.

Source

pub fn acl_file(self, path: impl Into<PathBuf>) -> Self

Set the path to an ACL file.

Source

pub fn cluster_enabled(self, enabled: bool) -> Self

Enable Redis Cluster mode.

Source

pub fn cluster_node_timeout(self, ms: u64) -> Self

Set the cluster node timeout in milliseconds.

Source

pub fn cluster_config_file(self, path: impl Into<PathBuf>) -> Self

Set a custom cluster config file path (overrides auto-generated default).

Source

pub fn cluster_require_full_coverage(self, require: bool) -> Self

Require full hash slot coverage for the cluster to accept writes.

Source

pub fn cluster_allow_reads_when_down(self, allow: bool) -> Self

Allow reads when the cluster is down.

Source

pub fn cluster_allow_pubsubshard_when_down(self, allow: bool) -> Self

Allow pubsub shard channels when the cluster is down.

Source

pub fn cluster_allow_replica_migration(self, allow: bool) -> Self

Allow automatic replica migration between masters.

Source

pub fn cluster_migration_barrier(self, barrier: u32) -> Self

Set the minimum number of replicas a master must retain before one can migrate.

Source

pub fn cluster_replica_no_failover(self, no_failover: bool) -> Self

Prevent this replica from ever attempting a failover.

Source

pub fn cluster_replica_validity_factor(self, factor: u32) -> Self

Set the replica validity factor (multiplied by node timeout).

Source

pub fn cluster_announce_ip(self, ip: impl Into<String>) -> Self

Set the IP address this node announces to the cluster bus.

Source

pub fn cluster_announce_port(self, port: u16) -> Self

Set the client port this node announces to the cluster.

Source

pub fn cluster_announce_bus_port(self, port: u16) -> Self

Set the cluster bus port this node announces.

Source

pub fn cluster_announce_tls_port(self, port: u16) -> Self

Set the TLS port this node announces to the cluster.

Source

pub fn cluster_announce_hostname(self, hostname: impl Into<String>) -> Self

Set the hostname this node announces to the cluster.

Source

pub fn cluster_announce_human_nodename(self, name: impl Into<String>) -> Self

Set the human-readable node name announced to the cluster.

Source

pub fn cluster_port(self, port: u16) -> Self

Set the dedicated cluster bus port (0 = auto with +10000 offset).

Source

pub fn cluster_preferred_endpoint_type( self, endpoint_type: impl Into<String>, ) -> Self

Set the preferred endpoint type for cluster redirections (e.g. "ip", "hostname").

Set the send buffer limit in bytes for cluster bus links.

Source

pub fn cluster_compatibility_sample_ratio(self, ratio: u32) -> Self

Set the compatibility sample ratio percentage.

Source

pub fn cluster_slot_migration_handoff_max_lag_bytes(self, bytes: u64) -> Self

Set the maximum lag in bytes before slot migration handoff.

Source

pub fn cluster_slot_migration_write_pause_timeout(self, ms: u64) -> Self

Set the write pause timeout in milliseconds during slot migration.

Source

pub fn cluster_slot_stats_enabled(self, enable: bool) -> Self

Enable per-slot statistics collection.

Source

pub fn hash_max_listpack_entries(self, n: u32) -> Self

Set the maximum number of entries in a hash before converting from listpack to hash table.

Source

pub fn hash_max_listpack_value(self, n: u32) -> Self

Set the maximum size of a hash entry value before converting from listpack to hash table.

Source

pub fn list_max_listpack_size(self, n: i32) -> Self

Set the maximum listpack size for list entries.

Positive values limit the number of elements per listpack node. Negative values set a byte-size limit: -1 = 4KB, -2 = 8KB, -3 = 16KB, -4 = 32KB, -5 = 64KB.

Source

pub fn list_compress_depth(self, n: u32) -> Self

Set the number of quicklist nodes at each end of the list that are not compressed.

0 disables compression. 1 means the head and tail are uncompressed, etc.

Source

pub fn set_max_intset_entries(self, n: u32) -> Self

Set the maximum number of integer entries in a set before converting from intset to hash table.

Source

pub fn set_max_listpack_entries(self, n: u32) -> Self

Set the maximum number of entries in a set before converting from listpack to hash table.

Source

pub fn set_max_listpack_value(self, n: u32) -> Self

Set the maximum size of a set entry value before converting from listpack to hash table.

Source

pub fn zset_max_listpack_entries(self, n: u32) -> Self

Set the maximum number of entries in a sorted set before converting from listpack to skiplist.

Source

pub fn zset_max_listpack_value(self, n: u32) -> Self

Set the maximum size of a sorted set entry value before converting from listpack to skiplist.

Source

pub fn hll_sparse_max_bytes(self, n: u32) -> Self

Set the maximum number of bytes for the sparse representation of a HyperLogLog.

Source

pub fn stream_node_max_bytes(self, n: u32) -> Self

Set the maximum number of bytes in a single stream listpack node.

Source

pub fn stream_node_max_entries(self, n: u32) -> Self

Set the maximum number of entries in a single stream listpack node.

Source

pub fn stream_idmp_duration(self, ms: u64) -> Self

Set the duration in milliseconds for stream ID de-duplication.

Source

pub fn stream_idmp_maxsize(self, n: u64) -> Self

Set the maximum number of entries tracked for stream ID de-duplication.

Source

pub fn loadmodule(self, path: impl Into<PathBuf>) -> Self

Load a Redis module at startup.

Source

pub fn hz(self, hz: u32) -> Self

Set the server tick frequency in Hz (default: 10).

Source

pub fn io_threads(self, n: u32) -> Self

Set the number of I/O threads.

Source

pub fn io_threads_do_reads(self, enable: bool) -> Self

Enable I/O threads for reads as well as writes.

Source

pub fn notify_keyspace_events(self, events: impl Into<String>) -> Self

Set keyspace notification events (e.g. "KEA").

Source

pub fn slowlog_log_slower_than(self, us: i64) -> Self

Set the slow log threshold in microseconds (0 = log everything, -1 = disabled).

Source

pub fn slowlog_max_len(self, n: u32) -> Self

Set the maximum number of slow log entries.

Source

pub fn latency_monitor_threshold(self, ms: u64) -> Self

Set the latency monitor threshold in milliseconds (0 = disabled).

Source

pub fn latency_tracking(self, enable: bool) -> Self

Enable or disable the extended latency tracking system.

Source

pub fn latency_tracking_info_percentiles( self, percentiles: impl Into<String>, ) -> Self

Set percentiles reported by the latency tracking system (e.g. "50 99 99.9").

Source

pub fn activedefrag(self, enable: bool) -> Self

Enable or disable active defragmentation.

Source

pub fn active_defrag_ignore_bytes(self, bytes: impl Into<String>) -> Self

Set the minimum fragmentation waste to start defragmentation (e.g. "100mb").

Source

pub fn active_defrag_threshold_lower(self, pct: u32) -> Self

Set the minimum fragmentation percentage to start defragmentation.

Source

pub fn active_defrag_threshold_upper(self, pct: u32) -> Self

Set the fragmentation percentage at which maximum effort is used.

Source

pub fn active_defrag_cycle_min(self, pct: u32) -> Self

Set the minimal CPU effort for defragmentation (percentage).

Source

pub fn active_defrag_cycle_max(self, pct: u32) -> Self

Set the maximum CPU effort for defragmentation (percentage).

Source

pub fn active_defrag_max_scan_fields(self, n: u32) -> Self

Set the maximum fields processed per defrag scan step.

Source

pub fn syslog_enabled(self, enable: bool) -> Self

Enable logging to syslog.

Source

pub fn syslog_ident(self, ident: impl Into<String>) -> Self

Set the syslog identity string.

Source

pub fn syslog_facility(self, facility: impl Into<String>) -> Self

Set the syslog facility (e.g. "local0").

Source

pub fn supervised(self, mode: impl Into<String>) -> Self

Set the supervision mode ("upstart", "systemd", "auto", or "no").

Show the Redis logo on startup.

Source

pub fn set_proc_title(self, enable: bool) -> Self

Enable setting the process title.

Source

pub fn proc_title_template(self, template: impl Into<String>) -> Self

Set the process title template.

Source

pub fn acl_pubsub_default(self, default: impl Into<String>) -> Self

Set the default pub/sub ACL permissions ("allchannels" or "resetchannels").

Source

pub fn acllog_max_len(self, n: u32) -> Self

Set the maximum length of the ACL log.

Source

pub fn enable_debug_command(self, mode: impl Into<String>) -> Self

Enable the DEBUG command ("yes", "local", or "no").

Source

pub fn enable_module_command(self, mode: impl Into<String>) -> Self

Enable the MODULE command ("yes", "local", or "no").

Source

pub fn enable_protected_configs(self, mode: impl Into<String>) -> Self

Allow CONFIG SET to modify protected configs ("yes", "local", or "no").

Source

pub fn rename_command( self, command: impl Into<String>, new_name: impl Into<String>, ) -> Self

Rename a command. Pass an empty new name to disable the command entirely.

Source

pub fn sanitize_dump_payload(self, mode: impl Into<String>) -> Self

Set dump payload sanitization mode ("yes", "no", or "clients").

Source

pub fn hide_user_data_from_log(self, enable: bool) -> Self

Hide user data from log messages.

Source

pub fn bind_source_addr(self, addr: impl Into<String>) -> Self

Set the source address for outgoing connections.

Source

pub fn busy_reply_threshold(self, ms: u64) -> Self

Set the busy reply threshold in milliseconds.

Source

pub fn client_output_buffer_limit(self, limit: impl Into<String>) -> Self

Add a client output buffer limit (e.g. "normal 0 0 0" or "replica 256mb 64mb 60").

Source

pub fn client_query_buffer_limit(self, limit: impl Into<String>) -> Self

Set the maximum size of a single client query buffer.

Source

pub fn proto_max_bulk_len(self, len: impl Into<String>) -> Self

Set the maximum size of a single protocol bulk request.

Source

pub fn max_new_connections_per_cycle(self, n: u32) -> Self

Set the maximum number of new connections per event loop cycle.

Source

pub fn max_new_tls_connections_per_cycle(self, n: u32) -> Self

Set the maximum number of new TLS connections per event loop cycle.

Source

pub fn socket_mark_id(self, id: u32) -> Self

Set the socket mark ID for outgoing connections.

Source

pub fn dbfilename(self, name: impl Into<String>) -> Self

Set the RDB dump filename.

Source

pub fn rdbcompression(self, enable: bool) -> Self

Enable or disable RDB compression.

Source

pub fn rdbchecksum(self, enable: bool) -> Self

Enable or disable RDB checksum.

Source

pub fn rdb_save_incremental_fsync(self, enable: bool) -> Self

Enable incremental fsync during RDB save.

Source

pub fn rdb_del_sync_files(self, enable: bool) -> Self

Delete RDB sync files used by diskless replication.

Source

pub fn stop_writes_on_bgsave_error(self, enable: bool) -> Self

Stop accepting writes when bgsave fails.

Source

pub fn shutdown_on_sigint(self, behavior: impl Into<String>) -> Self

Set shutdown behavior on SIGINT (e.g. "default", "save", "nosave").

Source

pub fn shutdown_on_sigterm(self, behavior: impl Into<String>) -> Self

Set shutdown behavior on SIGTERM.

Source

pub fn shutdown_timeout(self, seconds: u32) -> Self

Set the maximum seconds to wait during shutdown for lagging replicas.

Source

pub fn activerehashing(self, enable: bool) -> Self

Enable or disable active rehashing.

Source

pub fn crash_log_enabled(self, enable: bool) -> Self

Enable crash log on crash.

Source

pub fn crash_memcheck_enabled(self, enable: bool) -> Self

Enable crash memory check on crash.

Source

pub fn disable_thp(self, enable: bool) -> Self

Disable transparent huge pages.

Source

pub fn dynamic_hz(self, enable: bool) -> Self

Enable dynamic Hz adjustment.

Source

pub fn ignore_warnings(self, warning: impl Into<String>) -> Self

Ignore specific warnings (e.g. "ARM64-COW-BUG").

Source

pub fn include(self, path: impl Into<PathBuf>) -> Self

Include another config file.

Source

pub fn jemalloc_bg_thread(self, enable: bool) -> Self

Enable or disable jemalloc background thread.

Source

pub fn locale_collate(self, locale: impl Into<String>) -> Self

Set the locale collation setting.

Source

pub fn lua_time_limit(self, ms: u64) -> Self

Set the Lua script time limit in milliseconds.

Source

pub fn oom_score_adj(self, mode: impl Into<String>) -> Self

Set the OOM score adjustment mode ("yes", "no", or "absolute").

Source

pub fn oom_score_adj_values(self, values: impl Into<String>) -> Self

Set the OOM score adjustment values (e.g. "0 200 800").

Source

pub fn propagation_error_behavior(self, behavior: impl Into<String>) -> Self

Set the propagation error behavior ("panic" or "ignore").

Source

pub fn tracking_table_max_keys(self, n: u64) -> Self

Set the maximum number of keys in the tracking table.

Source

pub fn redis_server_bin(self, bin: impl Into<String>) -> Self

Set a custom redis-server binary path.

Source

pub fn redis_cli_bin(self, bin: impl Into<String>) -> Self

Set a custom redis-cli binary path.

Source

pub fn extra(self, key: impl Into<String>, value: impl Into<String>) -> Self

Set an arbitrary config directive not covered by dedicated methods.

Source

pub async fn start(self) -> Result<RedisServerHandle>

Start the server. Returns a handle that stops the server on Drop.

Verifies that redis-server and redis-cli binaries are available before attempting to launch anything.

Trait Implementations§

Source§

impl Default for RedisServer

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.