pub struct Scoped {
pub scope: PreferenceScope,
pub value: PreferenceValue,
}Expand description
A value paired with the scope its required_scope says it must be stored
under. Construction enforces the rule; the fields are public so the store
can read them, but a wrong pairing cannot be constructed.
Fields§
§scope: PreferenceScope§value: PreferenceValueImplementations§
Source§impl Scoped
impl Scoped
Sourcepub fn new(
scope: PreferenceScope,
value: PreferenceValue,
) -> Result<Self, ContractError>
pub fn new( scope: PreferenceScope, value: PreferenceValue, ) -> Result<Self, ContractError>
Pairs a value with the scope it requires. Returns the typed error if the
caller’s scope does not match the value’s required_scope.
Trait Implementations§
impl Eq for Scoped
impl StructuralPartialEq for Scoped
Auto Trait Implementations§
impl Freeze for Scoped
impl RefUnwindSafe for Scoped
impl Send for Scoped
impl Sync for Scoped
impl Unpin for Scoped
impl UnsafeUnpin for Scoped
impl UnwindSafe for Scoped
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