Struct ManagedSettingsClient
pub struct ManagedSettingsClient {
profile: Arc<RwLock<Option<ManagementProfile>>>,
}Expand description
Handle to the host system’s Unified Endpoint Management profile.
The host application constructs one of these at boot and pushes profiles into it, and hands its
cell to
[bitwarden_core::ClientBuilder::with_managed_profile] so the SDK reads the same profile.
Clones share the underlying profile, so an update pushed through one clone is observed by all of
them.
Fields§
§profile: Arc<RwLock<Option<ManagementProfile>>>Implementations§
§impl ManagedSettingsClient
Methods whose signatures cannot cross an FFI boundary, so they stay off the binding surface.
impl ManagedSettingsClient
Methods whose signatures cannot cross an FFI boundary, so they stay off the binding surface.
pub fn cell(&self) -> Arc<RwLock<Option<ManagementProfile>>> ⓘ
pub fn cell(&self) -> Arc<RwLock<Option<ManagementProfile>>> ⓘ
The shared profile cell, for handing to
[bitwarden_core::ClientBuilder::with_managed_profile] so a constructed SDK client reads
the same profile the host pushes into this handle.
pub fn current_profile(&self) -> Option<ManagementProfile>
pub fn current_profile(&self) -> Option<ManagementProfile>
The active profile, or None when the host has not pushed one.
§impl ManagedSettingsClient
impl ManagedSettingsClient
pub fn new() -> ManagedSettingsClient
pub fn new() -> ManagedSettingsClient
Fresh handle with no active profile. The host should call this once at boot.
pub fn update_profile(&self, profile: Option<ManagementProfile>)
pub fn update_profile(&self, profile: Option<ManagementProfile>)
Replace the active profile. Clear the profile with None.
pub fn is_managed(&self, key: String) -> bool
pub fn is_managed(&self, key: String) -> bool
Returns true if key is present in the active profile.
Trait Implementations§
§impl Clone for ManagedSettingsClient
impl Clone for ManagedSettingsClient
§fn clone(&self) -> ManagedSettingsClient
fn clone(&self) -> ManagedSettingsClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Default for ManagedSettingsClient
impl Default for ManagedSettingsClient
§fn default() -> ManagedSettingsClient
fn default() -> ManagedSettingsClient
§impl FromWasm for ManagedSettingsClient
Available on crate feature wasm only.
impl FromWasm for ManagedSettingsClient
wasm only.§type Wire = ManagedSettingsClient
type Wire = ManagedSettingsClient
§fn from_wire(
wire: <ManagedSettingsClient as FromWasm>::Wire,
) -> Result<ManagedSettingsClient, WireError>
fn from_wire( wire: <ManagedSettingsClient as FromWasm>::Wire, ) -> Result<ManagedSettingsClient, WireError>
§impl FromWasmAbi for ManagedSettingsClient
impl FromWasmAbi for ManagedSettingsClient
§type Abi = WasmPtr<WasmRefCell<ManagedSettingsClient>>
type Abi = WasmPtr<WasmRefCell<ManagedSettingsClient>>
§unsafe fn from_abi(
js: <ManagedSettingsClient as FromWasmAbi>::Abi,
) -> ManagedSettingsClient
unsafe fn from_abi( js: <ManagedSettingsClient as FromWasmAbi>::Abi, ) -> ManagedSettingsClient
§impl IntoWasmAbi for ManagedSettingsClient
impl IntoWasmAbi for ManagedSettingsClient
§type Abi = WasmPtr<WasmRefCell<ManagedSettingsClient>>
type Abi = WasmPtr<WasmRefCell<ManagedSettingsClient>>
§fn into_abi(self) -> <ManagedSettingsClient as IntoWasmAbi>::Abi
fn into_abi(self) -> <ManagedSettingsClient as IntoWasmAbi>::Abi
self into Self::Abi so that it can be sent across the wasm
ABI boundary.§impl LongRefFromWasmAbi for ManagedSettingsClient
impl LongRefFromWasmAbi for ManagedSettingsClient
§type Abi = WasmPtr<WasmRefCell<ManagedSettingsClient>>
type Abi = WasmPtr<WasmRefCell<ManagedSettingsClient>>
RefFromWasmAbi::Abi§type Anchor = RcRef<ManagedSettingsClient>
type Anchor = RcRef<ManagedSettingsClient>
RefFromWasmAbi::Anchor§unsafe fn long_ref_from_abi(
js: <ManagedSettingsClient as LongRefFromWasmAbi>::Abi,
) -> <ManagedSettingsClient as LongRefFromWasmAbi>::Anchor
unsafe fn long_ref_from_abi( js: <ManagedSettingsClient as LongRefFromWasmAbi>::Abi, ) -> <ManagedSettingsClient as LongRefFromWasmAbi>::Anchor
RefFromWasmAbi::ref_from_abi§impl NullableFromWasmAbi for ManagedSettingsClient
impl NullableFromWasmAbi for ManagedSettingsClient
§fn is_null(abi: &<ManagedSettingsClient as MaybeFromWasmAbi>::MaybeAbi) -> bool
fn is_null(abi: &<ManagedSettingsClient as MaybeFromWasmAbi>::MaybeAbi) -> bool
Nullable::Null.§impl NullableIntoWasmAbi for ManagedSettingsClient
impl NullableIntoWasmAbi for ManagedSettingsClient
§fn null() -> <ManagedSettingsClient as MaybeIntoWasmAbi>::MaybeAbi
fn null() -> <ManagedSettingsClient as MaybeIntoWasmAbi>::MaybeAbi
§impl OptionFromWasmAbi for ManagedSettingsClient
impl OptionFromWasmAbi for ManagedSettingsClient
§fn is_none(abi: &<ManagedSettingsClient as FromWasmAbi>::Abi) -> bool
fn is_none(abi: &<ManagedSettingsClient as FromWasmAbi>::Abi) -> bool
None, and otherwise it will be passed to
FromWasmAbi.§impl OptionIntoWasmAbi for ManagedSettingsClient
impl OptionIntoWasmAbi for ManagedSettingsClient
§fn none() -> <ManagedSettingsClient as IntoWasmAbi>::Abi
fn none() -> <ManagedSettingsClient as IntoWasmAbi>::Abi
None branch of this option. Read more§impl RefFromWasmAbi for ManagedSettingsClient
impl RefFromWasmAbi for ManagedSettingsClient
§type Abi = WasmPtr<WasmRefCell<ManagedSettingsClient>>
type Abi = WasmPtr<WasmRefCell<ManagedSettingsClient>>
Self are recovered from.§type Anchor = RcRef<ManagedSettingsClient>
type Anchor = RcRef<ManagedSettingsClient>
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.§unsafe fn ref_from_abi(
js: <ManagedSettingsClient as RefFromWasmAbi>::Abi,
) -> <ManagedSettingsClient as RefFromWasmAbi>::Anchor
unsafe fn ref_from_abi( js: <ManagedSettingsClient as RefFromWasmAbi>::Abi, ) -> <ManagedSettingsClient as RefFromWasmAbi>::Anchor
§impl RefMutFromWasmAbi for ManagedSettingsClient
impl RefMutFromWasmAbi for ManagedSettingsClient
§type Abi = WasmPtr<WasmRefCell<ManagedSettingsClient>>
type Abi = WasmPtr<WasmRefCell<ManagedSettingsClient>>
RefFromWasmAbi::Abi§type Anchor = RcRefMut<ManagedSettingsClient>
type Anchor = RcRefMut<ManagedSettingsClient>
RefFromWasmAbi::Anchor§unsafe fn ref_mut_from_abi(
js: <ManagedSettingsClient as RefMutFromWasmAbi>::Abi,
) -> <ManagedSettingsClient as RefMutFromWasmAbi>::Anchor
unsafe fn ref_mut_from_abi( js: <ManagedSettingsClient as RefMutFromWasmAbi>::Abi, ) -> <ManagedSettingsClient as RefMutFromWasmAbi>::Anchor
RefFromWasmAbi::ref_from_abi§impl ToWasm for ManagedSettingsClient
Available on crate feature wasm only.
impl ToWasm for ManagedSettingsClient
wasm only.§type Wire = ManagedSettingsClient
type Wire = ManagedSettingsClient
§fn to_wire(self) -> Result<<ManagedSettingsClient as ToWasm>::Wire, WireError>
fn to_wire(self) -> Result<<ManagedSettingsClient as ToWasm>::Wire, WireError>
§impl TryFromJsValue for ManagedSettingsClient
impl TryFromJsValue for ManagedSettingsClient
§fn try_from_js_value(value: JsValue) -> Result<ManagedSettingsClient, JsValue>
fn try_from_js_value(value: JsValue) -> Result<ManagedSettingsClient, JsValue>
§fn try_from_js_value_ref(value: &JsValue) -> Option<ManagedSettingsClient>
fn try_from_js_value_ref(value: &JsValue) -> Option<ManagedSettingsClient>
Source§const NULLABLE: bool = false
const NULLABLE: bool = false
Self accepts null as a distinct value space, as
Nullable<T> does. An enclosing Option then passes null through
instead of reading it as None, so Option<T> is itself nullable
exactly when T is not. JsValue does not set this: it accepts
null as one value among all of them, not as a distinct space, and
Option<JsValue> reads it as None like the ABI does. This is the
JS-value side of NullableFromWasmAbi, which claims null at the
ABI.§impl VectorFromWasmAbi for ManagedSettingsClient
impl VectorFromWasmAbi for ManagedSettingsClient
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi( js: <ManagedSettingsClient as VectorFromWasmAbi>::Abi, ) -> Box<[ManagedSettingsClient]>
§impl VectorIntoWasmAbi for ManagedSettingsClient
impl VectorIntoWasmAbi for ManagedSettingsClient
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi( vector: Box<[ManagedSettingsClient]>, ) -> <ManagedSettingsClient as VectorIntoWasmAbi>::Abi
Auto Trait Implementations§
impl Freeze for ManagedSettingsClient
impl RefUnwindSafe for ManagedSettingsClient
impl Send for ManagedSettingsClient
impl Sync for ManagedSettingsClient
impl Unpin for ManagedSettingsClient
impl UnsafeUnpin for ManagedSettingsClient
impl UnwindSafe for ManagedSettingsClient
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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 moreSource§impl<T> MaybeFromWasmAbi for Twhere
T: OptionFromWasmAbi,
impl<T> MaybeFromWasmAbi for Twhere
T: OptionFromWasmAbi,
Source§type MaybeAbi = <T as FromWasmAbi>::Abi
type MaybeAbi = <T as FromWasmAbi>::Abi
Option<Self>.Source§unsafe fn from_maybe_abi(js: <T as FromWasmAbi>::Abi) -> T
unsafe fn from_maybe_abi(js: <T as FromWasmAbi>::Abi) -> T
unsafe fn try_from_maybe_abi( js: <T as FromWasmAbi>::Abi, ) -> Result<T, &'static str>
Source§impl<T> MaybeIntoWasmAbi for Twhere
T: OptionIntoWasmAbi,
impl<T> MaybeIntoWasmAbi for Twhere
T: OptionIntoWasmAbi,
Source§type MaybeAbi = <T as IntoWasmAbi>::Abi
type MaybeAbi = <T as IntoWasmAbi>::Abi
Option<Self>.Source§fn into_maybe_abi(self) -> <T as IntoWasmAbi>::Abi
fn into_maybe_abi(self) -> <T as IntoWasmAbi>::Abi
Option<Self> ABI.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.