#[non_exhaustive]pub struct HostOptions {
pub mc_port: u16,
pub secret_key: Option<SecretKey>,
pub relay_url: Option<RelayUrl>,
pub service_id: ServiceId,
pub token: AccessToken,
pub config: HostConfig,
}Expand description
Host 托管启动参数。
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.mc_port: u16本地 Minecraft 服务端端口。
secret_key: Option<SecretKey>稳定节点密钥;None 表示生成临时密钥。
relay_url: Option<RelayUrl>自定义中继;None 表示使用 iroh 默认中继。
service_id: ServiceId服务标识。由实例管理层在创建服务时生成并持久化。
token: AccessToken当前 Host 会话的访问令牌。
config: HostConfigHost 行为配置。
Implementations§
Source§impl HostOptions
impl HostOptions
Sourcepub fn secret_key(self, secret_key: Option<SecretKey>) -> Self
pub fn secret_key(self, secret_key: Option<SecretKey>) -> Self
设置稳定节点密钥。
Sourcepub fn service_id(self, service_id: ServiceId) -> Self
pub fn service_id(self, service_id: ServiceId) -> Self
设置服务标识。
Sourcepub fn token(self, token: AccessToken) -> Self
pub fn token(self, token: AccessToken) -> Self
设置当前会话访问令牌。
Sourcepub fn config(self, config: HostConfig) -> Self
pub fn config(self, config: HostConfig) -> Self
设置 Host 行为配置。
Trait Implementations§
Source§impl Clone for HostOptions
impl Clone for HostOptions
Source§fn clone(&self) -> HostOptions
fn clone(&self) -> HostOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HostOptions
impl RefUnwindSafe for HostOptions
impl Send for HostOptions
impl Sync for HostOptions
impl Unpin for HostOptions
impl UnsafeUnpin for HostOptions
impl UnwindSafe for HostOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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