pub struct UnitsServiceAsyncClient<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> UnitsServiceAsyncClient<T>where
T: AsyncClient,
impl<T> UnitsServiceAsyncClient<T>where
T: AsyncClient,
Sourcepub async fn get_all_units(
&self,
auth_: &BearerToken,
) -> Result<GetUnitsResponse, Error>
pub async fn get_all_units( &self, auth_: &BearerToken, ) -> Result<GetUnitsResponse, Error>
Returns all known units, grouped by the physical property they measure.
Sourcepub async fn get_unit(
&self,
auth_: &BearerToken,
unit: &UnitSymbol,
) -> Result<Option<Unit>, Error>
pub async 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 async fn get_commensurable_units(
&self,
auth_: &BearerToken,
unit: &UnitSymbol,
) -> Result<BTreeSet<Unit>, Error>
pub async 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> AsyncService<T> for UnitsServiceAsyncClient<T>where
T: AsyncClient,
impl<T> AsyncService<T> for UnitsServiceAsyncClient<T>where
T: AsyncClient,
Source§impl<T: Clone> Clone for UnitsServiceAsyncClient<T>
impl<T: Clone> Clone for UnitsServiceAsyncClient<T>
Source§fn clone(&self) -> UnitsServiceAsyncClient<T>
fn clone(&self) -> UnitsServiceAsyncClient<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 moreAuto Trait Implementations§
impl<T> Freeze for UnitsServiceAsyncClient<T>where
T: Freeze,
impl<T> RefUnwindSafe for UnitsServiceAsyncClient<T>where
T: RefUnwindSafe,
impl<T> Send for UnitsServiceAsyncClient<T>where
T: Send,
impl<T> Sync for UnitsServiceAsyncClient<T>where
T: Sync,
impl<T> Unpin for UnitsServiceAsyncClient<T>where
T: Unpin,
impl<T> UnwindSafe for UnitsServiceAsyncClient<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