pub struct Acute32SymcodeMain { /* private fields */ }Implementations§
Source§impl Acute32SymcodeMain
impl Acute32SymcodeMain
pub fn from_config(config: Acute32SymcodeConfig, seed: u64) -> Self
Source§impl Acute32SymcodeMain
impl Acute32SymcodeMain
pub fn new() -> Self
pub fn seed_rng(&mut self, seed: u64)
Sourcepub fn load_alphabet_from_canvas_id(&mut self, canvas_id: &str)
pub fn load_alphabet_from_canvas_id(&mut self, canvas_id: &str)
Takes the id of the canvas element storing the alphabet.
pub fn scan_from_canvas_id(&self, canvas_id: &str) -> Result<String, JsValue>
pub fn generate_symcode_to_canvas( &self, canvas_id: &str, payload: &str, ) -> Result<String, JsValue>
pub fn generate_random_symcode_to_canvas( &mut self, canvas_id: &str, ) -> Result<String, JsValue>
Trait Implementations§
Source§impl Default for Acute32SymcodeMain
impl Default for Acute32SymcodeMain
Source§impl From<Acute32SymcodeMain> for JsValue
impl From<Acute32SymcodeMain> for JsValue
Source§fn from(value: Acute32SymcodeMain) -> Self
fn from(value: Acute32SymcodeMain) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for Acute32SymcodeMain
impl FromWasmAbi for Acute32SymcodeMain
Source§impl IntoWasmAbi for Acute32SymcodeMain
impl IntoWasmAbi for Acute32SymcodeMain
Source§impl LongRefFromWasmAbi for Acute32SymcodeMain
impl LongRefFromWasmAbi for Acute32SymcodeMain
Source§type Abi = WasmPtr<WasmRefCell<Acute32SymcodeMain>>
type Abi = WasmPtr<WasmRefCell<Acute32SymcodeMain>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRef<Acute32SymcodeMain>
type Anchor = RcRef<Acute32SymcodeMain>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiSource§impl RefFromWasmAbi for Acute32SymcodeMain
impl RefFromWasmAbi for Acute32SymcodeMain
Source§type Abi = WasmPtr<WasmRefCell<Acute32SymcodeMain>>
type Abi = WasmPtr<WasmRefCell<Acute32SymcodeMain>>
The Wasm ABI type references to
Self are recovered from.Source§type Anchor = RcRef<Acute32SymcodeMain>
type Anchor = RcRef<Acute32SymcodeMain>
The type that holds the reference to
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.Source§impl RefMutFromWasmAbi for Acute32SymcodeMain
impl RefMutFromWasmAbi for Acute32SymcodeMain
Source§type Abi = WasmPtr<WasmRefCell<Acute32SymcodeMain>>
type Abi = WasmPtr<WasmRefCell<Acute32SymcodeMain>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRefMut<Acute32SymcodeMain>
type Anchor = RcRefMut<Acute32SymcodeMain>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiSource§impl SymcodeGenerator for Acute32SymcodeMain
impl SymcodeGenerator for Acute32SymcodeMain
type SymcodeRepresentation = Vec<GlyphLabel>
fn generate(&self, symcode: Self::SymcodeRepresentation) -> BinaryImage
Source§impl SymcodeScanner for Acute32SymcodeMain
impl SymcodeScanner for Acute32SymcodeMain
type SymcodeRepresentation = Vec<GlyphLabel>
type Err = JsValue
fn scan( &self, image: ColorImage, ) -> Result<Self::SymcodeRepresentation, Self::Err>
fn decode( &self, symcode: Self::SymcodeRepresentation, ) -> Result<BitVec, Self::Err>
fn scan_and_decode(&self, image: ColorImage) -> Result<BitVec, Self::Err>
Source§impl TryFromJsValue for Acute32SymcodeMain
impl TryFromJsValue for Acute32SymcodeMain
Source§impl VectorFromWasmAbi for Acute32SymcodeMain
impl VectorFromWasmAbi for Acute32SymcodeMain
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Acute32SymcodeMain]>
Source§impl VectorIntoWasmAbi for Acute32SymcodeMain
impl VectorIntoWasmAbi for Acute32SymcodeMain
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Acute32SymcodeMain]>) -> Self::Abi
Source§impl WasmDescribeVector for Acute32SymcodeMain
impl WasmDescribeVector for Acute32SymcodeMain
impl SupportsConstructor for Acute32SymcodeMain
impl SupportsInstanceProperty for Acute32SymcodeMain
impl SupportsStaticProperty for Acute32SymcodeMain
Auto Trait Implementations§
impl Freeze for Acute32SymcodeMain
impl !RefUnwindSafe for Acute32SymcodeMain
impl !Send for Acute32SymcodeMain
impl !Sync for Acute32SymcodeMain
impl Unpin for Acute32SymcodeMain
impl UnsafeUnpin for Acute32SymcodeMain
impl !UnwindSafe for Acute32SymcodeMain
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
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>
Converts
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>
Converts
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> 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
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.