pub struct UnitsServiceClient<T>(/* private fields */);
Expand description
The Units Service serves as a comprehensive catalog of the units of measurement supported by scout. Units, by default, follow the UCUM convention for representation.
Implementations§
Source§impl<T> UnitsServiceClient<T>where
T: Client,
impl<T> UnitsServiceClient<T>where
T: Client,
Sourcepub fn get_all_units(
&self,
auth_: &BearerToken,
) -> Result<GetUnitsResponse, Error>
pub fn get_all_units( &self, auth_: &BearerToken, ) -> Result<GetUnitsResponse, Error>
Returns all known units, grouped by the physical property they measure.
Sourcepub fn get_unit(
&self,
auth_: &BearerToken,
unit: &UnitSymbol,
) -> Result<Option<Unit>, Error>
pub fn get_unit( &self, auth_: &BearerToken, unit: &UnitSymbol, ) -> Result<Option<Unit>, Error>
Returns information for a unit symbol if available. Returns as empty if the provided symbol cannot be parsed.
Sourcepub fn get_commensurable_units(
&self,
auth_: &BearerToken,
unit: &UnitSymbol,
) -> Result<BTreeSet<Unit>, Error>
pub fn get_commensurable_units( &self, auth_: &BearerToken, unit: &UnitSymbol, ) -> Result<BTreeSet<Unit>, Error>
Returns the set of cataloged units that can be converted to and from the given unit. No commensurable units does not imply the unit is invalid. Use /get-unit to check for validity.
Trait Implementations§
Source§impl<T: Clone> Clone for UnitsServiceClient<T>
impl<T: Clone> Clone for UnitsServiceClient<T>
Source§fn clone(&self) -> UnitsServiceClient<T>
fn clone(&self) -> UnitsServiceClient<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for UnitsServiceClient<T>
impl<T: Debug> Debug for UnitsServiceClient<T>
Auto Trait Implementations§
impl<T> Freeze for UnitsServiceClient<T>where
T: Freeze,
impl<T> RefUnwindSafe for UnitsServiceClient<T>where
T: RefUnwindSafe,
impl<T> Send for UnitsServiceClient<T>where
T: Send,
impl<T> Sync for UnitsServiceClient<T>where
T: Sync,
impl<T> Unpin for UnitsServiceClient<T>where
T: Unpin,
impl<T> UnwindSafe for UnitsServiceClient<T>where
T: UnwindSafe,
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