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 RefFromWasmAbi for Acute32SymcodeMain
impl RefFromWasmAbi for Acute32SymcodeMain
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 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 VectorIntoJsValue for Acute32SymcodeMain
impl VectorIntoJsValue for Acute32SymcodeMain
fn vector_into_jsvalue(vector: Box<[Acute32SymcodeMain]>) -> JsValue
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 !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::Abi
Source§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
.