pub struct LockRequestBuilder<'a, S: State = Empty> { /* private fields */ }Expand description
Use builder syntax to set the inputs and finish with build().
Implementations§
Source§impl<'a, S: State> LockRequestBuilder<'a, S>
impl<'a, S: State> LockRequestBuilder<'a, S>
Sourcepub fn build(self) -> LockRequest<'a>where
S: IsComplete,
pub fn build(self) -> LockRequest<'a>where
S: IsComplete,
Finish building and return the requested object
Sourcepub fn key(self, value: &'a str) -> LockRequestBuilder<'a, SetKey<S>>where
S::Key: IsUnset,
pub fn key(self, value: &'a str) -> LockRequestBuilder<'a, SetKey<S>>where
S::Key: IsUnset,
Required.
The key to use for locking.
Sourcepub fn session_id(
self,
value: &'a str,
) -> LockRequestBuilder<'a, SetSessionId<S>>where
S::SessionId: IsUnset,
pub fn session_id(
self,
value: &'a str,
) -> LockRequestBuilder<'a, SetSessionId<S>>where
S::SessionId: IsUnset,
Sourcepub fn maybe_session_id(
self,
value: Option<&'a str>,
) -> LockRequestBuilder<'a, SetSessionId<S>>where
S::SessionId: IsUnset,
pub fn maybe_session_id(
self,
value: Option<&'a str>,
) -> LockRequestBuilder<'a, SetSessionId<S>>where
S::SessionId: IsUnset,
Sourcepub fn namespace(
self,
value: &'a str,
) -> LockRequestBuilder<'a, SetNamespace<S>>where
S::Namespace: IsUnset,
pub fn namespace(
self,
value: &'a str,
) -> LockRequestBuilder<'a, SetNamespace<S>>where
S::Namespace: IsUnset,
Optional (Some / Option setters).
Default: <&'a str as Default>::default().
Specifies the namespace to use. If not provided, the namespace will be inferred from the request’s ACL token, or will default to the default namespace. This is specified as part of the URL as a query parameter. Added in Consul 1.7.0.
Sourcepub fn maybe_namespace(
self,
value: Option<&'a str>,
) -> LockRequestBuilder<'a, SetNamespace<S>>where
S::Namespace: IsUnset,
pub fn maybe_namespace(
self,
value: Option<&'a str>,
) -> LockRequestBuilder<'a, SetNamespace<S>>where
S::Namespace: IsUnset,
Optional (Some / Option setters).
Default: <&'a str as Default>::default().
Specifies the namespace to use. If not provided, the namespace will be inferred from the request’s ACL token, or will default to the default namespace. This is specified as part of the URL as a query parameter. Added in Consul 1.7.0.
Sourcepub fn datacenter(
self,
value: &'a str,
) -> LockRequestBuilder<'a, SetDatacenter<S>>where
S::Datacenter: IsUnset,
pub fn datacenter(
self,
value: &'a str,
) -> LockRequestBuilder<'a, SetDatacenter<S>>where
S::Datacenter: IsUnset,
Sourcepub fn maybe_datacenter(
self,
value: Option<&'a str>,
) -> LockRequestBuilder<'a, SetDatacenter<S>>where
S::Datacenter: IsUnset,
pub fn maybe_datacenter(
self,
value: Option<&'a str>,
) -> LockRequestBuilder<'a, SetDatacenter<S>>where
S::Datacenter: IsUnset,
Sourcepub fn timeout(self, value: Duration) -> LockRequestBuilder<'a, SetTimeout<S>>where
S::Timeout: IsUnset,
pub fn timeout(self, value: Duration) -> LockRequestBuilder<'a, SetTimeout<S>>where
S::Timeout: IsUnset,
Optional (Some / Option setters).
Default: Duration::from_secs(10).
Specifies the duration of a session (between 10s and 86400s). If provided, the session is invalidated if it is not renewed before the TTL expires. The lowest practical TTL should be used to keep the number of managed sessions low. When locks are forcibly expired, such as when following the leader election pattern in an application, sessions may not be reaped for up to double this TTL, so long TTL values (> 1 hour) should be avoided. Defaults to 10 seconds.
Sourcepub fn maybe_timeout(
self,
value: Option<Duration>,
) -> LockRequestBuilder<'a, SetTimeout<S>>where
S::Timeout: IsUnset,
pub fn maybe_timeout(
self,
value: Option<Duration>,
) -> LockRequestBuilder<'a, SetTimeout<S>>where
S::Timeout: IsUnset,
Optional (Some / Option setters).
Default: Duration::from_secs(10).
Specifies the duration of a session (between 10s and 86400s). If provided, the session is invalidated if it is not renewed before the TTL expires. The lowest practical TTL should be used to keep the number of managed sessions low. When locks are forcibly expired, such as when following the leader election pattern in an application, sessions may not be reaped for up to double this TTL, so long TTL values (> 1 hour) should be avoided. Defaults to 10 seconds.
Sourcepub fn behavior(
self,
value: LockExpirationBehavior,
) -> LockRequestBuilder<'a, SetBehavior<S>>where
S::Behavior: IsUnset,
pub fn behavior(
self,
value: LockExpirationBehavior,
) -> LockRequestBuilder<'a, SetBehavior<S>>where
S::Behavior: IsUnset,
Optional (Some / Option setters).
Default: <LockExpirationBehavior as Default>::default().
Controls the behavior to take when a session is invalidated. See also LockExpirationBehavior
Sourcepub fn maybe_behavior(
self,
value: Option<LockExpirationBehavior>,
) -> LockRequestBuilder<'a, SetBehavior<S>>where
S::Behavior: IsUnset,
pub fn maybe_behavior(
self,
value: Option<LockExpirationBehavior>,
) -> LockRequestBuilder<'a, SetBehavior<S>>where
S::Behavior: IsUnset,
Optional (Some / Option setters).
Default: <LockExpirationBehavior as Default>::default().
Controls the behavior to take when a session is invalidated. See also LockExpirationBehavior