pub struct Serials { /* private fields */ }Implementations§
Source§impl Serials
impl Serials
pub fn into_reference(val: Serials, env: Env) -> Result<Reference<Serials>>
pub fn into_instance(self, env: Env) -> Result<ClassInstance<Serials>>
Source§impl Serials
impl Serials
Sourcepub async fn create(&self, input: CreateSerialInput) -> Result<SerialOutput>
pub async fn create(&self, input: CreateSerialInput) -> Result<SerialOutput>
Create a serial number
Sourcepub async fn get_by_serial(
&self,
serial: String,
) -> Result<Option<SerialOutput>>
pub async fn get_by_serial( &self, serial: String, ) -> Result<Option<SerialOutput>>
Get a serial by serial number string
Sourcepub async fn list(&self) -> Result<Vec<SerialOutput>>
pub async fn list(&self) -> Result<Vec<SerialOutput>>
List all serials
Sourcepub async fn get_available(
&self,
sku: String,
limit: u32,
) -> Result<Vec<SerialOutput>>
pub async fn get_available( &self, sku: String, limit: u32, ) -> Result<Vec<SerialOutput>>
Get available serials for a SKU
Sourcepub async fn mark_sold(
&self,
id: String,
customer_id: String,
order_id: Option<String>,
) -> Result<SerialOutput>
pub async fn mark_sold( &self, id: String, customer_id: String, order_id: Option<String>, ) -> Result<SerialOutput>
Mark a serial as sold
Sourcepub async fn quarantine(
&self,
id: String,
reason: String,
) -> Result<SerialOutput>
pub async fn quarantine( &self, id: String, reason: String, ) -> Result<SerialOutput>
Quarantine a serial
Sourcepub async fn is_available(&self, serial: String) -> Result<bool>
pub async fn is_available(&self, serial: String) -> Result<bool>
Check if a serial is available
Trait Implementations§
Source§impl FromNapiMutRef for Serials
impl FromNapiMutRef for Serials
Source§unsafe fn from_napi_mut_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static mut Self>
unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>
Safety Read more
Source§impl FromNapiRef for Serials
impl FromNapiRef for Serials
Source§unsafe fn from_napi_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static Self>
unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>
Safety Read more
Source§impl FromNapiValue for &Serials
impl FromNapiValue for &Serials
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl FromNapiValue for &mut Serials
impl FromNapiValue for &mut Serials
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl ToNapiValue for Serials
impl ToNapiValue for Serials
Source§unsafe fn to_napi_value(env: napi_env, val: Serials) -> Result<napi_value>
unsafe fn to_napi_value(env: napi_env, val: Serials) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &Serials
impl ValidateNapiValue for &Serials
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &mut Serials
impl ValidateNapiValue for &mut Serials
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Auto Trait Implementations§
impl Freeze for Serials
impl !RefUnwindSafe for Serials
impl Send for Serials
impl Sync for Serials
impl Unpin for Serials
impl UnsafeUnpin for Serials
impl !UnwindSafe for Serials
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