diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 015a469..35eb1dd 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,6 +2,5 @@ - \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index ac83df9..d53b75e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -114,6 +114,48 @@ dependencies = [ "arduboy-rust", ] +[[package]] +name = "fxbasicexample" +version = "0.1.0" +dependencies = [ + "arduboy-rust", +] + +[[package]] +name = "fxchompies" +version = "0.1.0" +dependencies = [ + "arduboy-rust", +] + +[[package]] +name = "fxdrawballs" +version = "0.1.0" +dependencies = [ + "arduboy-rust", +] + +[[package]] +name = "fxdrawframes" +version = "0.1.0" +dependencies = [ + "arduboy-rust", +] + +[[package]] +name = "fxhelloworld" +version = "0.1.0" +dependencies = [ + "arduboy-rust", +] + +[[package]] +name = "fxloadgamestate" +version = "0.1.0" +dependencies = [ + "arduboy-rust", +] + [[package]] name = "game" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 8f39a42..22951db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,12 @@ members = [ "Examples/Arduboy-Tutorials/demo6", "Examples/Arduboy-Tutorials/demo7", "Examples/Arduboy-Tutorials/demo9", + "Examples/ArduboyFX/fxbasicexample", + "Examples/ArduboyFX/fxchompies", + "Examples/ArduboyFX/fxdrawballs", + "Examples/ArduboyFX/fxdrawframes", + "Examples/ArduboyFX/fxhelloworld", + "Examples/ArduboyFX/fxloadgamestate", "Examples/drboy", "Examples/ardvoice", "Examples/rustacean", diff --git a/Examples/Arduboy-Tutorials/progmem/src/lib.rs b/Examples/Arduboy-Tutorials/progmem/src/lib.rs index f84c37f..01a1d18 100644 --- a/Examples/Arduboy-Tutorials/progmem/src/lib.rs +++ b/Examples/Arduboy-Tutorials/progmem/src/lib.rs @@ -5,7 +5,7 @@ //Include the Arduboy Library //Initialize the arduboy object use arduboy_rust::prelude::*; -use arduboy_tone::arduboy_tone_pitch::*; +use arduboy_tones::tones_pitch::*; const arduboy: Arduboy2 = Arduboy2::new(); const sound: ArduboyTones = ArduboyTones::new(); // Progmem data diff --git a/Examples/Arduboy-Tutorials/tone/src/lib.rs b/Examples/Arduboy-Tutorials/tone/src/lib.rs index 6b62ac1..a486a2c 100644 --- a/Examples/Arduboy-Tutorials/tone/src/lib.rs +++ b/Examples/Arduboy-Tutorials/tone/src/lib.rs @@ -4,7 +4,7 @@ //Initialize the arduboy object #[allow(unused_imports)] use arduboy_rust::prelude::*; -use arduboy_tone::arduboy_tone_pitch::*; +use arduboy_tones::tones_pitch::*; const arduboy: Arduboy2 = Arduboy2::new(); const sound: ArduboyTones = ArduboyTones::new(); const NDUR: u16 = 100; diff --git a/Examples/ArduboyFX/fxbasicexample/Cargo.toml b/Examples/ArduboyFX/fxbasicexample/Cargo.toml new file mode 100644 index 0000000..20e256f --- /dev/null +++ b/Examples/ArduboyFX/fxbasicexample/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "fxbasicexample" +version = "0.1.0" +authors = ["ZennDev "] +edition = "2021" + +[lib] +crate-type = ["staticlib"] + +[dependencies] +arduboy-rust = { path = "../../../arduboy-rust" } diff --git a/Examples/ArduboyFX/fxbasicexample/src/lib.rs b/Examples/ArduboyFX/fxbasicexample/src/lib.rs new file mode 100644 index 0000000..2ee7bdf --- /dev/null +++ b/Examples/ArduboyFX/fxbasicexample/src/lib.rs @@ -0,0 +1,20 @@ +#![no_std] +#![allow(non_upper_case_globals)] +//Include the Arduboy Library +//Initialize the arduboy object +use arduboy_rust::prelude::*; +const arduboy: Arduboy2 = Arduboy2::new(); +//The setup() function runs once when you turn your Arduboy on +#[no_mangle] +pub unsafe extern "C" fn setup() { + // put your setup code here, to run once: + arduboy.begin(); + arduboy.clear(); + arduboy.print(f!(b"Holmes is cool!\0")); + arduboy.display(); +} +#[no_mangle] +#[export_name = "loop"] +pub unsafe extern "C" fn loop_() { + // put your main code here, to run repeatedly: +} diff --git a/Examples/ArduboyFX/fxchompies/Cargo.toml b/Examples/ArduboyFX/fxchompies/Cargo.toml new file mode 100644 index 0000000..cebe528 --- /dev/null +++ b/Examples/ArduboyFX/fxchompies/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "fxchompies" +version = "0.1.0" +authors = ["ZennDev "] +edition = "2021" + +[lib] +crate-type = ["staticlib"] + +[dependencies] +arduboy-rust = { path = "../../../arduboy-rust" } diff --git a/Examples/ArduboyFX/fxchompies/src/lib.rs b/Examples/ArduboyFX/fxchompies/src/lib.rs new file mode 100644 index 0000000..2ee7bdf --- /dev/null +++ b/Examples/ArduboyFX/fxchompies/src/lib.rs @@ -0,0 +1,20 @@ +#![no_std] +#![allow(non_upper_case_globals)] +//Include the Arduboy Library +//Initialize the arduboy object +use arduboy_rust::prelude::*; +const arduboy: Arduboy2 = Arduboy2::new(); +//The setup() function runs once when you turn your Arduboy on +#[no_mangle] +pub unsafe extern "C" fn setup() { + // put your setup code here, to run once: + arduboy.begin(); + arduboy.clear(); + arduboy.print(f!(b"Holmes is cool!\0")); + arduboy.display(); +} +#[no_mangle] +#[export_name = "loop"] +pub unsafe extern "C" fn loop_() { + // put your main code here, to run repeatedly: +} diff --git a/Examples/ArduboyFX/fxdrawballs/Cargo.toml b/Examples/ArduboyFX/fxdrawballs/Cargo.toml new file mode 100644 index 0000000..22a89e8 --- /dev/null +++ b/Examples/ArduboyFX/fxdrawballs/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "fxdrawballs" +version = "0.1.0" +authors = ["ZennDev "] +edition = "2021" + +[lib] +crate-type = ["staticlib"] + +[dependencies] +arduboy-rust = { path = "../../../arduboy-rust" } diff --git a/Examples/ArduboyFX/fxdrawballs/src/lib.rs b/Examples/ArduboyFX/fxdrawballs/src/lib.rs new file mode 100644 index 0000000..2ee7bdf --- /dev/null +++ b/Examples/ArduboyFX/fxdrawballs/src/lib.rs @@ -0,0 +1,20 @@ +#![no_std] +#![allow(non_upper_case_globals)] +//Include the Arduboy Library +//Initialize the arduboy object +use arduboy_rust::prelude::*; +const arduboy: Arduboy2 = Arduboy2::new(); +//The setup() function runs once when you turn your Arduboy on +#[no_mangle] +pub unsafe extern "C" fn setup() { + // put your setup code here, to run once: + arduboy.begin(); + arduboy.clear(); + arduboy.print(f!(b"Holmes is cool!\0")); + arduboy.display(); +} +#[no_mangle] +#[export_name = "loop"] +pub unsafe extern "C" fn loop_() { + // put your main code here, to run repeatedly: +} diff --git a/Examples/ArduboyFX/fxdrawframes/Cargo.toml b/Examples/ArduboyFX/fxdrawframes/Cargo.toml new file mode 100644 index 0000000..93c3bfa --- /dev/null +++ b/Examples/ArduboyFX/fxdrawframes/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "fxdrawframes" +version = "0.1.0" +authors = ["ZennDev "] +edition = "2021" + +[lib] +crate-type = ["staticlib"] + +[dependencies] +arduboy-rust = { path = "../../../arduboy-rust" } diff --git a/Examples/ArduboyFX/fxdrawframes/src/lib.rs b/Examples/ArduboyFX/fxdrawframes/src/lib.rs new file mode 100644 index 0000000..2ee7bdf --- /dev/null +++ b/Examples/ArduboyFX/fxdrawframes/src/lib.rs @@ -0,0 +1,20 @@ +#![no_std] +#![allow(non_upper_case_globals)] +//Include the Arduboy Library +//Initialize the arduboy object +use arduboy_rust::prelude::*; +const arduboy: Arduboy2 = Arduboy2::new(); +//The setup() function runs once when you turn your Arduboy on +#[no_mangle] +pub unsafe extern "C" fn setup() { + // put your setup code here, to run once: + arduboy.begin(); + arduboy.clear(); + arduboy.print(f!(b"Holmes is cool!\0")); + arduboy.display(); +} +#[no_mangle] +#[export_name = "loop"] +pub unsafe extern "C" fn loop_() { + // put your main code here, to run repeatedly: +} diff --git a/Examples/ArduboyFX/fxhelloworld/Cargo.toml b/Examples/ArduboyFX/fxhelloworld/Cargo.toml new file mode 100644 index 0000000..6100b0c --- /dev/null +++ b/Examples/ArduboyFX/fxhelloworld/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "fxhelloworld" +version = "0.1.0" +authors = ["ZennDev "] +edition = "2021" + +[lib] +crate-type = ["staticlib"] + +[dependencies] +arduboy-rust = { path = "../../../arduboy-rust" } diff --git a/Examples/ArduboyFX/fxhelloworld/src/lib.rs b/Examples/ArduboyFX/fxhelloworld/src/lib.rs new file mode 100644 index 0000000..2ee7bdf --- /dev/null +++ b/Examples/ArduboyFX/fxhelloworld/src/lib.rs @@ -0,0 +1,20 @@ +#![no_std] +#![allow(non_upper_case_globals)] +//Include the Arduboy Library +//Initialize the arduboy object +use arduboy_rust::prelude::*; +const arduboy: Arduboy2 = Arduboy2::new(); +//The setup() function runs once when you turn your Arduboy on +#[no_mangle] +pub unsafe extern "C" fn setup() { + // put your setup code here, to run once: + arduboy.begin(); + arduboy.clear(); + arduboy.print(f!(b"Holmes is cool!\0")); + arduboy.display(); +} +#[no_mangle] +#[export_name = "loop"] +pub unsafe extern "C" fn loop_() { + // put your main code here, to run repeatedly: +} diff --git a/Examples/ArduboyFX/fxloadgamestate/Cargo.toml b/Examples/ArduboyFX/fxloadgamestate/Cargo.toml new file mode 100644 index 0000000..06b9926 --- /dev/null +++ b/Examples/ArduboyFX/fxloadgamestate/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "fxloadgamestate" +version = "0.1.0" +authors = ["ZennDev "] +edition = "2021" + +[lib] +crate-type = ["staticlib"] + +[dependencies] +arduboy-rust = { path = "../../../arduboy-rust" } diff --git a/Examples/ArduboyFX/fxloadgamestate/src/lib.rs b/Examples/ArduboyFX/fxloadgamestate/src/lib.rs new file mode 100644 index 0000000..2ee7bdf --- /dev/null +++ b/Examples/ArduboyFX/fxloadgamestate/src/lib.rs @@ -0,0 +1,20 @@ +#![no_std] +#![allow(non_upper_case_globals)] +//Include the Arduboy Library +//Initialize the arduboy object +use arduboy_rust::prelude::*; +const arduboy: Arduboy2 = Arduboy2::new(); +//The setup() function runs once when you turn your Arduboy on +#[no_mangle] +pub unsafe extern "C" fn setup() { + // put your setup code here, to run once: + arduboy.begin(); + arduboy.clear(); + arduboy.print(f!(b"Holmes is cool!\0")); + arduboy.display(); +} +#[no_mangle] +#[export_name = "loop"] +pub unsafe extern "C" fn loop_() { + // put your main code here, to run repeatedly: +} diff --git a/Examples/drboy/src/lib.rs b/Examples/drboy/src/lib.rs index 65fc007..a607629 100644 --- a/Examples/drboy/src/lib.rs +++ b/Examples/drboy/src/lib.rs @@ -4,7 +4,7 @@ //Include the Arduboy Library #[allow(unused_imports)] use arduboy_rust::prelude::*; -use arduboy_tone::arduboy_tone_pitch::*; +use arduboy_tones::tones_pitch::*; mod gameloop; #[allow(dead_code)] diff --git a/Project/game/src/lib.rs b/Project/game/src/lib.rs index a02a267..56ab763 100644 --- a/Project/game/src/lib.rs +++ b/Project/game/src/lib.rs @@ -2,7 +2,6 @@ #![allow(non_upper_case_globals)] //Include the Arduboy Library -use arduboy_rust::arduboyfx::*; #[allow(unused_imports)] use arduboy_rust::prelude::*; @@ -12,12 +11,11 @@ const arduboy: Arduboy2 = Arduboy2::new(); // Progmem data // dynamic ram variables -const FX_DATA_PAGE: u16 = 0xfffe; -const FX_DATA_BYTES: u32 = 329; +const FX_DATA_PAGE: u16 = 0xffff; +const FX_DATA_BYTES: u32 = 234; const FXlogo: u32 = 0x000000; const FXlogoWith: i16 = 115; const FXlogoHeight: i16 = 16; -const helloWorld: u32 = 0x0000EA; static mut x: i16 = (WIDTH - FXlogoWith) / 2; static mut y: i16 = 25; @@ -29,7 +27,7 @@ pub unsafe extern "C" fn setup() { // put your setup code here, to run once: arduboy.begin(); arduboy.set_frame_rate(30); - arduboyfx_begin_data(FX_DATA_PAGE); + FX::begin_data(FX_DATA_PAGE); } // The loop() function repeats forever after setup() is done #[no_mangle] @@ -39,7 +37,7 @@ pub unsafe extern "C" fn loop_() { if !arduboy.next_frame() { return; } - arduboyfx_draw_bitmap(x, y, FXlogo, 0, 0); + FX::draw_bitmap(x, y, FXlogo, 0, 0); x += xDir as i16; y += yDir as i16; if x == 0 || x == WIDTH - FXlogoWith { @@ -48,7 +46,5 @@ pub unsafe extern "C" fn loop_() { if y == 0 || y == HEIGHT - FXlogoHeight { yDir = -yDir; } - arduboyfx_set_cursor(10, 10); - arduboyfx_draw_string(helloWorld); - arduboyfx_display_clear(); + FX::display_clear() } diff --git a/Tools/Arduboy-Python-Utilities/LICENSE b/Tools/Arduboy-Python-Utilities/LICENSE new file mode 100644 index 0000000..0e259d4 --- /dev/null +++ b/Tools/Arduboy-Python-Utilities/LICENSE @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/Tools/Arduboy-Python-Utilities/fxdata-build.py b/Tools/Arduboy-Python-Utilities/fxdata-build.py new file mode 100644 index 0000000..a9cfcb9 --- /dev/null +++ b/Tools/Arduboy-Python-Utilities/fxdata-build.py @@ -0,0 +1,390 @@ +#FX data build tool version 1.15 by Mr.Blinky May 2021 - Mar.2023 + +VERSION = '1.15' + +import sys +import os +import re +import platform + +constants = [ + #normal bitmap modes + ("dbmNormal", 0x00), + ("dbmOverwrite", 0x00), + ("dbmWhite", 0x01), + ("dbmReverse", 0x08), + ("dbmBlack", 0x0D), + ("dbmInvert", 0x02), + #masked bitmap modes for frame + ("dbmMasked", 0x10), + ("dbmMasked_dbmWhite", 0x11), + ("dbmMasked_dbmReverse", 0x18), + ("dbmMasked_dbmBlack", 0x1D), + ("dbmMasked_dbmInvert", 0x12), + #bitmap modes for last bitmap in a frame + ("dbmNormal_end", 0x40), + ("dbmOverwrite_end", 0x40), + ("dbmWhite_end", 0x41), + ("dbmReverse_end", 0x48), + ("dbmBlack_end", 0x4D), + ("dbmInvert_end", 0x42), + #masked bitmap modes for last bitmap in a frame + ("dbmMasked_end", 0x50), + ("dbmMasked_dbmWhite_end", 0x51), + ("dbmMasked_dbmReverse_end", 0x58), + ("dbmMasked_dbmBlack_end", 0x5D), + ("dbmMasked_dbmInvert_end", 0x52), + #bitmap modes for last bitmap of the last frame + ("dbmNormal_last", 0x80), + ("dbmOverwrite_last", 0x80), + ("dbmWhite_last", 0x81), + ("dbmReverse_last", 0x88), + ("dbmBlack_last", 0x8D), + ("dbmInvert_last", 0x82), + #masked bitmap modes for last bitmap in a frame + ("dbmMasked_last", 0x90), + ("dbmMasked_dbmWhite_last", 0x91), + ("dbmMasked_dbmReverse_last", 0x98), + ("dbmMasked_dbmBlack_last", 0x9D), + ("dbmMasked_dbmInvert_last", 0x92), + ] + +def print(s): + sys.stdout.write(s + '\n') + sys.stdout.flush() + +print('FX data build tool version {} by Mr.Blinky May 2021 - Jan 2023\nUsing Python version {}'.format(VERSION,platform.python_version())) + +bytes = bytearray() +symbols = [] +header = [] +label = '' +indent ='' +blkcom = False +namespace = False +include = False +try: + toolspath = os.path.dirname(os.path.abspath(sys.argv[0])) + sys.path.insert(0, toolspath) + from PIL import Image +except Exception as e: + sys.stderr.write(str(e) + "\n") + sys.stderr.write("PILlow python module not found or wrong version.\n") + sys.stderr.write("Make sure the correct module is installed or placed at {}\n".format(toolspath)) + sys.exit(-1) + +def rawData(filename): + global path + with open(path + filename,"rb") as file: + bytes = bytearray(file.read()) + file.close() + return bytes + +def includeFile(filename): + global path + print("Including file {}".format(path + filename)) + with open(path + filename,"r") as file: + lines = file.readlines() + file.close() + return lines + +def imageData(filename): + global path, symbols + filename = path + filename + + ## parse filename ## FILENAME_[WxH]_[S].[EXT]" + spriteWidth = 0 + spriteHeight = 0 + spacing = 0 + elements = os.path.basename(os.path.splitext(filename)[0]).split("_") + lastElement = len(elements)-1 + #get width and height from filename + i = lastElement + while i > 0: + subElements = list(filter(None,elements[i].split('x'))) + if len(subElements) == 2 and subElements[0].isnumeric() and subElements[1].isnumeric(): + spriteWidth = int(subElements[0]) + spriteHeight = int(subElements[1]) + if i < lastElement and elements[i+1].isnumeric(): + spacing = int(elements[i+1]) + break + else: i -= 1 + + #load image + img = Image.open(filename).convert("RGBA") + pixels = list(img.getdata()) + #check for transparency + transparency = False + for i in pixels: + if i[3] < 255: + transparency = True + break + + # check for multiple frames/tiles + if spriteWidth > 0: + hframes = (img.size[0] - spacing) // (spriteWidth + spacing) + else: + spriteWidth = img.size[0] - 2 * spacing + hframes = 1 + if spriteHeight > 0: + vframes = (img.size[1] - spacing) // (spriteHeight + spacing) + else: + spriteHeight = img.size[1] - 2* spacing + vframes = 1 + + #create byte array for bin file + size = (spriteHeight+7) // 8 * spriteWidth * hframes * vframes + if transparency: + size += size + bytes = bytearray([spriteWidth >> 8, spriteWidth & 0xFF, spriteHeight >> 8, spriteHeight & 0xFF]) + bytes += bytearray(size) + i = 4 + b = 0 + m = 0 + fy = spacing + frames = 0 + for v in range(vframes): + fx = spacing + for h in range(hframes): + for y in range (0,spriteHeight,8): + line = " " + for x in range (0,spriteWidth): + for p in range (0,8): + b = b >> 1 + m = m >> 1 + if (y + p) < spriteHeight: #for heights that are not a multiple of 8 pixels + if pixels[(fy + y + p) * img.size[0] + fx + x][1] > 64: + b |= 0x80 #white pixel + if pixels[(fy + y + p) * img.size[0] + fx + x][3] > 64: + m |= 0x80 #opaque pixel + else: + b &= 0x7F #for transparent pixel clear possible white pixel + bytes[i] = b + i += 1 + if transparency: + bytes[i] = m + i += 1 + frames += 1 + fx += spriteWidth + spacing + fy += spriteHeight + spacing + label = symbols[-1][0] + if label.upper() == label: + writeHeader('{}constexpr uint16_t {}_WIDTH = {};'.format(indent,label,spriteWidth)) + writeHeader('{}constexpr uint16_t {}HEIGHT = {};'.format(indent,label,spriteHeight)) + if frames > 1: writeHeader('{}constexpr uint8_t {}_FRAMES = {};'.format(indent,label,frames)) + elif '_' in label: + writeHeader('{}constexpr uint16_t {}_width = {};'.format(indent,label,spriteWidth)) + writeHeader('{}constexpr uint16_t {}_height = {};'.format(indent,label,spriteHeight)) + if frames > 1: writeHeader('{}constexpr uint8_t {}_frames = {};'.format(indent,label,frames)) + else: + writeHeader('{}constexpr uint16_t {}Width = {};'.format(indent,label,spriteWidth)) + writeHeader('{}constexpr uint16_t {}Height = {};'.format(indent,label,spriteHeight)) + if frames > 255: writeHeader('{}constexpr uint16_t {}Frames = {};'.format(indent,label,frames)) + elif frames > 1: writeHeader('{}constexpr uint8_t {}Frames = {};'.format(indent,label,frames)) + writeHeader('') + return bytes + +def addLabel(label,length): + global symbols + symbols.append((label,length)) + writeHeader('{}constexpr uint24_t {} = 0x{:06X};'.format(indent,label,length)) + +def writeHeader(s): + global header + header.append(s) + +################################################################################ + +if (len(sys.argv) != 2) or (os.path.isfile(sys.argv[1]) != True) : + sys.stderr.write("FX data script file not found.\n") + sys.exit(-1) + +filename = os.path.abspath(sys.argv[1]) +datafilename = os.path.splitext(filename)[0] + '-data.bin' +savefilename = os.path.splitext(filename)[0] + '-save.bin' +devfilename = os.path.splitext(filename)[0] + '.bin' +headerfilename = os.path.splitext(filename)[0] + '.h' +path = os.path.dirname(filename) + os.sep +saveStart = -1 + +with open(filename,"r") as file: + lines = file.readlines() + file.close() + +print("Building FX data using {}".format(filename)) +lineNr = 0 +while lineNr < len(lines): + parts = [p for p in re.split("([ ,]|[\\'].*[\\'])", lines[lineNr]) if p.strip() and p != ','] + for i in range (len(parts)): + part = parts[i] + #strip unwanted chars + if part[:1] == '\t' : part = part[1:] + if part[:1] == '{' : part = part[1:] + if part[-1:] == '\n': part = part[:-1] + if part[-1:] == ';' : part = part[:-1] + if part[-1:] == '}' : part = part[:-1] + if part[-1:] == ';' : part = part[:-1] + if part[-1:] == '.' : part = part[:-1] + if part[-1:] == ',' : part = part[:-1] + if part[-2:] == '[]': part = part[:-2] + #handle comments + if blkcom == True: + p = part.find('*/',2) + if p >= 0: + part = part[p+2:] + blkcom = False + else: + if part[:2] == '//': + break + elif part[:2] == '/*': + p = part.find('*/',2) + if p >= 0: part = part[p+2:] + else: blkcom = True; + #handle types + elif part == '=' : pass + elif part == 'const' : pass + elif part == 'PROGMEM' : pass + elif part == 'align' : t = 0 + elif part == 'int8_t' : t = 1 + elif part == 'uint8_t' : t = 1 + elif part == 'int16_t' : t = 2 + elif part == 'uint16_t': t = 2 + elif part == 'int24_t' : t = 3 + elif part == 'uint24_t': t = 3 + elif part == 'int32_t' : t = 4 + elif part == 'uint32_t': t = 4 + elif part == 'image_t' : t = 5 + elif part == 'raw_t' : t = 6 + elif part == 'String' : t = 7 + elif part == 'string' : t = 7 + elif part == 'include' : include = True + elif part == 'datasection' : pass + elif part == 'savesection' : saveStart = len(bytes) + #handle namespace + elif part == 'namespace': + namespace = True + elif namespace == True: + namespace = False + writeHeader("namespace {}\n{{".format(part)) + indent += ' ' + elif part == 'namespace_end': + indent = indent[:-2] + writeHeader('}\n') + namespace = False + #handle strings + elif (part[:1] == "'") or (part[:1] == '"'): + if part[:1] == "'": part = part[1:part.rfind("'")] + else: part = part[1:part.rfind('"')] + #handle include + if include == True: + lines[lineNr+1:lineNr+1] = includeFile(part) + include = False + elif t == 1: bytes += part.encode('utf-8').decode('unicode_escape').encode('utf-8') + elif t == 5: bytes += imageData(part) + elif t == 6: bytes += rawData(part) + elif t == 7: bytes += part.encode('utf-8').decode('unicode_escape').encode('utf-8') + b'\x00' + else: + sys.stderr.write('ERROR in line {}: unsupported string for type\n'.format(lineNr)) + sys.exit(-1) + #handle values + elif part[:1].isnumeric() or (part[:1] == '-' and part[1:2].isnumeric()): + n = int(part,0) + if t == 4: bytes.append((n >> 24) & 0xFF) + if t >= 3: bytes.append((n >> 16) & 0xFF) + if t >= 2: bytes.append((n >> 8) & 0xFF) + if t >= 1: bytes.append((n >> 0) & 0xFF) + #handle align + if t == 0: + align = len(bytes) % n + if align: bytes += b'\xFF' * (n - align) + #handle labels + elif part[:1].isalpha(): + for j in range(len(part)): + if part[j] == '=': + addLabel(label,len(bytes)) + label = '' + part = part[j+1:] + parts.insert(i+1,part) + break + elif part[j].isalnum() or part[j] == '_': + label += part[j] + else: + sys.stderr.write('ERROR in line {}: Bad label: {}\n'.format(lineNr,label)) + sys.exit(-1) + if (label != '') and (i < len(parts) - 1) and (parts[i+1][:1] == '='): + addLabel(label,len(bytes)) + label = '' + #handle included constants + if label != '': + for symbol in constants: + if symbol[0] == label: + if t == 4: bytes.append((symbol[1] >> 24) & 0xFF) + if t >= 3: bytes.append((symbol[1] >> 16) & 0xFF) + if t >= 2: bytes.append((symbol[1] >> 8) & 0xFF) + if t >= 1: bytes.append((symbol[1] >> 0) & 0xFF) + label = '' + break + #handle symbol values + if label != '': + for symbol in symbols: + if symbol[0] == label: + if t == 4: bytes.append((symbol[1] >> 24) & 0xFF) + if t >= 3: bytes.append((symbol[1] >> 16) & 0xFF) + if t >= 2: bytes.append((symbol[1] >> 8) & 0xFF) + if t >= 1: bytes.append((symbol[1] >> 0) & 0xFF) + label = '' + break + if label != '': + sys.stderr.write('ERROR in line {}: Undefined symbol: {}\n'.format(lineNr,label)) + sys.exit(-1) + elif len(part) > 0: + sys.stderr.write('ERROR unable to parse {} in element: {}\n'.format(part,str(parts))) + sys.exit(-1) + lineNr += 1 + +if saveStart >= 0: + dataSize = saveStart + dataPages = (dataSize + 255) // 256 + saveSize = len(bytes) - saveStart + savePages = (saveSize + 4095) // 4096 * 16 +else: + dataSize = len(bytes) + dataPages = (dataSize + 255) // 256 + saveSize = 0 + savePages = 0 + savePadding = 0 +dataPadding = dataPages * 256 - dataSize +savePadding = savePages * 256 - saveSize + +print("Saving FX data header file {}".format(headerfilename)) +with open(headerfilename,"w") as file: + file.write('#pragma once\n\n') + file.write('/**** FX data header generated by fxdata-build.py tool version {} ****/\n\n'.format(VERSION)) + file.write('using uint24_t = __uint24;\n\n') + file.write('// Initialize FX hardware using FX::begin(FX_DATA_PAGE); in the setup() function.\n\n') + file.write('constexpr uint16_t FX_DATA_PAGE = 0x{:04x};\n'.format(65536 - dataPages - savePages)) + file.write('constexpr uint24_t FX_DATA_BYTES = {};\n\n'.format(dataSize)) + if saveSize > 0: + file.write('constexpr uint16_t FX_SAVE_PAGE = 0x{:04x};\n'.format(65536 - savePages)) + file.write('constexpr uint24_t FX_SAVE_BYTES = {};\n\n'.format(saveSize)) + for line in header: + file.write(line + '\n') + file.close() + +print("Saving {} bytes FX data to {}".format(dataSize,datafilename)) +with open(datafilename,"wb") as file: + file.write(bytes[0:dataSize]) + file.close() +if saveSize > 0: + print("Saving {} bytes FX savedata to {}".format(saveSize,savefilename)) + with open(savefilename,"wb") as file: + file.write(bytes[saveStart:len(bytes)]) + file.close() +print("Saving FX development data to {}".format(devfilename)) +with open(devfilename,"wb") as file: + file.write(bytes[0:dataSize]) + if dataPadding > 0: file.write(b'\xFF' * dataPadding) + if saveSize > 0: + file.write(bytes[saveStart:len(bytes)]) + if savePadding > 0: file.write(b'\xFF' * savePadding) + file.close() diff --git a/Tools/Arduboy-Python-Utilities/fxdata-upload.py b/Tools/Arduboy-Python-Utilities/fxdata-upload.py new file mode 100644 index 0000000..aad043f --- /dev/null +++ b/Tools/Arduboy-Python-Utilities/fxdata-upload.py @@ -0,0 +1,229 @@ + +VERSION = '1.20' +title ="Arduboy FX data uploader v" + VERSION + " by Mr.Blinky Feb.2022-Mar.2023" + +import sys +import os +import time + +try: + toolspath = os.path.dirname(os.path.abspath(sys.argv[0])) + sys.path.insert(0, toolspath) + from serial.tools.list_ports import comports + from serial import Serial +except: + sys.stderr.write("pySerial python module not found or wrong version.\n") + sys.stderr.write("Make sure the correct module is installed or placed at {}\n".format(toolspath)) + sys.exit(-1) + +compatibledevices = [ + #Arduboy Leonardo + "VID:PID=2341:0036", "VID:PID=2341:8036", + "VID:PID=2A03:0036", "VID:PID=2A03:8036", + #Arduboy Micro + "VID:PID=2341:0037", "VID:PID=2341:8037", + "VID:PID=2A03:0037", "VID:PID=2A03:8037", + #Genuino Micro + "VID:PID=2341:0237", "VID:PID=2341:8237", + #Sparkfun Pro Micro 5V + "VID:PID=1B4F:9205", "VID:PID=1B4F:9206", + #Adafruit ItsyBitsy 5V + "VID:PID=239A:000E", "VID:PID=239A:800E", +] + +manufacturers = { + 0x01 : "Spansion", + 0x14 : "Cypress", + 0x1C : "EON", + 0x1F : "Adesto(Atmel)", + 0x20 : "Micron", + 0x37 : "AMIC", + 0x9D : "ISSI", + 0xC2 : "General Plus", + 0xC8 : "Giga Device", + 0xBF : "Microchip", + 0xEF : "Winbond" +} + +PAGESIZE = 256 +BLOCKSIZE = 65536 +PAGES_PER_BLOCK = BLOCKSIZE // PAGESIZE +MAX_PAGES = 65536 +bootloader_active = False + +def print(s): + sys.stdout.write(s + '\n') + sys.stdout.flush() + +def getComPort(verbose): + global bootloader_active + devicelist = list(comports()) + for device in devicelist: + for vidpid in compatibledevices: + if vidpid in device[2]: + port=device[0] + bootloader_active = (compatibledevices.index(vidpid) & 1) == 0 + if verbose : sys.stdout.write("Found {} at port {} ".format(device[1],port)) + return port + if verbose : print("Arduboy not found.") + +def bootloaderStart(): + global bootloader + ## find and connect to Arduboy in bootloader mode ## + port = getComPort(True) + if port is None : sys.exit(-1) + if not bootloader_active: + print("Selecting bootloader mode...") + try: + bootloader = Serial(port,1200) + time.sleep(0.1) + bootloader.close() + time.sleep(0.5) + except: + sys.stderr.write("COM port not available.\n") + sys.exit(-1) + #wait for disconnect and reconnect in bootloader mode + while getComPort(False) == port : + time.sleep(0.1) + if bootloader_active: break + while getComPort(False) is None : time.sleep(0.1) + port = getComPort(True) + + sys.stdout.write("Opening port ...") + sys.stdout.flush() + for retries in range(20): + try: + time.sleep(0.1) + bootloader = Serial(port,57600) + break + except: + if retries == 19: + print(" Failed!") + sys.exit(-1) + sys.stdout.write(".") + sys.stdout.flush() + time.sleep(0.4) + print("\r") + +def getVersion(): + bootloader.write(b"V") + return int(bootloader.read(2)) + +def getJedecID(): + bootloader.write(b"j") + jedec_id = bootloader.read(3) + time.sleep(0.5) + bootloader.write(b"j") + jedec_id2 = bootloader.read(3) + if jedec_id2 != jedec_id or jedec_id == b'\x00\x00\x00' or jedec_id == b'\xFF\xFF\xFF': + sys.stderr.write("No FX flash chip detected.\n") + sys.exit(-1) + return bytearray(jedec_id) + +def bootloaderExit(): + global bootloader + bootloader.write(b"E") + bootloader.read(1) + +################################################################################ + +def writeFlash(pagenumber, flashdata): + bootloaderStart() + + #check version + if getVersion() < 13: + sys.stderr.write("Bootloader has no flash cart support\nWrite aborted!\n") + sys.exit(-1) + + ## detect flash cart ## + jedec_id = getJedecID() + if jedec_id[0] in manufacturers.keys(): + manufacturer = manufacturers[jedec_id[0]] + else: + manufacturer = "unknown" + capacity = 1 << jedec_id[2] + print("Detected FX flash chip with ID {:02X}{:02X}{:02X} size {}KB".format(jedec_id[0],jedec_id[1],jedec_id[2],capacity // 1024)) + + oldtime=time.time() + # when starting partially in a block, preserve the beginning of old block data + if pagenumber % PAGES_PER_BLOCK: + blocklen = pagenumber % PAGES_PER_BLOCK * PAGESIZE + blockaddr = pagenumber // PAGES_PER_BLOCK * PAGES_PER_BLOCK + #read partial block data start + bootloader.write(bytearray([ord("A"), blockaddr >> 8, blockaddr & 0xFF])) + bootloader.read(1) + bootloader.write(bytearray([ord("g"), (blocklen >> 8) & 0xFF, blocklen & 0xFF,ord("C")])) + flashdata = bootloader.read(blocklen) + flashdata + pagenumber = blockaddr + + # when ending partially in a block, preserve the ending of old block data + if len(flashdata) % BLOCKSIZE: + blocklen = BLOCKSIZE - len(flashdata) % BLOCKSIZE + blockaddr = pagenumber + len(flashdata) // PAGESIZE + #read partial block data end + bootloader.write(bytearray([ord("A"), blockaddr >> 8, blockaddr & 0xFF])) + bootloader.read(1) + bootloader.write(bytearray([ord("g"), (blocklen >> 8) & 0xFF, blocklen & 0xFF,ord("C")])) + flashdata += bootloader.read(blocklen) + + ## write to flash cart ## + blocks = len(flashdata) // BLOCKSIZE + for block in range (blocks): + if (block & 1 == 0) or verifyAfterWrite: + bootloader.write(b"x\xC2") #RGB LED RED, buttons disabled + else: + bootloader.write(b"x\xC0") #RGB LED OFF, buttons disabled + bootloader.read(1) + sys.stdout.write("\rWriting block {}/{} ".format(block + 1,blocks)) + sys.stdout.flush() + blockaddr = pagenumber + block * BLOCKSIZE // PAGESIZE + blocklen = BLOCKSIZE + #write block + bootloader.write(bytearray([ord("A"), blockaddr >> 8, blockaddr & 0xFF])) + bootloader.read(1) + bootloader.write(bytearray([ord("B"), (blocklen >> 8) & 0xFF, blocklen & 0xFF,ord("C")])) + bootloader.write(flashdata[block * BLOCKSIZE : block * BLOCKSIZE + blocklen]) + bootloader.read(1) + if verifyAfterWrite: + sys.stdout.write("\rVerifying block {}/{}".format(block + 1,blocks)) + sys.stdout.flush() + bootloader.write(b"x\xC1") #RGB BLUE RED, buttons disabled + bootloader.read(1) + bootloader.write(bytearray([ord("A"), blockaddr >> 8, blockaddr & 0xFF])) + bootloader.read(1) + bootloader.write(bytearray([ord("g"), (blocklen >> 8) & 0xFF, blocklen & 0xFF,ord("C")])) + if bootloader.read(blocklen) != flashdata[block * BLOCKSIZE : block * BLOCKSIZE + blocklen]: + sys.stderr.write(" verify failed!\n\nWrite aborted.") + bootloader.write(b"x\x40")#RGB LED off, buttons enabled + bootloader.read(1) + sys.exit(-1) + + #write complete + bootloader.write(b"x\x44")#RGB LED GREEN, buttons enabled + bootloader.read(1) + time.sleep(0.5) + bootloader.write(b"x\x40")#RGB LED off, buttons enabled + bootloader.read(1) + bootloader.close() + print("\rFX Data uploaded successfully") + +################################################################################ + +print(title) + +if (len(sys.argv) != 2) or (os.path.isfile(sys.argv[1]) != True) : + sys.stderr.write("FX data file not found.\n") + +filename = os.path.abspath(sys.argv[1]) + +verifyAfterWrite = True + +print('Uploading FX data from file "{}"'.format(filename)) +f = open(filename,"rb") +programdata = bytearray(f.read()) +f.close() +if len(programdata) % PAGESIZE: + programdata += b'\xFF' * (PAGESIZE - (len(programdata) % PAGESIZE)) +programpage = MAX_PAGES - (len(programdata) // PAGESIZE) + +writeFlash(programpage, programdata) diff --git a/arduboy-rust/Wrapper-Project/src/library/arduboy/arduboyfx_export.h b/arduboy-rust/Wrapper-Project/src/library/arduboy/arduboyfx_export.h index 78dd1d3..f4fa9f6 100644 --- a/arduboy-rust/Wrapper-Project/src/library/arduboy/arduboyfx_export.h +++ b/arduboy-rust/Wrapper-Project/src/library/arduboy/arduboyfx_export.h @@ -38,7 +38,11 @@ extern "C" { return FX::drawFrame(address); } - void arduboyfx_draw_string(uint24_t address) + void arduboyfx_set_cursor(int16_t x,int16_t y) + { + FX::setCursor(x,y); + } + void arduboyfx_draw_string_fx(uint24_t address) { FX::drawString(address); } @@ -46,8 +50,52 @@ extern "C" { FX::drawString(buffer); } - void arduboyfx_set_cursor(int16_t x,int16_t y) + +//// + + void arduboyfx_draw_string(const char *str) { - return FX::setCursor(x,y); + FX::drawString(str); + } +//// + void arduboyfx_set_cursor_x(int16_t x) + { + FX::setCursorX(x); + } + void arduboyfx_set_cursor_y(int16_t y) + { + FX::setCursorY(y); + } + void arduboyfx_set_font(uint24_t address, uint8_t mode) + { + FX::setFont(address,mode); + } + void arduboyfx_set_font_mode(uint8_t mode) + { + FX::setFontMode(mode); + } + void arduboyfx_set_cursor_range(int16_t left,int16_t wrap) + { + FX::setCursorRange(left, wrap); + } + void arduboyfx_draw_number_i16(int16_t n, int8_t digits) + { + FX::drawNumber(n); + } + void arduboyfx_draw_number_i32(int32_t n, int8_t digits) + { + FX::drawNumber(n); + } + void arduboyfx_draw_number_u16(uint16_t n, int8_t digits) + { + FX::drawNumber(n); + } + void arduboyfx_draw_number_u32(uint32_t n, int8_t digits) + { + FX::drawNumber(n); + } + void arduboyfx_draw_char(uint8_t c) + { + FX::drawChar(c); } } \ No newline at end of file diff --git a/arduboy-rust/src/lib.rs b/arduboy-rust/src/lib.rs index 493bfaf..e92b5fa 100644 --- a/arduboy-rust/src/lib.rs +++ b/arduboy-rust/src/lib.rs @@ -33,10 +33,9 @@ mod print; #[doc(inline)] pub extern crate heapless; pub use crate::library::arduboy2::{self, Arduboy2, Color, FONT_SIZE, HEIGHT, WIDTH}; -pub use crate::library::arduboy_tone::{self, ArduboyTones}; +pub use crate::library::arduboy_tones::{self, ArduboyTones}; pub use crate::library::ardvoice::{self, ArdVoice}; pub use crate::library::eeprom::{EEPROM, EEPROMBYTE}; pub use crate::library::{arduino, c, sprites}; -pub use crate::library::arduboyfx; +pub use crate::library::arduboyfx::{self}; pub mod serial_print; - diff --git a/arduboy-rust/src/library/arduboy2.rs b/arduboy-rust/src/library/arduboy2.rs index b0b94da..6b9c99a 100644 --- a/arduboy-rust/src/library/arduboy2.rs +++ b/arduboy-rust/src/library/arduboy2.rs @@ -66,6 +66,8 @@ impl Arduboy2 { /// gives you a new instance of the [Arduboy2] /// ## Example /// ``` + /// #![allow(non_upper_case_globals)] + /// use arduboy_rust::prelude::*; /// const arduboy: Arduboy2 = Arduboy2::new(); /// ``` pub const fn new() -> Self { @@ -342,8 +344,11 @@ impl Arduboy2 { ///- ASCII carriage return (\r, 0x0D, musical eighth note). This character will be ignored. /// /// - ///Example + /// ## Example /// ``` + /// #![allow(non_upper_case_globals)] + /// use arduboy_rust::prelude::*; + /// const arduboy:Arduboy2 =Arduboy2::new(); /// let value: i16 = 42; /// /// arduboy.print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the @@ -542,10 +547,14 @@ impl Arduboy2 { /// ///## Example ///If you wanted to fire a shot every 5 frames while the A button is being held down: - /// ``` + ///``` + /// #![allow(non_upper_case_globals)] + /// use arduboy_rust::prelude::*; + /// const arduboy:Arduboy2 =Arduboy2::new(); + /// /// if arduboy.everyXFrames(5) { /// if arduboy.pressed(A_BUTTON) { - /// fireShot(); + /// //fireShot(); // just some example /// } /// } /// ``` diff --git a/arduboy-rust/src/library/arduboy_tone.rs b/arduboy-rust/src/library/arduboy_tones.rs similarity index 92% rename from arduboy-rust/src/library/arduboy_tone.rs rename to arduboy-rust/src/library/arduboy_tones.rs index cc8574f..2d3bff0 100644 --- a/arduboy-rust/src/library/arduboy_tone.rs +++ b/arduboy-rust/src/library/arduboy_tones.rs @@ -1,39 +1,10 @@ //!This is the Module to interact in a save way with the ArduboyTones C++ library. //! //! You will need to uncomment the ArduboyTones_Library in the import_config.h file. -pub use crate::library::arduboy_tone_pitch; +pub mod tones_pitch; + use core::ffi::{c_uchar, c_uint, c_ulong}; -extern "C" { - #[link_name = "sound_tone"] - fn sound_tone(frequency: c_uint, duration: c_ulong); - #[link_name = "sound_tone2"] - fn sound_tone2(frequency1: c_uint, duration1: c_ulong, frequency2: c_uint, duration2: c_ulong); - #[link_name = "sound_tone3"] - fn sound_tone3( - frequency1: c_uint, - duration1: c_ulong, - frequency2: c_uint, - duration2: c_ulong, - frequency3: c_uint, - duration3: c_ulong, - ); - #[link_name = "sound_tones"] - fn sound_tones(tones: *const c_uint); - - #[link_name = "sound_no_tone"] - fn sound_no_tone(); - - #[link_name = "sound_playing"] - fn sound_playing() -> bool; - - #[link_name = "sound_tones_in_ram"] - fn sound_tones_in_ram(tones: *mut c_ulong); - - #[link_name = "sound_volume_mode"] - fn sound_volume_mode(mode: c_uchar); - -} ///This is the struct to interact in a save way with the ArduboyTones C++ library. /// /// You will need to uncomment the ArduboyTones_Library in the import_config.h file. @@ -42,6 +13,7 @@ impl ArduboyTones { ///Get a new instance of [ArduboyTones] /// ## Example /// ``` + /// use arduboy_rust::prelude::*; /// const sound: ArduboyTones = ArduboyTones::new(); /// ``` pub const fn new() -> ArduboyTones { @@ -79,7 +51,11 @@ impl ArduboyTones { frequency3: u16, duration3: u32, ) { - unsafe { sound_tone3(frequency1, duration1, frequency2, duration2, frequency3, duration3) } + unsafe { + sound_tone3( + frequency1, duration1, frequency2, duration2, frequency3, duration3, + ) + } } /// Play a tone sequence from frequency/duration pairs in a PROGMEM array. /// @@ -94,11 +70,13 @@ impl ArduboyTones { /// /// Example: /// ``` + /// use arduboy_rust::prelude::*; + /// const sound:ArduboyTones=ArduboyTones::new(); /// progmem!( - /// static sound1:[u8;_]=[220,1000, 0,250, 440,500, 880,2000,TONES_END] + /// static sound1:[u8;_]=[220,1000, 0,250, 440,500, 880,2000,TONES_END]; /// ); /// - /// tones(get_tones_addr!(sound1)); + /// sound.tones(get_tones_addr!(sound1)); /// ``` pub fn tones(&self, tones: *const u16) { unsafe { sound_tones(tones) } @@ -130,6 +108,8 @@ impl ArduboyTones { /// Example: /// /// ``` + /// use arduboy_rust::prelude::*; + /// use arduboy_tones::tones_pitch::*; /// let sound2: [u16; 9] = [220, 1000, 0, 250, 440, 500, 880, 2000, TONES_END]; /// ``` /// Using `tones()`, with the data in PROGMEM, is normally a better @@ -150,3 +130,28 @@ impl ArduboyTones { unsafe { sound_volume_mode(mode) } } } +extern "C" { + #[link_name = "sound_tone"] + fn sound_tone(frequency: c_uint, duration: c_ulong); + #[link_name = "sound_tone2"] + fn sound_tone2(frequency1: c_uint, duration1: c_ulong, frequency2: c_uint, duration2: c_ulong); + #[link_name = "sound_tone3"] + fn sound_tone3( + frequency1: c_uint, + duration1: c_ulong, + frequency2: c_uint, + duration2: c_ulong, + frequency3: c_uint, + duration3: c_ulong, + ); + #[link_name = "sound_tones"] + fn sound_tones(tones: *const c_uint); + #[link_name = "sound_no_tone"] + fn sound_no_tone(); + #[link_name = "sound_playing"] + fn sound_playing() -> bool; + #[link_name = "sound_tones_in_ram"] + fn sound_tones_in_ram(tones: *mut c_ulong); + #[link_name = "sound_volume_mode"] + fn sound_volume_mode(mode: c_uchar); +} diff --git a/arduboy-rust/src/library/arduboy_tone_pitch.rs b/arduboy-rust/src/library/arduboy_tones/tones_pitch.rs similarity index 100% rename from arduboy-rust/src/library/arduboy_tone_pitch.rs rename to arduboy-rust/src/library/arduboy_tones/tones_pitch.rs diff --git a/arduboy-rust/src/library/arduboyfx.rs b/arduboy-rust/src/library/arduboyfx.rs index 66149bf..57a343c 100644 --- a/arduboy-rust/src/library/arduboyfx.rs +++ b/arduboy-rust/src/library/arduboyfx.rs @@ -1,45 +1,9 @@ -#![allow(non_upper_case_globals)] -use core::ffi::{c_char, c_int, c_size_t, c_uchar, c_uint, c_ulong}; - -pub const dbmNormal: u8 = 0; -pub const dbmOverwrite: u8 = 0; -pub const dbmMasked: u8 = 1; -extern "C" { - #[link_name = "arduboyfx_begin"] - pub fn arduboyfx_begin(); - #[link_name = "arduboyfx_begin_data"] - pub fn arduboyfx_begin_data(datapage: c_uint); - #[link_name = "arduboyfx_begin_data_save"] - pub fn arduboyfx_begin_data_save(datapage: c_uint, savepage: c_uint); - #[link_name = "arduboyfx_display"] - pub fn arduboyfx_display(); - #[link_name = "arduboyfx_display_clear"] - pub fn arduboyfx_display_clear(); - #[link_name = "arduboyfx_read_data_array"] - pub fn arduboyfx_read_data_array( - address: c_ulong, - index: c_uchar, - offset: c_uchar, - element_size: c_uchar, - buffer: *const c_uchar, - length: c_size_t, - ); - #[link_name = "arduboyfx_draw_bitmap"] - pub fn arduboyfx_draw_bitmap( - x: c_int, - y: c_int, - address: c_ulong, - frame: c_uchar, - mode: c_uchar, - ); - #[link_name = "arduboyfx_set_frame"] - pub fn arduboyfx_set_frame(frame: c_ulong, repeat: c_uchar); - #[link_name = "arduboyfx_draw_frame"] - pub fn arduboyfx_draw_frame(address: c_ulong) -> c_ulong; - #[link_name = "arduboyfx_draw_string"] - pub fn arduboyfx_draw_string(address: c_ulong); - #[link_name = "arduboyfx_draw_string_buffer"] - pub fn arduboyfx_draw_string_buffer(buffer: *const c_uchar); - #[link_name = "arduboyfx_set_cursor"] - pub fn arduboyfx_set_cursor(x: c_int, y: c_int); -} +//! This is the Module to interact in a save way with the ArduboyFX C++ library. +//! +//! You will need to uncomment the ArduboyFX_Library in the import_config.h file. +pub mod fx_consts; +mod drawable_number; +pub use drawable_number::DrawableNumber; +mod drawable_string; +pub use drawable_string::DrawableString; +pub mod fx; diff --git a/arduboy-rust/src/library/arduboyfx/drawable_number.rs b/arduboy-rust/src/library/arduboyfx/drawable_number.rs new file mode 100644 index 0000000..84303dd --- /dev/null +++ b/arduboy-rust/src/library/arduboyfx/drawable_number.rs @@ -0,0 +1,38 @@ +use core::ffi::{c_char, c_int, c_long, c_uint, c_ulong}; +pub trait DrawableNumber +where + Self: Sized, +{ + fn draw(self, digits: i8); +} +impl DrawableNumber for i16 { + fn draw(self, digits: i8) { + unsafe { arduboyfx_draw_number_i16(self, digits) } + } +} +impl DrawableNumber for u16 { + fn draw(self, digits: i8) { + unsafe { arduboyfx_draw_number_u16(self, digits) } + } +} +impl DrawableNumber for i32 { + fn draw(self, digits: i8) { + unsafe { arduboyfx_draw_number_i32(self, digits) } + } +} +impl DrawableNumber for u32 { + fn draw(self, digits: i8) { + unsafe { arduboyfx_draw_number_u32(self, digits) } + } +} + +extern "C" { + #[link_name = "arduboyfx_draw_number_i16"] + fn arduboyfx_draw_number_i16(n: c_int, digits: c_char); + #[link_name = "arduboyfx_draw_number_u16"] + fn arduboyfx_draw_number_u16(n: c_uint, digits: c_char); + #[link_name = "arduboyfx_draw_number_i32"] + fn arduboyfx_draw_number_i32(n: c_long, digits: c_char); + #[link_name = "arduboyfx_draw_number_u32"] + fn arduboyfx_draw_number_u32(n: c_ulong, digits: c_char); +} diff --git a/arduboy-rust/src/library/arduboyfx/drawable_string.rs b/arduboy-rust/src/library/arduboyfx/drawable_string.rs new file mode 100644 index 0000000..069eaab --- /dev/null +++ b/arduboy-rust/src/library/arduboyfx/drawable_string.rs @@ -0,0 +1,53 @@ +use core::ffi::{c_char, c_uchar, c_ulong}; +use crate::library::progmem::Pstring; + +pub trait DrawableString +where + Self: Sized, +{ + fn draw(self); +} +impl DrawableString for &[u8] { + fn draw(self) { + unsafe { + arduboyfx_draw_string(self as *const [u8] as *const i8); + } + } +} +impl DrawableString for &str { + fn draw(self) { + unsafe { + arduboyfx_draw_string(self.as_bytes() as *const [u8] as *const i8); + } + } +} +impl DrawableString for crate::heapless::String { + fn draw(self) { + unsafe { + arduboyfx_draw_string(self.as_bytes() as *const [u8] as *const i8); + } + } +} +impl DrawableString for Pstring { + fn draw(self) { + unsafe { + arduboyfx_draw_string_buffer(self.pointer as *const u8); + } + } +} +impl DrawableString for u32 { + fn draw(self) { + unsafe { + arduboyfx_draw_string_fx(self); + } + } +} + +extern "C" { + #[link_name = "arduboyfx_draw_string_fx"] + fn arduboyfx_draw_string_fx(address: c_ulong); + #[link_name = "arduboyfx_draw_string_buffer"] + fn arduboyfx_draw_string_buffer(buffer: *const c_uchar); + #[link_name = "arduboyfx_draw_string"] + fn arduboyfx_draw_string(cstr: *const c_char); +} diff --git a/arduboy-rust/src/library/arduboyfx/fx.rs b/arduboy-rust/src/library/arduboyfx/fx.rs new file mode 100644 index 0000000..a338274 --- /dev/null +++ b/arduboy-rust/src/library/arduboyfx/fx.rs @@ -0,0 +1,115 @@ +//! Functions given by the ArduboyFX library. +//! +//! You can use the 'FX::' module to access the functions after the import of the prelude +//! ``` +//! use arduboy_rust::prelude::*; +//! +//! fn setup(){ +//! FX::begin() +//! } +//! +//! ``` +//! You will need to uncomment the ArduboyFX_Library in the import_config.h file. +#![allow(non_upper_case_globals)] +use super::drawable_number::DrawableNumber; +use super::drawable_string::DrawableString; +use core::ffi::{c_int, c_long, c_size_t, c_uchar, c_uint, c_ulong}; +pub fn begin() { + unsafe { arduboyfx_begin() } +} +pub fn begin_data(datapage: u16) { + unsafe { arduboyfx_begin_data(datapage) } +} +pub fn begin_data_save(datapage: u16, savepage: u16) { + unsafe { arduboyfx_begin_data_save(datapage, savepage) } +} +pub fn display() { + unsafe { arduboyfx_display() } +} +pub fn display_clear() { + unsafe { arduboyfx_display_clear() } +} +pub fn draw_number(n: impl DrawableNumber, digits: i8) { + n.draw(digits) +} +pub fn draw_string(string: impl DrawableString) { + string.draw() +} +pub fn draw_char(c: u8) { + unsafe { arduboyfx_draw_char(c) } +} +pub fn draw_bitmap(x: i16, y: i16, address: u32, frame: u8, mode: u8) { + unsafe { arduboyfx_draw_bitmap(x, y, address, frame, mode) } +} +pub fn draw_frame(address: u32) -> u32 { + unsafe { arduboyfx_draw_frame(address) } +} +pub fn set_frame(frame: u32, repeat: u8) { + unsafe { arduboyfx_set_frame(frame, repeat) } +} +pub fn read_data_array( + address: u32, + index: u8, + offset: u8, + element_size: u8, + buffer: *const u8, + length: usize, +) { + unsafe { arduboyfx_read_data_array(address, index, offset, element_size, buffer, length) } +} +pub fn set_cursor(x: i16, y: i16) { + unsafe { arduboyfx_set_cursor(x, y) } +} +pub fn set_cursor_x(x: i16) { + unsafe { arduboyfx_set_cursor_x(x) } +} +pub fn set_cursor_y(y: i16) { + unsafe { arduboyfx_set_cursor_y(y) } +} +pub fn set_cursor_range(left: i32, wrap: i32) { + unsafe { arduboyfx_set_cursor_range(left, wrap) } +} +pub fn set_font(address: u32, mode: u8) { + unsafe { arduboyfx_set_font(address, mode) } +} + +extern "C" { + #[link_name = "arduboyfx_begin"] + fn arduboyfx_begin(); + #[link_name = "arduboyfx_begin_data"] + fn arduboyfx_begin_data(datapage: c_uint); + #[link_name = "arduboyfx_begin_data_save"] + fn arduboyfx_begin_data_save(datapage: c_uint, savepage: c_uint); + #[link_name = "arduboyfx_display"] + fn arduboyfx_display(); + #[link_name = "arduboyfx_display_clear"] + fn arduboyfx_display_clear(); + #[link_name = "arduboyfx_read_data_array"] + fn arduboyfx_read_data_array( + address: c_ulong, + index: c_uchar, + offset: c_uchar, + element_size: c_uchar, + buffer: *const c_uchar, + length: c_size_t, + ); + #[link_name = "arduboyfx_draw_bitmap"] + fn arduboyfx_draw_bitmap(x: c_int, y: c_int, address: c_ulong, frame: c_uchar, mode: c_uchar); + #[link_name = "arduboyfx_set_frame"] + fn arduboyfx_set_frame(frame: c_ulong, repeat: c_uchar); + #[link_name = "arduboyfx_draw_frame"] + fn arduboyfx_draw_frame(address: c_ulong) -> c_ulong; + #[link_name = "arduboyfx_set_cursor"] + fn arduboyfx_set_cursor(x: c_int, y: c_int); + #[link_name = "arduboyfx_set_cursor_x"] + fn arduboyfx_set_cursor_x(x: c_int); + #[link_name = "arduboyfx_set_cursor_y"] + fn arduboyfx_set_cursor_y(y: c_int); + #[link_name = "arduboyfx_set_font"] + fn arduboyfx_set_font(address: c_ulong, mode: c_uchar); + #[link_name = "arduboyfx_set_cursor_range"] + fn arduboyfx_set_cursor_range(left: c_long, wrap: c_long); + #[link_name = "arduboyfx_draw_char"] + fn arduboyfx_draw_char(c: c_uchar); + +} diff --git a/arduboy-rust/src/library/arduboyfx/fx_consts.rs b/arduboy-rust/src/library/arduboyfx/fx_consts.rs new file mode 100644 index 0000000..c5b8059 --- /dev/null +++ b/arduboy-rust/src/library/arduboyfx/fx_consts.rs @@ -0,0 +1,61 @@ +//! Consts given by the ArduboyFX library. +//! +//! You can use the `use arduboyfx::fx_consts::*;` module to access the consts. +//! ``` +//! use arduboy_rust::prelude::*; +//! use arduboyfx::fx_consts::*; +//! +//! fn setup(){ +//! let demo = dbmBlack; +//! } +//! +//! ``` +#![allow(non_upper_case_globals)] +pub const dbfWhiteBlack: u8 = 0; +pub const dbfInvert: u8 = 0; +pub const dbfBlack: u8 = 0; +pub const dbfReverseBlack: u8 = 3; +pub const dbfMasked: u8 = 4; +pub const dbfFlip: u8 = 5; +pub const dbfExtraRow: u8 = 7; +pub const dbfEndFrame: u8 = 6; +pub const dbfLastFrame: u8 = 7; +pub const dbmBlack: u8 = (1 << dbfReverseBlack) | (1 << dbfBlack) | (1 << dbfWhiteBlack); +pub const dbmWhite: u8 = 1 << dbfWhiteBlack; +pub const dbmInvert: u8 = 1 << dbfInvert; +pub const dbmFlip: u8 = 1 << dbfFlip; +pub const dbmNormal: u8 = 0; +pub const dbmOverwrite: u8 = 0; +pub const dbmReverse: u8 = 1 << dbfReverseBlack; +pub const dbmMasked: u8 = 1 << dbfMasked; +pub const dbmEndFrame: u8 = 1 << dbfEndFrame; +pub const dbmLastFrame: u8 = 1 << dbfLastFrame; +pub const dcfWhiteBlack: u8 = 0; +pub const dcfInvert: u8 = 1; +pub const dcfBlack: u8 = 2; +pub const dcfReverseBlack: u8 = 3; +pub const dcfMasked: u8 = 4; +pub const dcfProportional: u8 = 5; +pub const dcmBlack: u8 = (1 << dcfReverseBlack) | (1 << dcfBlack) | (1 << dcfWhiteBlack); +pub const dcmWhite: u8 = 1 << dcfWhiteBlack; +pub const dcmInvert: u8 = 1 << dcfInvert; +pub const dcmNormal: u8 = 0; +pub const dcmOverwrite: u8 = 0; +pub const dcmReverse: u8 = 1 << dcfReverseBlack; +pub const dcmMasked: u8 = 1 << dcfMasked; +pub const dcmProportional: u8 = 1 << dcfProportional; +pub const FX_VECTOR_KEY_VALUE: u16 = 0x9518; +pub const FX_DATA_VECTOR_KEY_POINTER: u16 = 0x0014; +pub const FX_DATA_VECTOR_PAGE_POINTER: u16 = 0x0016; +pub const FX_SAVE_VECTOR_KEY_POINTER: u16 = 0x0018; +pub const FX_SAVE_VECTOR_PAGE_POINTER: u16 = 0x001A; +pub const SFC_JEDEC_ID: u8 = 0x9F; +pub const SFC_READSTATUS1: u8 = 0x05; +pub const SFC_READSTATUS2: u8 = 0x35; +pub const SFC_READSTATUS3: u8 = 0x15; +pub const SFC_READ: u8 = 0x03; +pub const SFC_WRITE_ENABLE: u8 = 0x06; +pub const SFC_WRITE: u8 = 0x02; +pub const SFC_ERASE: u8 = 0x20; +pub const SFC_RELEASE_POWERDOWN: u8 = 0xAB; +pub const SFC_POWERDOWN: u8 = 0xB9; diff --git a/arduboy-rust/src/library/eeprom.rs b/arduboy-rust/src/library/eeprom.rs index 6c2d644..d22bebc 100644 --- a/arduboy-rust/src/library/eeprom.rs +++ b/arduboy-rust/src/library/eeprom.rs @@ -140,6 +140,7 @@ impl EEPROMBYTE { } ///Use this struct to store and read single bytes to/from eeprom memory without using a check digit. +/// ///Unlike the other eeprom structs, this does not need to be initialised. pub struct EEPROMBYTECHECKLESS { idx: i16, diff --git a/arduboy-rust/src/library/mod.rs b/arduboy-rust/src/library/mod.rs index cd51cee..2ee06c4 100644 --- a/arduboy-rust/src/library/mod.rs +++ b/arduboy-rust/src/library/mod.rs @@ -1,6 +1,5 @@ pub mod arduboy2; -pub mod arduboy_tone; -pub mod arduboy_tone_pitch; +pub mod arduboy_tones; pub mod arduino; pub mod ardvoice; pub mod c; diff --git a/arduboy-rust/src/prelude.rs b/arduboy-rust/src/prelude.rs index 6eb7602..173f126 100644 --- a/arduboy-rust/src/prelude.rs +++ b/arduboy-rust/src/prelude.rs @@ -10,10 +10,13 @@ pub use crate::hardware::buttons::{self, *}; pub use crate::hardware::led::{self, *}; pub use crate::heapless::{LinearMap, String, Vec}; pub use crate::library::arduboy2::{self, *}; -pub use crate::library::arduboy_tone::{self, ArduboyTones}; +pub use crate::library::arduboy_tones::{self, ArduboyTones}; pub use crate::library::arduino::*; pub use crate::library::ardvoice::{self, ArdVoice}; pub use crate::library::c::*; +#[doc(hidden)] +pub use crate::library::arduboyfx::{ fx as FX}; +pub use crate::library::arduboyfx::{self}; pub use crate::library::eeprom::{EEPROM, EEPROMBYTE, EEPROMBYTECHECKLESS}; #[doc(hidden)] pub use crate::library::progmem::Pstring; @@ -21,8 +24,10 @@ pub use crate::library::sprites; pub use crate::print::*; pub use crate::{ f, get_ardvoice_tone_addr, get_sprite_addr, get_string_addr, get_tones_addr, progmem, - serial_print as serial, + }; +#[doc(inline)] +pub use crate::{serial_print as serial}; use core::cmp; pub use core::ffi::{ c_char, c_double, c_float, c_int, c_long, c_longlong, c_size_t, c_uchar, c_uint, c_ulong, diff --git a/docs/doc/.lock b/docs/doc/.lock deleted file mode 100644 index e69de29..0000000 diff --git a/docs/doc/arduboy_rust/all.html b/docs/doc/arduboy_rust/all.html deleted file mode 100644 index af99ddb..0000000 --- a/docs/doc/arduboy_rust/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Structs

Enums

Traits

Macros

Functions

Type Aliases

Constants

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy2/constant.FONT_SIZE.html b/docs/doc/arduboy_rust/arduboy2/constant.FONT_SIZE.html deleted file mode 100644 index bdf472a..0000000 --- a/docs/doc/arduboy_rust/arduboy2/constant.FONT_SIZE.html +++ /dev/null @@ -1,3 +0,0 @@ -FONT_SIZE in arduboy_rust::arduboy2 - Rust
pub const FONT_SIZE: u8 = 6;
Expand description

The standard font size of the arduboy

-

this is to calculate with it.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy2/constant.HEIGHT.html b/docs/doc/arduboy_rust/arduboy2/constant.HEIGHT.html deleted file mode 100644 index 111caed..0000000 --- a/docs/doc/arduboy_rust/arduboy2/constant.HEIGHT.html +++ /dev/null @@ -1,3 +0,0 @@ -HEIGHT in arduboy_rust::arduboy2 - Rust

Constant arduboy_rust::arduboy2::HEIGHT

source ·
pub const HEIGHT: u8 = 64;
Expand description

The standard height of the arduboy

-

this is to calculate with it.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy2/constant.WIDTH.html b/docs/doc/arduboy_rust/arduboy2/constant.WIDTH.html deleted file mode 100644 index 30ecaed..0000000 --- a/docs/doc/arduboy_rust/arduboy2/constant.WIDTH.html +++ /dev/null @@ -1,3 +0,0 @@ -WIDTH in arduboy_rust::arduboy2 - Rust

Constant arduboy_rust::arduboy2::WIDTH

source ·
pub const WIDTH: u8 = 128;
Expand description

The standard width of the arduboy

-

this is to calculate with it.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy2/enum.Color.html b/docs/doc/arduboy_rust/arduboy2/enum.Color.html deleted file mode 100644 index 96c2b1b..0000000 --- a/docs/doc/arduboy_rust/arduboy2/enum.Color.html +++ /dev/null @@ -1,26 +0,0 @@ -Color in arduboy_rust::arduboy2 - Rust
#[repr(u8)]
pub enum Color { - Black, - White, -}
Expand description

This item is to chose between Black or White

-

Variants§

§

Black

Led is off

-
§

White

Led is on

-

Trait Implementations§

source§

impl Clone for Color

source§

fn clone(&self) -> Color

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Color

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for Color

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl Not for Color

§

type Output = Color

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl Ord for Color

source§

fn cmp(&self, other: &Color) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<Color> for Color

source§

fn eq(&self, other: &Color) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<Color> for Color

source§

fn partial_cmp(&self, other: &Color) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for Color

source§

impl Eq for Color

source§

impl StructuralEq for Color

source§

impl StructuralPartialEq for Color

Auto Trait Implementations§

§

impl RefUnwindSafe for Color

§

impl Send for Color

§

impl Sync for Color

§

impl Unpin for Color

§

impl UnwindSafe for Color

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy2/index.html b/docs/doc/arduboy_rust/arduboy2/index.html deleted file mode 100644 index aad1156..0000000 --- a/docs/doc/arduboy_rust/arduboy2/index.html +++ /dev/null @@ -1,3 +0,0 @@ -arduboy_rust::arduboy2 - Rust

Module arduboy_rust::arduboy2

source ·
Expand description

This is the Module to interact in a save way with the Arduboy2 C++ library.

-

All of the functions are safe wrapped inside the Arduboy2 struct.

-

Structs

  • This is the struct to interact in a save way with the Arduboy2 C++ library.
  • This struct is used by a few Arduboy functions.
  • This struct is used by a few Arduboy functions.

Enums

  • This item is to chose between Black or White

Constants

  • The standard font size of the arduboy
  • The standard height of the arduboy
  • The standard width of the arduboy
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy2/sidebar-items.js b/docs/doc/arduboy_rust/arduboy2/sidebar-items.js deleted file mode 100644 index 5a2e74d..0000000 --- a/docs/doc/arduboy_rust/arduboy2/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["FONT_SIZE","HEIGHT","WIDTH"],"enum":["Color"],"struct":["Arduboy2","Point","Rect"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy2/struct.Arduboy2.html b/docs/doc/arduboy_rust/arduboy2/struct.Arduboy2.html deleted file mode 100644 index 5d52c79..0000000 --- a/docs/doc/arduboy_rust/arduboy2/struct.Arduboy2.html +++ /dev/null @@ -1,379 +0,0 @@ -Arduboy2 in arduboy_rust::arduboy2 - Rust
pub struct Arduboy2 {}
Expand description

This is the struct to interact in a save way with the Arduboy2 C++ library.

-

Implementations§

source§

impl Arduboy2

source

pub const fn new() -> Self

gives you a new instance of the Arduboy2

-
Example
-
const arduboy: Arduboy2 = Arduboy2::new();
-
source

pub fn begin(&self)

Initialize the hardware, display the boot logo, provide boot utilities, etc. -This function should be called once near the start of the sketch, usually in setup(), before using any other functions in this class. It initializes the display, displays the boot logo, provides “flashlight” and system control features and initializes audio control.

-
source

pub fn clear(&self)

Clear the display buffer and set the text cursor to location 0, 0.

-
source

pub fn display(&self)

Copy the contents of the display buffer to the display. -The contents of the display buffer in RAM are copied to the display and will appear on the screen.

-
source

pub fn display_and_clear_buffer(&self)

Copy the contents of the display buffer to the display. The display buffer will be cleared to zero.

-

Operation is the same as calling display() without parameters except additionally the display buffer will be cleared.

-
source

pub fn draw_fast_hline(&self, x: i16, y: i16, w: u8, color: Color)

Draw a horizontal line.

-
Parameters:
-
    -
  • x The X coordinate of the left start point.
  • -
  • y The Y coordinate of the left start point.
  • -
  • w The width of the line.
  • -
-

color The color of the line (optional; defaults to WHITE).

-
source

pub fn draw_fast_vline(&self, x: i16, y: i16, h: u8, color: Color)

Draw a vertical line.

-
Parameters:
-
    -
  • x The X coordinate of the left start point.
  • -
  • y The Y coordinate of the left start point.
  • -
  • h The height of the line.
  • -
-

color The color of the line (optional; defaults to WHITE).

-
source

pub fn draw_pixel(&self, x: i16, y: i16, color: Color)

Set a single pixel in the display buffer to the specified color.

-
Parameters
-
    -
  • x The X coordinate of the pixel.
  • -
  • y The Y coordinate of the pixel.
  • -
  • color The color of the pixel (optional; defaults to WHITE).
  • -
-

The single pixel specified location in the display buffer is set to the specified color. The values WHITE or BLACK can be used for the color. If the color parameter isn’t included, the pixel will be set to WHITE.

-
source

pub fn fill_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

Draw a filled-in rectangle of a specified width and height.

-
Parameters
-
    -
  • x The X coordinate of the upper left corner.
  • -
  • y The Y coordinate of the upper left corner.
  • -
  • w The width of the rectangle.
  • -
  • h The height of the rectangle.
  • -
-

color The color of the pixel (optional; defaults to WHITE).

-
source

pub fn draw_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

Draw a rectangle of a specified width and height.

-

Parameters

-
    -
  • x The X coordinate of the upper left corner.
  • -
  • y The Y coordinate of the upper left corner.
  • -
  • w The width of the rectangle.
  • -
  • h The height of the rectangle.
  • -
  • color The color of the pixel (optional; defaults to WHITE).
  • -
-
source

pub fn draw_circle(&self, x: i16, y: i16, r: u8, color: Color)

Draw a circle of a given radius.

-

Parameters

-
    -
  • x0 The X coordinate of the circle’s center.
  • -
  • y0 The Y coordinate of the circle’s center.
  • -
  • r The radius of the circle in pixels.
  • -
  • color The circle’s color (optional; defaults to WHITE).
  • -
-
source

pub fn fill_circle(&self, x: i16, y: i16, r: u8, color: Color)

Draw a filled-in circle of a given radius.

-
Parameters
-
    -
  • x The X coordinate of the circle’s center.
  • -
  • y The Y coordinate of the circle’s center.
  • -
  • r The radius of the circle in pixels.
  • -
-

color The circle’s color (optional; defaults to WHITE).

-
source

pub fn fill_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

Draw a filled-in rectangle with rounded corners.

-

Parameters

-
    -
  • x The X coordinate of the left edge.
  • -
  • y The Y coordinate of the top edge.
  • -
  • w The width of the rectangle.
  • -
  • h The height of the rectangle.
  • -
  • r The radius of the semicircles forming the corners.
  • -
  • color The color of the rectangle (optional; defaults to WHITE).
  • -
-
source

pub fn draw_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

Draw a rectangle with rounded corners.

-

Parameters

-
    -
  • x The X coordinate of the left edge.
  • -
  • y The Y coordinate of the top edge.
  • -
  • w The width of the rectangle.
  • -
  • h The height of the rectangle.
  • -
  • r The radius of the semicircles forming the corners.
  • -
  • color The color of the rectangle (optional; defaults to WHITE).
  • -
-
source

pub fn draw_triangle( - &self, - x0: i16, - y0: i16, - x1: i16, - y1: i16, - x2: i16, - y2: i16, - color: Color -)

Draw a triangle given the coordinates of each corner.

-

Parameters

-
    -
  • x0,x1,x2 The X coordinates of the corners.
  • -
  • y0,y1,y2 The Y coordinates of the corners.
  • -
  • color The triangle’s color (optional; defaults to WHITE).
  • -
-

A triangle is drawn by specifying each of the three corner locations. The corners can be at any position with respect to the others.

-
source

pub fn fill_triangle( - &self, - x0: i16, - y0: i16, - x1: i16, - y1: i16, - x2: i16, - y2: i16, - color: Color -)

Draw a filled-in triangle given the coordinates of each corner.

-

Parameters

-
    -
  • x0,x1,x2 The X coordinates of the corners.
  • -
  • y0,y1,y2 The Y coordinates of the corners.
  • -
  • color The triangle’s color (optional; defaults to WHITE).
  • -
-

A triangle is drawn by specifying each of the three corner locations. The corners can be at any position with respect to the others.

-
source

pub fn get_pixel(&self, x: u8, y: u8) -> Color

Returns the state of the given pixel in the screen buffer.

-
Parameters
-
    -
  • x The X coordinate of the pixel.
  • -
  • y The Y coordinate of the pixel.
  • -
-
Returns
-

WHITE if the pixel is on or BLACK if the pixel is off.

-
source

pub fn init_random_seed(&self)

Seed the random number generator with a random value.

-

The Arduino pseudorandom number generator is seeded with the random value returned from a call to generateRandomSeed().

-
source

pub fn just_pressed(&self, button: ButtonSet) -> bool

Check if a button has just been pressed.

-
Parameters
-
    -
  • button The button to test for. Only one button should be specified.
  • -
-
Returns
-

true if the specified button has just been pressed.

-

Return true if the given button was pressed between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.

-

There is no need to check for the release of the button since it must have been released for this function to return true when pressed again.

-

This function should only be used to test a single button.

-
source

pub fn just_released(&self, button: ButtonSet) -> bool

Check if a button has just been released.

-
Parameters
-
    -
  • button The button to test for. Only one button should be specified.
  • -
-
Returns
-

true if the specified button has just been released.

-

Return true if the given button was released between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.

-

There is no need to check for the released of the button since it must have been pressed for this function to return true when pressed again.

-

This function should only be used to test a single button.

-
source

pub fn not_pressed(&self, button: ButtonSet) -> bool

Test if the specified buttons are not pressed.

-
Parameters
-
    -
  • buttons A bit mask indicating which buttons to test. (Can be a single button)
  • -
-
Returns
-

True if all buttons in the provided mask are currently released.

-

Read the state of the buttons and return true if all the buttons in the specified mask are currently released.

-
source

pub fn next_frame(&self) -> bool

Indicate that it’s time to render the next frame.

-
Returns
-

true if it’s time for the next frame.

-

When this function returns true, the amount of time has elapsed to display the next frame, as specified by setFrameRate() or setFrameDuration().

-

This function will normally be called at the start of the rendering loop which would wait for true to be returned before rendering and displaying the next frame.

-
source

pub fn poll_buttons(&self)

Poll the buttons and track their state over time.

-

Read and save the current state of the buttons and also keep track of the button state when this function was previously called. These states are used by the justPressed() and justReleased() functions to determine if a button has changed state between now and the previous call to pollButtons().

-

This function should be called once at the start of each new frame.

-

The justPressed() and justReleased() functions rely on this function.

-
source

pub fn pressed(&self, button: ButtonSet) -> bool

Test if the all of the specified buttons are pressed.

-
Parameters
-
    -
  • buttons A bit mask indicating which buttons to test. (Can be a single button)
  • -
-
Returns
-

true if all buttons in the provided mask are currently pressed.

-

Read the state of the buttons and return true if all of the buttons in the specified mask are being pressed.

-
source

pub fn print(&self, x: impl Printable)

The Arduino Print class is available for writing text to the screen buffer.

-

For an Arduboy2 class object, functions provided by the Arduino Print class can be used to write text to the screen buffer, in the same manner as the Arduino Serial.print(), etc., functions.

-

Print will use the write() function to actually draw each character in the screen buffer, using the library’s font5x7 font. Two character values are handled specially:

-
    -
  • ASCII newline/line feed (\n, 0x0A, inverse white circle). This will move the text cursor position to the start of the next line, based on the current text size.
  • -
  • ASCII carriage return (\r, 0x0D, musical eighth note). This character will be ignored.
  • -
-

Example

- -
let value: i16 = 42;
-
-arduboy.print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the
-                                       // text cursor to the start of the next line
-arduboy.print(f!(b"Hello World\n")); // Prints "Hello World" but does not use the 2kb ram
-arduboy.print(value); // Prints "42"
-arduboy.print("\n\0"); // Sets the text cursor to the start of the next line
-arduboy.print("hello world") // Prints normal [&str]
-
source

pub fn set_cursor(&self, x: i16, y: i16)

Set the location of the text cursor.

-
Parameters
-
    -
  • -

    x The X (horizontal) coordinate, in pixels, for the new location of the text cursor.

    -
  • -
  • -

    y The Y (vertical) coordinate, in pixels, for the new location of the text cursor.

    -
  • -
-

The location of the text cursor is set the the specified coordinates. The coordinates are in pixels. Since the coordinates can specify any pixel location, the text does not have to be placed on specific rows. As with all drawing functions, location 0, 0 is the top left corner of the display. The cursor location represents the top left corner of the next character written.

-
source

pub fn set_frame_rate(&self, rate: u8)

Set the frame rate used by the frame control functions.

-
Parameters
-
    -
  • rate The desired frame rate in frames per second.
  • -
-

Normally, the frame rate would be set to the desired value once, at the start of the game, but it can be changed at any time to alter the frame update rate.

-
source

pub fn set_text_size(&self, size: u8)

Set the text character size.

-
Parameters
-
    -
  • s The text size multiplier. Must be 1 or higher.
  • -
-

Setting a text size of 1 will result in standard size characters with one pixel for each bit in the bitmap for a character. The value specified is a multiplier. A value of 2 will double the width and height. A value of 3 will triple the dimensions, etc.

-
source

pub fn audio_on(&self)

Turn sound on.

-

The system is configured to generate sound. This function sets the sound mode only until the unit is powered off.

-
source

pub fn audio_off(&self)

Turn sound off (mute).

-

The system is configured to not produce sound (mute). This function sets the sound mode only until the unit is powered off.

-
source

pub fn audio_save_on_off(&self)

Save the current sound state in EEPROM.

-

The current sound state, set by on() or off(), is saved to the reserved system area in EEPROM. This allows the state to carry over between power cycles and after uploading a different sketch.

-

Note -EEPROM is limited in the number of times it can be written to. Sketches should not continuously change and then save the state rapidly.

-
source

pub fn audio_toggle(&self)

Toggle the sound on/off state.

-

If the system is configured for sound on, it will be changed to sound off (mute). If sound is off, it will be changed to on. This function sets the sound mode only until the unit is powered off. To save the current mode use saveOnOff().

-
source

pub fn audio_on_and_save(&self)

Combines the use function of audio_on() and audio_save_on_off()

-
source

pub fn audio_enabled(&self) -> bool

Get the current sound state.

-
Returns
-

true if sound is currently enabled (not muted).

-

This function should be used by code that actually generates sound. If true is returned, sound can be produced. If false is returned, sound should be muted.

-
source

pub fn invert(&self, inverse: bool)

Invert the entire display or set it back to normal.

-
Parameters
-
    -
  • inverse true will invert the display. false will set the display to no-inverted.
  • -
-

Calling this function with a value of true will set the display to inverted mode. A pixel with a value of 0 will be on and a pixel set to 1 will be off.

-

Once in inverted mode, the display will remain this way until it is set back to non-inverted mode by calling this function with false.

-
source

pub fn collide_point(&self, point: Point, rect: Rect) -> bool

Test if a point falls within a rectangle.

-

Parameters

-
    -
  • point A structure describing the location of the point.
  • -
  • rect A structure describing the location and size of the rectangle.
  • -
-

Returns -true if the specified point is within the specified rectangle.

-

This function is intended to detemine if an object, whose boundaries are defined by the given rectangle, is in contact with the given point.

-
source

pub fn collide_rect(&self, rect1: Rect, rect2: Rect) -> bool

Test if a rectangle is intersecting with another rectangle.

-

Parameters

-
    -
  • rect1,rect2 Structures describing the size and locations of the rectangles.
  • -
-

Returns -true if the first rectangle is intersecting the second.

-

This function is intended to detemine if an object, whose boundaries are defined by the given rectangle, is in contact with another rectangular object.

-
source

pub fn digital_write_rgb_single(&self, color: u8, val: u8)

Set one of the RGB LEDs digitally, to either fully on or fully off.

-

Parameters

-
    -
  • color The name of the LED to set. The value given should be one of RED_LED, GREEN_LED or BLUE_LED.
  • -
  • val Indicates whether to turn the specified LED on or off. The value given should be RGB_ON or RGB_OFF.
  • -
-

This 2 parameter version of the function will set a single LED within the RGB LED either fully on or fully off. See the description of the 3 parameter version of this function for more details on the RGB LED.

-
source

pub fn digital_write_rgb(&self, red: u8, green: u8, blue: u8)

Set the RGB LEDs digitally, to either fully on or fully off.

-

Parameters

-
    -
  • red,green,blue Use value RGB_ON or RGB_OFF to set each LED.
  • -
-

The RGB LED is actually individual red, green and blue LEDs placed very close together in a single package. This 3 parameter version of the function will set each LED either on or off, to set the RGB LED to 7 different colors at their highest brightness or turn it off.

-
 The colors are as follows:
- RED LED    GREEN LED    BLUE LED    COLOR
- RGB_OFF    RGB_OFF      RGB_OFF     OFF
- RGB_OFF    RGB_OFF      RGB_ON      Blue
- RGB_OFF    RGB_ON       RGB_OFF     Green
- RGB_OFF    RGB_ON       RGB_ON      Cyan
- RGB_ON     RGB_OFF      RGB_OFF     Red
- RGB_ON     RGB_OFF      RGB_ON      Magenta
- RGB_ON     RGB_ON       RGB_OFF     Yellow
- RGB_ON     RGB_ON       RGB_ON      White
-
source

pub fn set_rgb_led_single(&self, color: u8, val: u8)

Set the brightness of one of the RGB LEDs without affecting the others.

-

Parameters

-
    -
  • color The name of the LED to set. The value given should be one of RED_LED, GREEN_LED or BLUE_LED.
  • -
  • val The brightness value for the LED, from 0 to 255.
  • -
-

Note

-
-

In order to use this function, the 3 parameter version must first be called at least once, in order to initialize the hardware.

-
-

This 2 parameter version of the function will set the brightness of a single LED within the RGB LED without affecting the current brightness of the other two. See the description of the 3 parameter version of this function for more details on the RGB LED.

-
source

pub fn set_rgb_led(&self, red: u8, green: u8, blue: u8)

Set the light output of the RGB LED.

-

Parameters

-
    -
  • red,green,blue The brightness value for each LED.
  • -
-

The RGB LED is actually individual red, green and blue LEDs placed very close together in a single package. By setting the brightness of each LED, the RGB LED can show various colors and intensities. The brightness of each LED can be set to a value from 0 (fully off) to 255 (fully on).

-

Note

-
-

Certain libraries that take control of the hardware timers may interfere with the ability of this function to properly control the RGB LED. ArduboyPlaytune is one such library known to do this. The digital_write_rgb() function will still work properly in this case.

-
-

Note

-
-

Many of the Kickstarter Arduboys were accidentally shipped with the RGB LED installed incorrectly. For these units, the green LED cannot be lit. As long as the green led is set to off, setting the red LED will actually control the blue LED and setting the blue LED will actually control the red LED. If the green LED is turned fully on, none of the LEDs will light.

-
-
source

pub fn every_x_frames(&self, frames: u8) -> bool

Indicate if the specified number of frames has elapsed.

-

Parameters

-
    -
  • frames The desired number of elapsed frames.
  • -
-

Returns -true if the specified number of frames has elapsed.

-

This function should be called with the same value each time for a given event. It will return true if the given number of frames has elapsed since the previous frame in which it returned true.

-
Example
-

If you wanted to fire a shot every 5 frames while the A button is being held down:

- -
if arduboy.everyXFrames(5) {
-    if arduboy.pressed(A_BUTTON) {
-        fireShot();
-    }
-}
-
source

pub fn flip_vertical(&self, flipped: bool)

Flip the display vertically or set it back to normal.

-

Parameters

-
    -
  • flipped true will set vertical flip mode. false will set normal vertical orientation.
  • -
-

Calling this function with a value of true will cause the Y coordinate to start at the bottom edge of the display instead of the top, effectively flipping the display vertically.

-

Once in vertical flip mode, it will remain this way until normal vertical mode is set by calling this function with a value of false.

-
source

pub fn flip_horizontal(&self, flipped: bool)

Flip the display horizontally or set it back to normal.

-

Parameters

-
    -
  • flipped true will set horizontal flip mode. false will set normal horizontal orientation.
  • -
-

Calling this function with a value of true will cause the X coordinate to start at the left edge of the display instead of the right, effectively flipping the display horizontally.

-

Once in horizontal flip mode, it will remain this way until normal horizontal mode is set by calling this function with a value of false.

-
source

pub fn set_text_color(&self, color: Color)

Set the text foreground color.

-

Parameters

-
    -
  • color The color to be used for following text. The values WHITE or BLACK should be used.
  • -
-
source

pub fn set_text_background_color(&self, color: Color)

Set the text background color.

-

Parameters

-
    -
  • color The background color to be used for following text. The values WHITE or BLACK should be used.
  • -
-

The background pixels of following characters will be set to the specified color.

-

However, if the background color is set to be the same as the text color, the background will be transparent. Only the foreground pixels will be drawn. The background pixels will remain as they were before the character was drawn.

-
source

pub fn set_cursor_x(&self, x: i16)

Set the X coordinate of the text cursor location.

-

Parameters

-
    -
  • x The X (horizontal) coordinate, in pixels, for the new location of the text cursor.
  • -
-

The X coordinate for the location of the text cursor is set to the specified value, leaving the Y coordinate unchanged. For more details about the text cursor, see the setCursor() function.

-
source

pub fn set_cursor_y(&self, y: i16)

Set the Y coordinate of the text cursor location.

-

Parameters

-
    -
  • y The Y (vertical) coordinate, in pixels, for the new location of the text cursor.
  • -
-

The Y coordinate for the location of the text cursor is set to the specified value, leaving the X coordinate unchanged. For more details about the text cursor, see the setCursor() function.

-
source

pub fn set_text_wrap(&self, w: bool)

Set or disable text wrap mode.

-

Parameters

-
    -
  • w true enables text wrap mode. false disables it.
  • -
-

Text wrap mode is enabled by specifying true. In wrap mode, if a character to be drawn would end up partially or fully past the right edge of the screen (based on the current text size), it will be placed at the start of the next line. The text cursor will be adjusted accordingly.

-

If wrap mode is disabled, characters will always be written at the current text cursor position. A character near the right edge of the screen may only be partially displayed and characters drawn at a position past the right edge of the screen will remain off screen.

-
source

pub fn idle(&self)

Idle the CPU to save power.

-

This puts the CPU in idle sleep mode. You should call this as often as you can for the best power savings. The timer 0 overflow interrupt will wake up the chip every 1ms, so even at 60 FPS a well written app should be able to sleep maybe half the time in between rendering it’s own frames.

-

Auto Trait Implementations§

§

impl RefUnwindSafe for Arduboy2

§

impl Send for Arduboy2

§

impl Sync for Arduboy2

§

impl Unpin for Arduboy2

§

impl UnwindSafe for Arduboy2

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy2/struct.Point.html b/docs/doc/arduboy_rust/arduboy2/struct.Point.html deleted file mode 100644 index dfe4e51..0000000 --- a/docs/doc/arduboy_rust/arduboy2/struct.Point.html +++ /dev/null @@ -1,17 +0,0 @@ -Point in arduboy_rust::arduboy2 - Rust
pub struct Point {
-    pub x: i16,
-    pub y: i16,
-}
Expand description

This struct is used by a few Arduboy functions.

-

Fields§

§x: i16

Position X

-
§y: i16

Position Y

-

Trait Implementations§

source§

impl Clone for Point

source§

fn clone(&self) -> Point

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Point

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for Point

Auto Trait Implementations§

§

impl RefUnwindSafe for Point

§

impl Send for Point

§

impl Sync for Point

§

impl Unpin for Point

§

impl UnwindSafe for Point

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy2/struct.Rect.html b/docs/doc/arduboy_rust/arduboy2/struct.Rect.html deleted file mode 100644 index 013df52..0000000 --- a/docs/doc/arduboy_rust/arduboy2/struct.Rect.html +++ /dev/null @@ -1,21 +0,0 @@ -Rect in arduboy_rust::arduboy2 - Rust

Struct arduboy_rust::arduboy2::Rect

source ·
pub struct Rect {
-    pub x: i16,
-    pub y: i16,
-    pub width: u8,
-    pub height: u8,
-}
Expand description

This struct is used by a few Arduboy functions.

-

Fields§

§x: i16

Position X

-
§y: i16

Position Y

-
§width: u8

Rect width

-
§height: u8

Rect height

-

Trait Implementations§

source§

impl Clone for Rect

source§

fn clone(&self) -> Rect

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Rect

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for Rect

Auto Trait Implementations§

§

impl RefUnwindSafe for Rect

§

impl Send for Rect

§

impl Sync for Rect

§

impl Unpin for Rect

§

impl UnwindSafe for Rect

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A0.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A0.html deleted file mode 100644 index 7b5cd5f..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A0 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A0: u16 = 28;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A0H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A0H.html deleted file mode 100644 index 667d6c0..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A0H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A0H: u16 = _; // 32_796u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A1.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A1.html deleted file mode 100644 index d96e562..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A1 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A1: u16 = 55;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A1H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A1H.html deleted file mode 100644 index 308548a..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A1H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A1H: u16 = _; // 32_823u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A2.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A2.html deleted file mode 100644 index c800ed6..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A2 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A2: u16 = 110;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A2H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A2H.html deleted file mode 100644 index 7d6c474..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A2H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A2H: u16 = _; // 32_878u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A3.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A3.html deleted file mode 100644 index 504265b..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A3 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A3: u16 = 220;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A3H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A3H.html deleted file mode 100644 index adc1b7c..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A3H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A3H: u16 = _; // 32_988u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A4.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A4.html deleted file mode 100644 index 12e09fc..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A4 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A4: u16 = 440;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A4H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A4H.html deleted file mode 100644 index 2eaf4f3..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A4H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A4H: u16 = _; // 33_208u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A5.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A5.html deleted file mode 100644 index 70adfbb..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A5 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A5: u16 = 880;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A5H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A5H.html deleted file mode 100644 index f11ac1b..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A5H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A5H: u16 = _; // 33_648u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A6.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A6.html deleted file mode 100644 index f468b81..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A6 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A6: u16 = 1760;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A6H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A6H.html deleted file mode 100644 index 9b60826..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A6H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A6H: u16 = _; // 34_528u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A7.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A7.html deleted file mode 100644 index 97f5626..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A7 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A7: u16 = 3520;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A7H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A7H.html deleted file mode 100644 index f475613..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A7H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A7H: u16 = _; // 36_288u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A8.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A8.html deleted file mode 100644 index cdc7ff3..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A8 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A8: u16 = 7040;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A8H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A8H.html deleted file mode 100644 index e243716..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A8H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A8H: u16 = _; // 39_808u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A9.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A9.html deleted file mode 100644 index d9cd147..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A9 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A9: u16 = 14080;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A9H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A9H.html deleted file mode 100644 index 687fa30..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A9H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A9H: u16 = _; // 46_848u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS0.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS0.html deleted file mode 100644 index 15b1ed5..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS0 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS0: u16 = 29;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS0H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS0H.html deleted file mode 100644 index 74b7b6b..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS0H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS0H: u16 = _; // 32_797u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS1.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS1.html deleted file mode 100644 index 8479e8a..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS1 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS1: u16 = 58;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS1H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS1H.html deleted file mode 100644 index 8814090..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS1H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS1H: u16 = _; // 32_826u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS2.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS2.html deleted file mode 100644 index 92f46ad..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS2 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS2: u16 = 117;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS2H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS2H.html deleted file mode 100644 index 1301db2..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS2H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS2H: u16 = _; // 32_885u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS3.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS3.html deleted file mode 100644 index 85bdaf7..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS3 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS3: u16 = 233;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS3H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS3H.html deleted file mode 100644 index 2a808ee..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS3H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS3H: u16 = _; // 33_001u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS4.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS4.html deleted file mode 100644 index 067ebaf..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS4 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS4: u16 = 466;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS4H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS4H.html deleted file mode 100644 index 3ed536b..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS4H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS4H: u16 = _; // 33_234u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS5.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS5.html deleted file mode 100644 index ea9c5af..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS5 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS5: u16 = 932;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS5H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS5H.html deleted file mode 100644 index 498fd01..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS5H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS5H: u16 = _; // 33_700u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS6.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS6.html deleted file mode 100644 index 95c5811..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS6 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS6: u16 = 1865;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS6H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS6H.html deleted file mode 100644 index 4a6f61d..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS6H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS6H: u16 = _; // 34_633u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS7.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS7.html deleted file mode 100644 index b605b50..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS7 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS7: u16 = 3729;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS7H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS7H.html deleted file mode 100644 index b60e87f..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS7H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS7H: u16 = _; // 36_497u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS8.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS8.html deleted file mode 100644 index 2978d1d..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS8 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS8: u16 = 7459;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS8H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS8H.html deleted file mode 100644 index a542016..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS8H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS8H: u16 = _; // 40_227u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS9.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS9.html deleted file mode 100644 index bf1fef3..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS9 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS9: u16 = 14917;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS9H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS9H.html deleted file mode 100644 index adaf343..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS9H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS9H: u16 = _; // 47_685u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B0.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B0.html deleted file mode 100644 index 9e64689..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B0 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B0: u16 = 31;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B0H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B0H.html deleted file mode 100644 index 6d6aa7e..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B0H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B0H: u16 = _; // 32_799u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B1.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B1.html deleted file mode 100644 index 5ba9992..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B1 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B1: u16 = 62;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B1H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B1H.html deleted file mode 100644 index 50f6c1d..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B1H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B1H: u16 = _; // 32_830u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B2.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B2.html deleted file mode 100644 index 1b1f118..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B2 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B2: u16 = 123;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B2H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B2H.html deleted file mode 100644 index 0e68116..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B2H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B2H: u16 = _; // 32_891u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B3.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B3.html deleted file mode 100644 index 682f4eb..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B3 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B3: u16 = 247;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B3H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B3H.html deleted file mode 100644 index 112dead..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B3H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B3H: u16 = _; // 33_015u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B4.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B4.html deleted file mode 100644 index 71b8e9d..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B4 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B4: u16 = 494;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B4H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B4H.html deleted file mode 100644 index 76d9ce6..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B4H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B4H: u16 = _; // 33_262u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B5.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B5.html deleted file mode 100644 index 20ded92..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B5 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B5: u16 = 988;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B5H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B5H.html deleted file mode 100644 index 6571d56..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B5H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B5H: u16 = _; // 33_756u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B6.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B6.html deleted file mode 100644 index 58c0250..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B6 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B6: u16 = 1976;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B6H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B6H.html deleted file mode 100644 index 9632305..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B6H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B6H: u16 = _; // 34_744u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B7.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B7.html deleted file mode 100644 index f4279fc..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B7 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B7: u16 = 3951;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B7H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B7H.html deleted file mode 100644 index 2f48252..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B7H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B7H: u16 = _; // 36_719u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B8.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B8.html deleted file mode 100644 index 90a8582..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B8 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B8: u16 = 7902;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B8H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B8H.html deleted file mode 100644 index d9e621e..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B8H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B8H: u16 = _; // 40_670u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B9.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B9.html deleted file mode 100644 index 4720520..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B9 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B9: u16 = 15804;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B9H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B9H.html deleted file mode 100644 index 6e84364..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B9H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B9H: u16 = _; // 48_572u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C0.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C0.html deleted file mode 100644 index 50a18ba..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C0 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C0: u16 = 16;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C0H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C0H.html deleted file mode 100644 index 49c680c..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C0H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C0H: u16 = _; // 32_784u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C1.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C1.html deleted file mode 100644 index 9f7dbd1..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C1 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C1: u16 = 33;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C1H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C1H.html deleted file mode 100644 index 3ff10b9..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C1H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C1H: u16 = _; // 32_801u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C2.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C2.html deleted file mode 100644 index 93b81ae..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C2 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C2: u16 = 65;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C2H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C2H.html deleted file mode 100644 index db982b8..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C2H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C2H: u16 = _; // 32_833u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C3.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C3.html deleted file mode 100644 index b6a2896..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C3 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C3: u16 = 131;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C3H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C3H.html deleted file mode 100644 index f6f7352..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C3H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C3H: u16 = _; // 32_899u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C4.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C4.html deleted file mode 100644 index a4263a6..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C4 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C4: u16 = 262;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C4H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C4H.html deleted file mode 100644 index f647570..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C4H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C4H: u16 = _; // 33_030u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C5.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C5.html deleted file mode 100644 index 8d37f1a..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C5 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C5: u16 = 523;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C5H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C5H.html deleted file mode 100644 index bf8c834..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C5H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C5H: u16 = _; // 33_291u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C6.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C6.html deleted file mode 100644 index 17d92e4..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C6 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C6: u16 = 1047;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C6H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C6H.html deleted file mode 100644 index e9ed99e..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C6H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C6H: u16 = _; // 33_815u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C7.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C7.html deleted file mode 100644 index 98c15ce..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C7 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C7: u16 = 2093;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C7H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C7H.html deleted file mode 100644 index d53baa0..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C7H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C7H: u16 = _; // 34_861u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C8.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C8.html deleted file mode 100644 index 963a74a..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C8 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C8: u16 = 4186;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C8H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C8H.html deleted file mode 100644 index 51b2627..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C8H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C8H: u16 = _; // 36_954u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C9.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C9.html deleted file mode 100644 index 16ede8b..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C9 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C9: u16 = 8372;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C9H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C9H.html deleted file mode 100644 index 11dcb41..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C9H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C9H: u16 = _; // 41_140u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS0.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS0.html deleted file mode 100644 index 292e503..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS0 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS0: u16 = 17;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS0H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS0H.html deleted file mode 100644 index 2c17210..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS0H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS0H: u16 = _; // 32_785u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS1.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS1.html deleted file mode 100644 index 8fac893..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS1 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS1: u16 = 35;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS1H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS1H.html deleted file mode 100644 index faf8a52..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS1H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS1H: u16 = _; // 32_803u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS2.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS2.html deleted file mode 100644 index 9329630..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS2 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS2: u16 = 69;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS2H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS2H.html deleted file mode 100644 index 0983ab8..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS2H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS2H: u16 = _; // 32_837u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS3.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS3.html deleted file mode 100644 index 0c9e663..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS3 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS3: u16 = 139;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS3H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS3H.html deleted file mode 100644 index dfc4fa7..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS3H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS3H: u16 = _; // 32_907u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS4.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS4.html deleted file mode 100644 index 70a2ad1..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS4 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS4: u16 = 277;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS4H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS4H.html deleted file mode 100644 index b69b190..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS4H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS4H: u16 = _; // 33_045u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS5.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS5.html deleted file mode 100644 index 1abe50c..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS5 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS5: u16 = 554;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS5H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS5H.html deleted file mode 100644 index a99984a..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS5H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS5H: u16 = _; // 33_322u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS6.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS6.html deleted file mode 100644 index 7910851..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS6 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS6: u16 = 1109;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS6H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS6H.html deleted file mode 100644 index bb41885..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS6H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS6H: u16 = _; // 33_877u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS7.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS7.html deleted file mode 100644 index cf946d6..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS7 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS7: u16 = 2218;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS7H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS7H.html deleted file mode 100644 index 85e189b..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS7H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS7H: u16 = _; // 34_986u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS8.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS8.html deleted file mode 100644 index cb68bbb..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS8 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS8: u16 = 4435;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS8H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS8H.html deleted file mode 100644 index b979f4f..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS8H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS8H: u16 = _; // 37_203u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS9.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS9.html deleted file mode 100644 index 6b9af1b..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS9 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS9: u16 = 8870;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS9H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS9H.html deleted file mode 100644 index b802239..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS9H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS9H: u16 = _; // 41_638u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D0.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D0.html deleted file mode 100644 index 86dbfb1..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D0 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D0: u16 = 18;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D0H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D0H.html deleted file mode 100644 index 273fe90..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D0H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D0H: u16 = _; // 32_786u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D1.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D1.html deleted file mode 100644 index b1f74ce..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D1 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D1: u16 = 37;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D1H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D1H.html deleted file mode 100644 index 7a4bbb7..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D1H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D1H: u16 = _; // 32_805u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D2.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D2.html deleted file mode 100644 index f42a742..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D2 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D2: u16 = 73;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D2H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D2H.html deleted file mode 100644 index 0dcb44a..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D2H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D2H: u16 = _; // 32_841u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D3.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D3.html deleted file mode 100644 index 3c6d803..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D3 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D3: u16 = 147;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D3H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D3H.html deleted file mode 100644 index 4284d4c..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D3H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D3H: u16 = _; // 32_915u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D4.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D4.html deleted file mode 100644 index 212e267..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D4 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D4: u16 = 294;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D4H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D4H.html deleted file mode 100644 index f2af46c..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D4H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D4H: u16 = _; // 33_062u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D5.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D5.html deleted file mode 100644 index a5cc04d..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D5 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D5: u16 = 587;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D5H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D5H.html deleted file mode 100644 index a45e4fb..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D5H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D5H: u16 = _; // 33_355u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D6.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D6.html deleted file mode 100644 index e61ec3e..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D6 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D6: u16 = 1175;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D6H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D6H.html deleted file mode 100644 index 4724dfc..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D6H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D6H: u16 = _; // 33_943u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D7.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D7.html deleted file mode 100644 index b49f212..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D7 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D7: u16 = 2349;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D7H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D7H.html deleted file mode 100644 index 211f306..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D7H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D7H: u16 = _; // 35_117u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D8.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D8.html deleted file mode 100644 index 3168b06..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D8 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D8: u16 = 4699;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D8H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D8H.html deleted file mode 100644 index c150f3b..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D8H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D8H: u16 = _; // 37_467u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D9.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D9.html deleted file mode 100644 index 8f6e6f6..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D9 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D9: u16 = 9397;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D9H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D9H.html deleted file mode 100644 index 4e049a1..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D9H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D9H: u16 = _; // 42_165u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS0.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS0.html deleted file mode 100644 index 2ac65ba..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS0 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS0: u16 = 19;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS0H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS0H.html deleted file mode 100644 index 181bc9e..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS0H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS0H: u16 = _; // 32_787u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS1.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS1.html deleted file mode 100644 index b55535b..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS1 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS1: u16 = 39;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS1H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS1H.html deleted file mode 100644 index 7c48fbf..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS1H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS1H: u16 = _; // 32_807u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS2.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS2.html deleted file mode 100644 index ab00c9a..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS2 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS2: u16 = 78;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS2H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS2H.html deleted file mode 100644 index b4431c2..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS2H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS2H: u16 = _; // 32_846u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS3.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS3.html deleted file mode 100644 index d1564c1..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS3 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS3: u16 = 156;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS3H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS3H.html deleted file mode 100644 index a285ffe..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS3H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS3H: u16 = _; // 32_924u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS4.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS4.html deleted file mode 100644 index c99e79a..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS4 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS4: u16 = 311;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS4H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS4H.html deleted file mode 100644 index affeeeb..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS4H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS4H: u16 = _; // 33_079u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS5.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS5.html deleted file mode 100644 index 41bf00f..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS5 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS5: u16 = 622;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS5H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS5H.html deleted file mode 100644 index 81e4c5a..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS5H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS5H: u16 = _; // 33_390u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS6.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS6.html deleted file mode 100644 index a7d0357..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS6 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS6: u16 = 1245;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS6H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS6H.html deleted file mode 100644 index ac805d7..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS6H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS6H: u16 = _; // 34_013u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS7.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS7.html deleted file mode 100644 index 99b9504..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS7 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS7: u16 = 2489;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS7H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS7H.html deleted file mode 100644 index ae83eaf..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS7H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS7H: u16 = _; // 35_257u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS8.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS8.html deleted file mode 100644 index c1ac706..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS8 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS8: u16 = 4978;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS8H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS8H.html deleted file mode 100644 index 4082e38..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS8H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS8H: u16 = _; // 37_746u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS9.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS9.html deleted file mode 100644 index 97d9dab..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS9 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS9: u16 = 9956;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS9H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS9H.html deleted file mode 100644 index 57579fe..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS9H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS9H: u16 = _; // 42_724u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E0.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E0.html deleted file mode 100644 index 09a3af5..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E0 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E0: u16 = 21;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E0H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E0H.html deleted file mode 100644 index 4132ae2..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E0H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E0H: u16 = _; // 32_789u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E1.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E1.html deleted file mode 100644 index 823ebdb..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E1 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E1: u16 = 41;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E1H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E1H.html deleted file mode 100644 index bd1f434..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E1H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E1H: u16 = _; // 32_809u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E2.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E2.html deleted file mode 100644 index 4697980..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E2 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E2: u16 = 82;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E2H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E2H.html deleted file mode 100644 index cdae6a8..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E2H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E2H: u16 = _; // 32_850u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E3.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E3.html deleted file mode 100644 index 57f65c5..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E3 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E3: u16 = 165;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E3H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E3H.html deleted file mode 100644 index d6eca2b..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E3H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E3H: u16 = _; // 32_933u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E4.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E4.html deleted file mode 100644 index 2f0b259..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E4 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E4: u16 = 330;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E4H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E4H.html deleted file mode 100644 index f4e76e2..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E4H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E4H: u16 = _; // 33_098u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E5.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E5.html deleted file mode 100644 index 39e5122..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E5 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E5: u16 = 659;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E5H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E5H.html deleted file mode 100644 index d950e84..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E5H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E5H: u16 = _; // 33_427u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E6.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E6.html deleted file mode 100644 index a7c69a4..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E6 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E6: u16 = 1319;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E6H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E6H.html deleted file mode 100644 index 2769ef3..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E6H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E6H: u16 = _; // 34_087u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E7.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E7.html deleted file mode 100644 index d272c3c..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E7 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E7: u16 = 2637;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E7H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E7H.html deleted file mode 100644 index 1c665e7..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E7H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E7H: u16 = _; // 35_405u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E8.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E8.html deleted file mode 100644 index bbff400..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E8 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E8: u16 = 5274;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E8H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E8H.html deleted file mode 100644 index 7957db5..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E8H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E8H: u16 = _; // 38_042u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E9.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E9.html deleted file mode 100644 index 24ac25f..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E9 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E9: u16 = 10548;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E9H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E9H.html deleted file mode 100644 index 59ea18e..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E9H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E9H: u16 = _; // 43_316u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F0.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F0.html deleted file mode 100644 index 822bc88..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F0 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F0: u16 = 22;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F0H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F0H.html deleted file mode 100644 index 89ac84d..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F0H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F0H: u16 = _; // 32_790u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F1.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F1.html deleted file mode 100644 index 76c6d41..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F1 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F1: u16 = 44;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F1H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F1H.html deleted file mode 100644 index d02566f..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F1H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F1H: u16 = _; // 32_812u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F2.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F2.html deleted file mode 100644 index 467409c..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F2 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F2: u16 = 87;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F2H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F2H.html deleted file mode 100644 index 0b7a3ee..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F2H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F2H: u16 = _; // 32_855u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F3.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F3.html deleted file mode 100644 index 6d67a50..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F3 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F3: u16 = 175;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F3H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F3H.html deleted file mode 100644 index fa3ba33..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F3H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F3H: u16 = _; // 32_943u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F4.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F4.html deleted file mode 100644 index a8a51e4..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F4 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F4: u16 = 349;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F4H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F4H.html deleted file mode 100644 index a43c77a..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F4H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F4H: u16 = _; // 33_117u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F5.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F5.html deleted file mode 100644 index 8d65fe1..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F5 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F5: u16 = 698;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F5H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F5H.html deleted file mode 100644 index f120200..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F5H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F5H: u16 = _; // 33_466u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F6.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F6.html deleted file mode 100644 index 938584b..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F6 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F6: u16 = 1397;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F6H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F6H.html deleted file mode 100644 index 71273d0..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F6H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F6H: u16 = _; // 34_165u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F7.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F7.html deleted file mode 100644 index 686851b..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F7 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F7: u16 = 2794;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F7H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F7H.html deleted file mode 100644 index 05bd2c8..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F7H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F7H: u16 = _; // 35_562u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F8.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F8.html deleted file mode 100644 index 8fd5c21..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F8 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F8: u16 = 5588;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F8H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F8H.html deleted file mode 100644 index ea097b9..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F8H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F8H: u16 = _; // 38_356u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F9.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F9.html deleted file mode 100644 index f2092da..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F9 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F9: u16 = 11175;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F9H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F9H.html deleted file mode 100644 index 6595456..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F9H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F9H: u16 = _; // 43_943u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS0.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS0.html deleted file mode 100644 index 87b8745..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS0 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS0: u16 = 23;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS0H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS0H.html deleted file mode 100644 index 98638be..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS0H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS0H: u16 = _; // 32_791u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS1.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS1.html deleted file mode 100644 index cebf710..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS1 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS1: u16 = 46;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS1H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS1H.html deleted file mode 100644 index 030f643..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS1H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS1H: u16 = _; // 32_814u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS2.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS2.html deleted file mode 100644 index f0707eb..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS2 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS2: u16 = 93;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS2H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS2H.html deleted file mode 100644 index d347810..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS2H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS2H: u16 = _; // 32_861u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS3.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS3.html deleted file mode 100644 index 94c521f..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS3 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS3: u16 = 185;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS3H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS3H.html deleted file mode 100644 index c3ca7bf..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS3H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS3H: u16 = _; // 32_943u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS4.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS4.html deleted file mode 100644 index 700932c..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS4 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS4: u16 = 370;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS4H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS4H.html deleted file mode 100644 index 05c7334..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS4H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS4H: u16 = _; // 33_138u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS5.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS5.html deleted file mode 100644 index efcdbf0..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS5 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS5: u16 = 740;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS5H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS5H.html deleted file mode 100644 index dfa0de8..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS5H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS5H: u16 = _; // 33_508u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS6.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS6.html deleted file mode 100644 index b33f980..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS6 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS6: u16 = 1480;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS6H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS6H.html deleted file mode 100644 index cb24004..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS6H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS6H: u16 = _; // 34_248u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS7.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS7.html deleted file mode 100644 index 1bc4382..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS7 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS7: u16 = 2960;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS7H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS7H.html deleted file mode 100644 index 5e23093..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS7H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS7H: u16 = _; // 35_728u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS8.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS8.html deleted file mode 100644 index c5868bf..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS8 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS8: u16 = 5920;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS8H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS8H.html deleted file mode 100644 index 0ec9963..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS8H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS8H: u16 = _; // 38_688u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS9.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS9.html deleted file mode 100644 index d4baa6c..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS9 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS9: u16 = 11840;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS9H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS9H.html deleted file mode 100644 index 2c2655b..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS9H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS9H: u16 = _; // 44_608u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G0.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G0.html deleted file mode 100644 index 18723ed..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G0 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G0: u16 = 25;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G0H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G0H.html deleted file mode 100644 index 8399dce..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G0H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G0H: u16 = _; // 32_793u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G1.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G1.html deleted file mode 100644 index a7ed531..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G1 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G1: u16 = 49;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G1H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G1H.html deleted file mode 100644 index f61a20e..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G1H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G1H: u16 = _; // 32_817u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G2.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G2.html deleted file mode 100644 index 9defde6..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G2 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G2: u16 = 98;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G2H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G2H.html deleted file mode 100644 index 30a6402..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G2H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G2H: u16 = _; // 32_866u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G3.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G3.html deleted file mode 100644 index 0deda8f..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G3 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G3: u16 = 196;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G3H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G3H.html deleted file mode 100644 index 09f8fc4..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G3H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G3H: u16 = _; // 32_964u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G4.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G4.html deleted file mode 100644 index d0b2fa0..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G4 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G4: u16 = 392;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G4H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G4H.html deleted file mode 100644 index 6409f97..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G4H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G4H: u16 = _; // 33_160u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G5.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G5.html deleted file mode 100644 index 608c10d..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G5 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G5: u16 = 784;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G5H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G5H.html deleted file mode 100644 index 05f2fb5..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G5H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G5H: u16 = _; // 33_552u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G6.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G6.html deleted file mode 100644 index f2dec20..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G6 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G6: u16 = 1568;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G6H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G6H.html deleted file mode 100644 index 24de557..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G6H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G6H: u16 = _; // 34_336u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G7.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G7.html deleted file mode 100644 index 0ad392d..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G7 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G7: u16 = 3136;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G7H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G7H.html deleted file mode 100644 index d79826a..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G7H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G7H: u16 = _; // 35_904u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G8.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G8.html deleted file mode 100644 index 27a7233..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G8 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G8: u16 = 6272;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G8H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G8H.html deleted file mode 100644 index 5516797..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G8H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G8H: u16 = _; // 39_040u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G9.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G9.html deleted file mode 100644 index b799eb5..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G9 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G9: u16 = 12544;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G9H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G9H.html deleted file mode 100644 index 58f383a..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G9H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G9H: u16 = _; // 45_312u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS0.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS0.html deleted file mode 100644 index 18f0ce2..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS0 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS0: u16 = 26;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS0H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS0H.html deleted file mode 100644 index 888a759..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS0H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS0H: u16 = _; // 32_794u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS1.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS1.html deleted file mode 100644 index 675a637..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS1 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS1: u16 = 52;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS1H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS1H.html deleted file mode 100644 index 4b5e6bd..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS1H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS1H: u16 = _; // 32_820u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS2.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS2.html deleted file mode 100644 index 912a0e4..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS2 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS2: u16 = 104;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS2H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS2H.html deleted file mode 100644 index 9057c21..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS2H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS2H: u16 = _; // 32_872u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS3.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS3.html deleted file mode 100644 index 639c5c5..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS3 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS3: u16 = 208;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS3H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS3H.html deleted file mode 100644 index a6a38e8..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS3H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS3H: u16 = _; // 32_976u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS4.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS4.html deleted file mode 100644 index 2fda65e..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS4 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS4: u16 = 415;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS4H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS4H.html deleted file mode 100644 index b81ffb4..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS4H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS4H: u16 = _; // 33_183u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS5.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS5.html deleted file mode 100644 index c73f8ec..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS5 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS5: u16 = 831;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS5H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS5H.html deleted file mode 100644 index 28d0fe6..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS5H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS5H: u16 = _; // 33_599u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS6.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS6.html deleted file mode 100644 index cc88eac..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS6 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS6: u16 = 1661;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS6H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS6H.html deleted file mode 100644 index 86c71a7..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS6H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS6H: u16 = _; // 34_429u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS7.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS7.html deleted file mode 100644 index 2f96bbe..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS7 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS7: u16 = 3322;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS7H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS7H.html deleted file mode 100644 index 662a2ec..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS7H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS7H: u16 = _; // 36_090u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS8.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS8.html deleted file mode 100644 index 6361419..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS8 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS8: u16 = 6645;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS8H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS8H.html deleted file mode 100644 index 03de8fd..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS8H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS8H: u16 = _; // 39_413u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS9.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS9.html deleted file mode 100644 index e1bebef..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS9 in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS9: u16 = 13290;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS9H.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS9H.html deleted file mode 100644 index 1665fc6..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS9H in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS9H: u16 = _; // 46_058u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_REST.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_REST.html deleted file mode 100644 index 9de3751..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.NOTE_REST.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_REST in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_REST: u16 = 0;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.TONES_END.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.TONES_END.html deleted file mode 100644 index 39042fb..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.TONES_END.html +++ /dev/null @@ -1 +0,0 @@ -TONES_END in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const TONES_END: u16 = 0x8000;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.TONES_REPEAT.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.TONES_REPEAT.html deleted file mode 100644 index ea7834d..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.TONES_REPEAT.html +++ /dev/null @@ -1 +0,0 @@ -TONES_REPEAT in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const TONES_REPEAT: u16 = 0x8001;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.TONE_HIGH_VOLUME.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.TONE_HIGH_VOLUME.html deleted file mode 100644 index 3ac807c..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.TONE_HIGH_VOLUME.html +++ /dev/null @@ -1 +0,0 @@ -TONE_HIGH_VOLUME in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const TONE_HIGH_VOLUME: u16 = 0x8000;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_ALWAYS_HIGH.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_ALWAYS_HIGH.html deleted file mode 100644 index 6d73fd7..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_ALWAYS_HIGH.html +++ /dev/null @@ -1 +0,0 @@ -VOLUME_ALWAYS_HIGH in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const VOLUME_ALWAYS_HIGH: u8 = 2;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_ALWAYS_NORMAL.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_ALWAYS_NORMAL.html deleted file mode 100644 index 73a4c64..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_ALWAYS_NORMAL.html +++ /dev/null @@ -1 +0,0 @@ -VOLUME_ALWAYS_NORMAL in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const VOLUME_ALWAYS_NORMAL: u8 = 1;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_IN_TONE.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_IN_TONE.html deleted file mode 100644 index 824cdc8..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_IN_TONE.html +++ /dev/null @@ -1 +0,0 @@ -VOLUME_IN_TONE in arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
pub const VOLUME_IN_TONE: u8 = 0;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/index.html b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/index.html deleted file mode 100644 index 3dbdf0c..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/index.html +++ /dev/null @@ -1,2 +0,0 @@ -arduboy_rust::arduboy_tone::arduboy_tone_pitch - Rust
Expand description

A list of all tones available and used by the Sounds library Arduboy2Tones

-

Constants

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/sidebar-items.js b/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/sidebar-items.js deleted file mode 100644 index e507b93..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/arduboy_tone_pitch/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["NOTE_A0","NOTE_A0H","NOTE_A1","NOTE_A1H","NOTE_A2","NOTE_A2H","NOTE_A3","NOTE_A3H","NOTE_A4","NOTE_A4H","NOTE_A5","NOTE_A5H","NOTE_A6","NOTE_A6H","NOTE_A7","NOTE_A7H","NOTE_A8","NOTE_A8H","NOTE_A9","NOTE_A9H","NOTE_AS0","NOTE_AS0H","NOTE_AS1","NOTE_AS1H","NOTE_AS2","NOTE_AS2H","NOTE_AS3","NOTE_AS3H","NOTE_AS4","NOTE_AS4H","NOTE_AS5","NOTE_AS5H","NOTE_AS6","NOTE_AS6H","NOTE_AS7","NOTE_AS7H","NOTE_AS8","NOTE_AS8H","NOTE_AS9","NOTE_AS9H","NOTE_B0","NOTE_B0H","NOTE_B1","NOTE_B1H","NOTE_B2","NOTE_B2H","NOTE_B3","NOTE_B3H","NOTE_B4","NOTE_B4H","NOTE_B5","NOTE_B5H","NOTE_B6","NOTE_B6H","NOTE_B7","NOTE_B7H","NOTE_B8","NOTE_B8H","NOTE_B9","NOTE_B9H","NOTE_C0","NOTE_C0H","NOTE_C1","NOTE_C1H","NOTE_C2","NOTE_C2H","NOTE_C3","NOTE_C3H","NOTE_C4","NOTE_C4H","NOTE_C5","NOTE_C5H","NOTE_C6","NOTE_C6H","NOTE_C7","NOTE_C7H","NOTE_C8","NOTE_C8H","NOTE_C9","NOTE_C9H","NOTE_CS0","NOTE_CS0H","NOTE_CS1","NOTE_CS1H","NOTE_CS2","NOTE_CS2H","NOTE_CS3","NOTE_CS3H","NOTE_CS4","NOTE_CS4H","NOTE_CS5","NOTE_CS5H","NOTE_CS6","NOTE_CS6H","NOTE_CS7","NOTE_CS7H","NOTE_CS8","NOTE_CS8H","NOTE_CS9","NOTE_CS9H","NOTE_D0","NOTE_D0H","NOTE_D1","NOTE_D1H","NOTE_D2","NOTE_D2H","NOTE_D3","NOTE_D3H","NOTE_D4","NOTE_D4H","NOTE_D5","NOTE_D5H","NOTE_D6","NOTE_D6H","NOTE_D7","NOTE_D7H","NOTE_D8","NOTE_D8H","NOTE_D9","NOTE_D9H","NOTE_DS0","NOTE_DS0H","NOTE_DS1","NOTE_DS1H","NOTE_DS2","NOTE_DS2H","NOTE_DS3","NOTE_DS3H","NOTE_DS4","NOTE_DS4H","NOTE_DS5","NOTE_DS5H","NOTE_DS6","NOTE_DS6H","NOTE_DS7","NOTE_DS7H","NOTE_DS8","NOTE_DS8H","NOTE_DS9","NOTE_DS9H","NOTE_E0","NOTE_E0H","NOTE_E1","NOTE_E1H","NOTE_E2","NOTE_E2H","NOTE_E3","NOTE_E3H","NOTE_E4","NOTE_E4H","NOTE_E5","NOTE_E5H","NOTE_E6","NOTE_E6H","NOTE_E7","NOTE_E7H","NOTE_E8","NOTE_E8H","NOTE_E9","NOTE_E9H","NOTE_F0","NOTE_F0H","NOTE_F1","NOTE_F1H","NOTE_F2","NOTE_F2H","NOTE_F3","NOTE_F3H","NOTE_F4","NOTE_F4H","NOTE_F5","NOTE_F5H","NOTE_F6","NOTE_F6H","NOTE_F7","NOTE_F7H","NOTE_F8","NOTE_F8H","NOTE_F9","NOTE_F9H","NOTE_FS0","NOTE_FS0H","NOTE_FS1","NOTE_FS1H","NOTE_FS2","NOTE_FS2H","NOTE_FS3","NOTE_FS3H","NOTE_FS4","NOTE_FS4H","NOTE_FS5","NOTE_FS5H","NOTE_FS6","NOTE_FS6H","NOTE_FS7","NOTE_FS7H","NOTE_FS8","NOTE_FS8H","NOTE_FS9","NOTE_FS9H","NOTE_G0","NOTE_G0H","NOTE_G1","NOTE_G1H","NOTE_G2","NOTE_G2H","NOTE_G3","NOTE_G3H","NOTE_G4","NOTE_G4H","NOTE_G5","NOTE_G5H","NOTE_G6","NOTE_G6H","NOTE_G7","NOTE_G7H","NOTE_G8","NOTE_G8H","NOTE_G9","NOTE_G9H","NOTE_GS0","NOTE_GS0H","NOTE_GS1","NOTE_GS1H","NOTE_GS2","NOTE_GS2H","NOTE_GS3","NOTE_GS3H","NOTE_GS4","NOTE_GS4H","NOTE_GS5","NOTE_GS5H","NOTE_GS6","NOTE_GS6H","NOTE_GS7","NOTE_GS7H","NOTE_GS8","NOTE_GS8H","NOTE_GS9","NOTE_GS9H","NOTE_REST","TONES_END","TONES_REPEAT","TONE_HIGH_VOLUME","VOLUME_ALWAYS_HIGH","VOLUME_ALWAYS_NORMAL","VOLUME_IN_TONE"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/index.html b/docs/doc/arduboy_rust/arduboy_tone/index.html deleted file mode 100644 index 68d29f8..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/index.html +++ /dev/null @@ -1,3 +0,0 @@ -arduboy_rust::arduboy_tone - Rust
Expand description

This is the Module to interact in a save way with the ArduboyTones C++ library.

-

You will need to uncomment the ArduboyTones_Library in the import_config.h file.

-

Modules

  • A list of all tones available and used by the Sounds library Arduboy2Tones

Structs

  • This is the struct to interact in a save way with the ArduboyTones C++ library.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/sidebar-items.js b/docs/doc/arduboy_rust/arduboy_tone/sidebar-items.js deleted file mode 100644 index 883d8cc..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"mod":["arduboy_tone_pitch"],"struct":["ArduboyTones"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/struct.ArduboyTones.html b/docs/doc/arduboy_rust/arduboy_tone/struct.ArduboyTones.html deleted file mode 100644 index 2a15f81..0000000 --- a/docs/doc/arduboy_rust/arduboy_tone/struct.ArduboyTones.html +++ /dev/null @@ -1,94 +0,0 @@ -ArduboyTones in arduboy_rust::arduboy_tone - Rust
pub struct ArduboyTones {}
Expand description

This is the struct to interact in a save way with the ArduboyTones C++ library.

-

You will need to uncomment the ArduboyTones_Library in the import_config.h file.

-

Implementations§

source§

impl ArduboyTones

source

pub const fn new() -> ArduboyTones

Get a new instance of ArduboyTones

-
Example
-
const sound: ArduboyTones = ArduboyTones::new();
-
source

pub fn tone(&self, frequency: u16, duration: u32)

Play a single tone.

-
    -
  • freq The frequency of the tone, in hertz.
  • -
  • dur The duration to play the tone for, in 1024ths of a -second (very close to milliseconds). A duration of 0, or if not provided, -means play forever, or until noTone() is called or a new tone or -sequence is started.
  • -
-
source

pub fn tone2( - &self, - frequency1: u16, - duration1: u32, - frequency2: u16, - duration2: u32 -)

Play two tones in sequence.

-
    -
  • freq1,freq2 The frequency of the tone in hertz.
  • -
  • dur1,dur2 The duration to play the tone for, in 1024ths of a -second (very close to milliseconds).
  • -
-
source

pub fn tone3( - &self, - frequency1: u16, - duration1: u32, - frequency2: u16, - duration2: u32, - frequency3: u16, - duration3: u32 -)

Play three tones in sequence.

-
    -
  • freq1,freq2,freq3 The frequency of the tone, in hertz.
  • -
  • dur1,dur2,dur3 The duration to play the tone for, in 1024ths of a -second (very close to milliseconds).
  • -
-
source

pub fn tones(&self, tones: *const u16)

Play a tone sequence from frequency/duration pairs in a PROGMEM array.

-
    -
  • tones A pointer to an array of frequency/duration pairs.
  • -
-

The array must be placed in code space using PROGMEM.

-

See the tone() function for details on the frequency and duration values. -A frequency of 0 for any tone means silence (a musical rest).

-

The last element of the array must be TONES_END or TONES_REPEAT.

-

Example:

- -
progmem!(
-    static sound1:[u8;_]=[220,1000, 0,250, 440,500, 880,2000,TONES_END]
-);
-
-tones(get_tones_addr!(sound1));
-
source

pub fn no_tone(&self)

Stop playing the tone or sequence.

-

If a tone or sequence is playing, it will stop. If nothing -is playing, this function will do nothing.

-
source

pub fn playing(&self) -> bool

Check if a tone or tone sequence is playing.

-
    -
  • return boolean true if playing (even if sound is muted).
  • -
-
source

pub fn tones_in_ram(&self, tones: *mut u32)

Play a tone sequence from frequency/duration pairs in an array in RAM.

-
    -
  • tones A pointer to an array of frequency/duration pairs.
  • -
-

The array must be located in RAM.

-

See the tone() function for details on the frequency and duration values. -A frequency of 0 for any tone means silence (a musical rest).

-

The last element of the array must be TONES_END or TONES_REPEAT.

-

Example:

- -
let sound2: [u16; 9] = [220, 1000, 0, 250, 440, 500, 880, 2000, TONES_END];
-

Using tones(), with the data in PROGMEM, is normally a better -choice. The only reason to use tonesInRAM() would be if dynamically -altering the contents of the array is required.

-
source

pub fn volume_mode(&self, mode: u8)

Set the volume to always normal, always high, or tone controlled.

-

One of the following values should be used:

-
    -
  • VOLUME_IN_TONE The volume of each tone will be specified in the tone -itself.
  • -
  • VOLUME_ALWAYS_NORMAL All tones will play at the normal volume level.
  • -
  • VOLUME_ALWAYS_HIGH All tones will play at the high volume level.
  • -
-

Auto Trait Implementations§

§

impl RefUnwindSafe for ArduboyTones

§

impl Send for ArduboyTones

§

impl Sync for ArduboyTones

§

impl Unpin for ArduboyTones

§

impl UnwindSafe for ArduboyTones

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduino/fn.delay.html b/docs/doc/arduboy_rust/arduino/fn.delay.html deleted file mode 100644 index 646d38c..0000000 --- a/docs/doc/arduboy_rust/arduino/fn.delay.html +++ /dev/null @@ -1,2 +0,0 @@ -delay in arduboy_rust::arduino - Rust

Function arduboy_rust::arduino::delay

source ·
pub fn delay(ms: u32)
Expand description

A Arduino function to pause the cpu circles for a given amount of ms

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduino/fn.random_between.html b/docs/doc/arduboy_rust/arduino/fn.random_between.html deleted file mode 100644 index 04eff23..0000000 --- a/docs/doc/arduboy_rust/arduino/fn.random_between.html +++ /dev/null @@ -1,3 +0,0 @@ -random_between in arduboy_rust::arduino - Rust
pub fn random_between(min: i32, max: i32) -> i32
Expand description

A Arduino function to get a random number between 2 numbers -seed based

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduino/fn.random_less_than.html b/docs/doc/arduboy_rust/arduino/fn.random_less_than.html deleted file mode 100644 index 89bcccc..0000000 --- a/docs/doc/arduboy_rust/arduino/fn.random_less_than.html +++ /dev/null @@ -1,3 +0,0 @@ -random_less_than in arduboy_rust::arduino - Rust
pub fn random_less_than(max: i32) -> i32
Expand description

A Arduino function to get a random number smaller than the number given -seed based

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduino/index.html b/docs/doc/arduboy_rust/arduino/index.html deleted file mode 100644 index f22869e..0000000 --- a/docs/doc/arduboy_rust/arduino/index.html +++ /dev/null @@ -1,4 +0,0 @@ -arduboy_rust::arduino - Rust

Module arduboy_rust::arduino

source ·
Expand description

This is the Module to interact in a save way with the Arduino C++ library.

-

Functions

  • A Arduino function to pause the cpu circles for a given amount of ms
  • A Arduino function to get a random number between 2 numbers -seed based
  • A Arduino function to get a random number smaller than the number given -seed based
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduino/sidebar-items.js b/docs/doc/arduboy_rust/arduino/sidebar-items.js deleted file mode 100644 index 689e506..0000000 --- a/docs/doc/arduboy_rust/arduino/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["delay","random_between","random_less_than"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/ardvoice/index.html b/docs/doc/arduboy_rust/ardvoice/index.html deleted file mode 100644 index 47acfef..0000000 --- a/docs/doc/arduboy_rust/ardvoice/index.html +++ /dev/null @@ -1,3 +0,0 @@ -arduboy_rust::ardvoice - Rust

Module arduboy_rust::ardvoice

source ·
Expand description

This is the Module to interact in a save way with the ArdVoice C++ library.

-

You will need to uncomment the ArdVoice_Library in the import_config.h file.

-

Structs

  • This is the struct to interact in a save way with the ArdVoice C++ library.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/ardvoice/sidebar-items.js b/docs/doc/arduboy_rust/ardvoice/sidebar-items.js deleted file mode 100644 index 00bdff2..0000000 --- a/docs/doc/arduboy_rust/ardvoice/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"struct":["ArdVoice"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/ardvoice/struct.ArdVoice.html b/docs/doc/arduboy_rust/ardvoice/struct.ArdVoice.html deleted file mode 100644 index e44d5b3..0000000 --- a/docs/doc/arduboy_rust/ardvoice/struct.ArdVoice.html +++ /dev/null @@ -1,19 +0,0 @@ -ArdVoice in arduboy_rust::ardvoice - Rust
pub struct ArdVoice {}
Expand description

This is the struct to interact in a save way with the ArdVoice C++ library.

-

You will need to uncomment the ArdVoice_Library in the import_config.h file.

-

Implementations§

source§

impl ArdVoice

source

pub const fn new() -> Self

source

pub fn play_voice(&self, audio: *const u8)

source

pub fn play_voice_complex( - &self, - audio: *const u8, - start_time: u32, - end_time: u32, - speed: f32 -)

source

pub fn stop_voice(&self)

source

pub fn is_voice_playing(&self) -> bool

Auto Trait Implementations§

§

impl RefUnwindSafe for ArdVoice

§

impl Send for ArdVoice

§

impl Sync for ArdVoice

§

impl Unpin for ArdVoice

§

impl UnwindSafe for ArdVoice

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/c/fn.strlen.html b/docs/doc/arduboy_rust/c/fn.strlen.html deleted file mode 100644 index 527a0f1..0000000 --- a/docs/doc/arduboy_rust/c/fn.strlen.html +++ /dev/null @@ -1,2 +0,0 @@ -strlen in arduboy_rust::c - Rust

Function arduboy_rust::c::strlen

source ·
pub fn strlen(cstr: *const i8) -> usize
Expand description

A C function to get the length of a string

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/c/index.html b/docs/doc/arduboy_rust/c/index.html deleted file mode 100644 index cad3945..0000000 --- a/docs/doc/arduboy_rust/c/index.html +++ /dev/null @@ -1,2 +0,0 @@ -arduboy_rust::c - Rust

Module arduboy_rust::c

source ·
Expand description

Clib functions you can use on the Arduboy

-

Functions

  • A C function to get the length of a string
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/c/sidebar-items.js b/docs/doc/arduboy_rust/c/sidebar-items.js deleted file mode 100644 index efcc724..0000000 --- a/docs/doc/arduboy_rust/c/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["strlen"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/constant.FONT_SIZE.html b/docs/doc/arduboy_rust/constant.FONT_SIZE.html deleted file mode 100644 index ccd4c96..0000000 --- a/docs/doc/arduboy_rust/constant.FONT_SIZE.html +++ /dev/null @@ -1,3 +0,0 @@ -FONT_SIZE in arduboy_rust - Rust

Constant arduboy_rust::FONT_SIZE

source ·
pub const FONT_SIZE: u8 = 6;
Expand description

The standard font size of the arduboy

-

this is to calculate with it.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/constant.HEIGHT.html b/docs/doc/arduboy_rust/constant.HEIGHT.html deleted file mode 100644 index 86565ff..0000000 --- a/docs/doc/arduboy_rust/constant.HEIGHT.html +++ /dev/null @@ -1,3 +0,0 @@ -HEIGHT in arduboy_rust - Rust

Constant arduboy_rust::HEIGHT

source ·
pub const HEIGHT: u8 = 64;
Expand description

The standard height of the arduboy

-

this is to calculate with it.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/constant.WIDTH.html b/docs/doc/arduboy_rust/constant.WIDTH.html deleted file mode 100644 index d5cf04e..0000000 --- a/docs/doc/arduboy_rust/constant.WIDTH.html +++ /dev/null @@ -1,3 +0,0 @@ -WIDTH in arduboy_rust - Rust

Constant arduboy_rust::WIDTH

source ·
pub const WIDTH: u8 = 128;
Expand description

The standard width of the arduboy

-

this is to calculate with it.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/enum.Color.html b/docs/doc/arduboy_rust/enum.Color.html deleted file mode 100644 index 4e9d6b4..0000000 --- a/docs/doc/arduboy_rust/enum.Color.html +++ /dev/null @@ -1,26 +0,0 @@ -Color in arduboy_rust - Rust

Enum arduboy_rust::Color

source ·
#[repr(u8)]
pub enum Color { - Black, - White, -}
Expand description

This item is to chose between Black or White

-

Variants§

§

Black

Led is off

-
§

White

Led is on

-

Trait Implementations§

source§

impl Clone for Color

source§

fn clone(&self) -> Color

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Color

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for Color

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl Not for Color

§

type Output = Color

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl Ord for Color

source§

fn cmp(&self, other: &Color) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<Color> for Color

source§

fn eq(&self, other: &Color) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<Color> for Color

source§

fn partial_cmp(&self, other: &Color) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for Color

source§

impl Eq for Color

source§

impl StructuralEq for Color

source§

impl StructuralPartialEq for Color

Auto Trait Implementations§

§

impl RefUnwindSafe for Color

§

impl Send for Color

§

impl Sync for Color

§

impl Unpin for Color

§

impl UnwindSafe for Color

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/buttons/constant.A.html b/docs/doc/arduboy_rust/hardware/buttons/constant.A.html deleted file mode 100644 index f57542d..0000000 --- a/docs/doc/arduboy_rust/hardware/buttons/constant.A.html +++ /dev/null @@ -1,2 +0,0 @@ -A in arduboy_rust::hardware::buttons - Rust

Constant arduboy_rust::hardware::buttons::A

source ·
pub const A: ButtonSet;
Expand description

Just a const for the A button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/buttons/constant.A_BUTTON.html b/docs/doc/arduboy_rust/hardware/buttons/constant.A_BUTTON.html deleted file mode 100644 index fe3ab48..0000000 --- a/docs/doc/arduboy_rust/hardware/buttons/constant.A_BUTTON.html +++ /dev/null @@ -1,2 +0,0 @@ -A_BUTTON in arduboy_rust::hardware::buttons - Rust
pub const A_BUTTON: ButtonSet;
Expand description

Just a const for the A button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/buttons/constant.B.html b/docs/doc/arduboy_rust/hardware/buttons/constant.B.html deleted file mode 100644 index 6a0ada0..0000000 --- a/docs/doc/arduboy_rust/hardware/buttons/constant.B.html +++ /dev/null @@ -1,2 +0,0 @@ -B in arduboy_rust::hardware::buttons - Rust

Constant arduboy_rust::hardware::buttons::B

source ·
pub const B: ButtonSet;
Expand description

Just a const for the B button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/buttons/constant.B_BUTTON.html b/docs/doc/arduboy_rust/hardware/buttons/constant.B_BUTTON.html deleted file mode 100644 index 043a529..0000000 --- a/docs/doc/arduboy_rust/hardware/buttons/constant.B_BUTTON.html +++ /dev/null @@ -1,2 +0,0 @@ -B_BUTTON in arduboy_rust::hardware::buttons - Rust
pub const B_BUTTON: ButtonSet;
Expand description

Just a const for the B button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/buttons/constant.DOWN.html b/docs/doc/arduboy_rust/hardware/buttons/constant.DOWN.html deleted file mode 100644 index 913ee18..0000000 --- a/docs/doc/arduboy_rust/hardware/buttons/constant.DOWN.html +++ /dev/null @@ -1,2 +0,0 @@ -DOWN in arduboy_rust::hardware::buttons - Rust
pub const DOWN: ButtonSet;
Expand description

Just a const for the DOWN button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/buttons/constant.DOWN_BUTTON.html b/docs/doc/arduboy_rust/hardware/buttons/constant.DOWN_BUTTON.html deleted file mode 100644 index a65464c..0000000 --- a/docs/doc/arduboy_rust/hardware/buttons/constant.DOWN_BUTTON.html +++ /dev/null @@ -1,2 +0,0 @@ -DOWN_BUTTON in arduboy_rust::hardware::buttons - Rust
pub const DOWN_BUTTON: ButtonSet;
Expand description

Just a const for the DOWN button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/buttons/constant.LEFT.html b/docs/doc/arduboy_rust/hardware/buttons/constant.LEFT.html deleted file mode 100644 index 35321b9..0000000 --- a/docs/doc/arduboy_rust/hardware/buttons/constant.LEFT.html +++ /dev/null @@ -1,2 +0,0 @@ -LEFT in arduboy_rust::hardware::buttons - Rust
pub const LEFT: ButtonSet;
Expand description

Just a const for the LEFT button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/buttons/constant.LEFT_BUTTON.html b/docs/doc/arduboy_rust/hardware/buttons/constant.LEFT_BUTTON.html deleted file mode 100644 index 6fea326..0000000 --- a/docs/doc/arduboy_rust/hardware/buttons/constant.LEFT_BUTTON.html +++ /dev/null @@ -1,2 +0,0 @@ -LEFT_BUTTON in arduboy_rust::hardware::buttons - Rust
pub const LEFT_BUTTON: ButtonSet;
Expand description

Just a const for the LEFT button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/buttons/constant.RIGHT.html b/docs/doc/arduboy_rust/hardware/buttons/constant.RIGHT.html deleted file mode 100644 index 5ccef33..0000000 --- a/docs/doc/arduboy_rust/hardware/buttons/constant.RIGHT.html +++ /dev/null @@ -1,2 +0,0 @@ -RIGHT in arduboy_rust::hardware::buttons - Rust
pub const RIGHT: ButtonSet;
Expand description

Just a const for the RIGHT button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/buttons/constant.RIGHT_BUTTON.html b/docs/doc/arduboy_rust/hardware/buttons/constant.RIGHT_BUTTON.html deleted file mode 100644 index aa46b34..0000000 --- a/docs/doc/arduboy_rust/hardware/buttons/constant.RIGHT_BUTTON.html +++ /dev/null @@ -1,2 +0,0 @@ -RIGHT_BUTTON in arduboy_rust::hardware::buttons - Rust
pub const RIGHT_BUTTON: ButtonSet;
Expand description

Just a const for the RIGHT button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/buttons/constant.UP.html b/docs/doc/arduboy_rust/hardware/buttons/constant.UP.html deleted file mode 100644 index 9eea300..0000000 --- a/docs/doc/arduboy_rust/hardware/buttons/constant.UP.html +++ /dev/null @@ -1,2 +0,0 @@ -UP in arduboy_rust::hardware::buttons - Rust

Constant arduboy_rust::hardware::buttons::UP

source ·
pub const UP: ButtonSet;
Expand description

Just a const for the UP button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/buttons/constant.UP_BUTTON.html b/docs/doc/arduboy_rust/hardware/buttons/constant.UP_BUTTON.html deleted file mode 100644 index 121887c..0000000 --- a/docs/doc/arduboy_rust/hardware/buttons/constant.UP_BUTTON.html +++ /dev/null @@ -1,2 +0,0 @@ -UP_BUTTON in arduboy_rust::hardware::buttons - Rust
pub const UP_BUTTON: ButtonSet;
Expand description

Just a const for the UP button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/buttons/index.html b/docs/doc/arduboy_rust/hardware/buttons/index.html deleted file mode 100644 index a471d21..0000000 --- a/docs/doc/arduboy_rust/hardware/buttons/index.html +++ /dev/null @@ -1,2 +0,0 @@ -arduboy_rust::hardware::buttons - Rust
Expand description

A list of all six buttons available on the Arduboy

-

Structs

  • This struct gives the library a understanding what Buttons on the Arduboy are.

Constants

  • Just a const for the A button
  • Just a const for the A button
  • Just a const for the B button
  • Just a const for the B button
  • Just a const for the DOWN button
  • Just a const for the DOWN button
  • Just a const for the LEFT button
  • Just a const for the LEFT button
  • Just a const for the RIGHT button
  • Just a const for the RIGHT button
  • Just a const for the UP button
  • Just a const for the UP button
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/buttons/sidebar-items.js b/docs/doc/arduboy_rust/hardware/buttons/sidebar-items.js deleted file mode 100644 index 0e791b6..0000000 --- a/docs/doc/arduboy_rust/hardware/buttons/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["A","A_BUTTON","B","B_BUTTON","DOWN","DOWN_BUTTON","LEFT","LEFT_BUTTON","RIGHT","RIGHT_BUTTON","UP","UP_BUTTON"],"struct":["ButtonSet"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/buttons/struct.ButtonSet.html b/docs/doc/arduboy_rust/hardware/buttons/struct.ButtonSet.html deleted file mode 100644 index e076025..0000000 --- a/docs/doc/arduboy_rust/hardware/buttons/struct.ButtonSet.html +++ /dev/null @@ -1,23 +0,0 @@ -ButtonSet in arduboy_rust::hardware::buttons - Rust
pub struct ButtonSet {
-    pub flag_set: u8,
-}
Expand description

This struct gives the library a understanding what Buttons on the Arduboy are.

-

Fields§

§flag_set: u8

Implementations§

source§

impl ButtonSet

source

pub unsafe fn pressed(&self) -> bool

source

pub unsafe fn just_pressed(&self) -> bool

source

pub unsafe fn just_released(&self) -> bool

source

pub unsafe fn not_pressed(&self) -> bool

Trait Implementations§

source§

impl BitOr<ButtonSet> for ButtonSet

§

type Output = ButtonSet

The resulting type after applying the | operator.
source§

fn bitor(self, other: Self) -> Self

Performs the | operation. Read more
source§

impl Clone for ButtonSet

source§

fn clone(&self) -> ButtonSet

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ButtonSet

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for ButtonSet

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl Ord for ButtonSet

source§

fn cmp(&self, other: &ButtonSet) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<ButtonSet> for ButtonSet

source§

fn eq(&self, other: &ButtonSet) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<ButtonSet> for ButtonSet

source§

fn partial_cmp(&self, other: &ButtonSet) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for ButtonSet

source§

impl Eq for ButtonSet

source§

impl StructuralEq for ButtonSet

source§

impl StructuralPartialEq for ButtonSet

Auto Trait Implementations§

§

impl RefUnwindSafe for ButtonSet

§

impl Send for ButtonSet

§

impl Sync for ButtonSet

§

impl Unpin for ButtonSet

§

impl UnwindSafe for ButtonSet

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/index.html b/docs/doc/arduboy_rust/hardware/index.html deleted file mode 100644 index ed83e70..0000000 --- a/docs/doc/arduboy_rust/hardware/index.html +++ /dev/null @@ -1,2 +0,0 @@ -arduboy_rust::hardware - Rust

Module arduboy_rust::hardware

source ·
Expand description

This is the Module to interact in a save way with the Arduboy hardware.

-

Modules

  • A list of all six buttons available on the Arduboy
  • A list of all LED variables available
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/led/constant.BLUE_LED.html b/docs/doc/arduboy_rust/hardware/led/constant.BLUE_LED.html deleted file mode 100644 index 1760da4..0000000 --- a/docs/doc/arduboy_rust/hardware/led/constant.BLUE_LED.html +++ /dev/null @@ -1,2 +0,0 @@ -BLUE_LED in arduboy_rust::hardware::led - Rust
pub const BLUE_LED: u8 = 9;
Expand description

Just a const for the blue led

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/led/constant.GREEN_LED.html b/docs/doc/arduboy_rust/hardware/led/constant.GREEN_LED.html deleted file mode 100644 index bd45c1e..0000000 --- a/docs/doc/arduboy_rust/hardware/led/constant.GREEN_LED.html +++ /dev/null @@ -1,2 +0,0 @@ -GREEN_LED in arduboy_rust::hardware::led - Rust
pub const GREEN_LED: u8 = 11;
Expand description

Just a const for the green led

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/led/constant.RED_LED.html b/docs/doc/arduboy_rust/hardware/led/constant.RED_LED.html deleted file mode 100644 index d5fe6a7..0000000 --- a/docs/doc/arduboy_rust/hardware/led/constant.RED_LED.html +++ /dev/null @@ -1,2 +0,0 @@ -RED_LED in arduboy_rust::hardware::led - Rust

Constant arduboy_rust::hardware::led::RED_LED

source ·
pub const RED_LED: u8 = 10;
Expand description

Just a const for the red led

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/led/constant.RGB_OFF.html b/docs/doc/arduboy_rust/hardware/led/constant.RGB_OFF.html deleted file mode 100644 index a2876c6..0000000 --- a/docs/doc/arduboy_rust/hardware/led/constant.RGB_OFF.html +++ /dev/null @@ -1,2 +0,0 @@ -RGB_OFF in arduboy_rust::hardware::led - Rust

Constant arduboy_rust::hardware::led::RGB_OFF

source ·
pub const RGB_OFF: u8 = 0;
Expand description

Just a const for led off

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/led/constant.RGB_ON.html b/docs/doc/arduboy_rust/hardware/led/constant.RGB_ON.html deleted file mode 100644 index ca4723b..0000000 --- a/docs/doc/arduboy_rust/hardware/led/constant.RGB_ON.html +++ /dev/null @@ -1,2 +0,0 @@ -RGB_ON in arduboy_rust::hardware::led - Rust

Constant arduboy_rust::hardware::led::RGB_ON

source ·
pub const RGB_ON: u8 = 1;
Expand description

Just a const for led on

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/led/index.html b/docs/doc/arduboy_rust/hardware/led/index.html deleted file mode 100644 index 92bd57d..0000000 --- a/docs/doc/arduboy_rust/hardware/led/index.html +++ /dev/null @@ -1,2 +0,0 @@ -arduboy_rust::hardware::led - Rust

Module arduboy_rust::hardware::led

source ·
Expand description

A list of all LED variables available

-

Constants

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/led/sidebar-items.js b/docs/doc/arduboy_rust/hardware/led/sidebar-items.js deleted file mode 100644 index d30825f..0000000 --- a/docs/doc/arduboy_rust/hardware/led/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["BLUE_LED","GREEN_LED","RED_LED","RGB_OFF","RGB_ON"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/sidebar-items.js b/docs/doc/arduboy_rust/hardware/sidebar-items.js deleted file mode 100644 index 47f2139..0000000 --- a/docs/doc/arduboy_rust/hardware/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"mod":["buttons","led"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/binary_heap/enum.Max.html b/docs/doc/arduboy_rust/heapless/binary_heap/enum.Max.html deleted file mode 100644 index e1ab36c..0000000 --- a/docs/doc/arduboy_rust/heapless/binary_heap/enum.Max.html +++ /dev/null @@ -1,12 +0,0 @@ -Max in arduboy_rust::heapless::binary_heap - Rust
pub enum Max {}
Expand description

Max-heap

-

Trait Implementations§

source§

impl Kind for Max

Auto Trait Implementations§

§

impl RefUnwindSafe for Max

§

impl Send for Max

§

impl Sync for Max

§

impl Unpin for Max

§

impl UnwindSafe for Max

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/binary_heap/enum.Min.html b/docs/doc/arduboy_rust/heapless/binary_heap/enum.Min.html deleted file mode 100644 index 5a6d2ac..0000000 --- a/docs/doc/arduboy_rust/heapless/binary_heap/enum.Min.html +++ /dev/null @@ -1,12 +0,0 @@ -Min in arduboy_rust::heapless::binary_heap - Rust
pub enum Min {}
Expand description

Min-heap

-

Trait Implementations§

source§

impl Kind for Min

Auto Trait Implementations§

§

impl RefUnwindSafe for Min

§

impl Send for Min

§

impl Sync for Min

§

impl Unpin for Min

§

impl UnwindSafe for Min

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/binary_heap/index.html b/docs/doc/arduboy_rust/heapless/binary_heap/index.html deleted file mode 100644 index e96218a..0000000 --- a/docs/doc/arduboy_rust/heapless/binary_heap/index.html +++ /dev/null @@ -1,5 +0,0 @@ -arduboy_rust::heapless::binary_heap - Rust
Expand description

A priority queue implemented with a binary heap.

-

Insertion and popping the largest element have O(log n) time complexity. Checking the largest -/ smallest element is O(1).

-

Structs

  • A priority queue implemented with a binary heap.
  • Structure wrapping a mutable reference to the greatest item on a -BinaryHeap.

Enums

Traits

  • The binary heap kind: min-heap or max-heap
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/binary_heap/sidebar-items.js b/docs/doc/arduboy_rust/heapless/binary_heap/sidebar-items.js deleted file mode 100644 index 1a0b7ee..0000000 --- a/docs/doc/arduboy_rust/heapless/binary_heap/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["Max","Min"],"struct":["BinaryHeap","PeekMut"],"trait":["Kind"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/binary_heap/struct.BinaryHeap.html b/docs/doc/arduboy_rust/heapless/binary_heap/struct.BinaryHeap.html deleted file mode 100644 index ed76d09..0000000 --- a/docs/doc/arduboy_rust/heapless/binary_heap/struct.BinaryHeap.html +++ /dev/null @@ -1,197 +0,0 @@ -BinaryHeap in arduboy_rust::heapless::binary_heap - Rust
pub struct BinaryHeap<T, K, const N: usize> { /* private fields */ }
Expand description

A priority queue implemented with a binary heap.

-

This can be either a min-heap or a max-heap.

-

It is a logic error for an item to be modified in such a way that the item’s ordering relative -to any other item, as determined by the Ord trait, changes while it is in the heap. This is -normally only possible through Cell, RefCell, global state, I/O, or unsafe code.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-
-// We can use peek to look at the next item in the heap. In this case,
-// there's no items in there yet so we get None.
-assert_eq!(heap.peek(), None);
-
-// Let's add some scores...
-heap.push(1).unwrap();
-heap.push(5).unwrap();
-heap.push(2).unwrap();
-
-// Now peek shows the most important item in the heap.
-assert_eq!(heap.peek(), Some(&5));
-
-// We can check the length of a heap.
-assert_eq!(heap.len(), 3);
-
-// We can iterate over the items in the heap, although they are returned in
-// a random order.
-for x in &heap {
-    println!("{}", x);
-}
-
-// If we instead pop these scores, they should come back in order.
-assert_eq!(heap.pop(), Some(5));
-assert_eq!(heap.pop(), Some(2));
-assert_eq!(heap.pop(), Some(1));
-assert_eq!(heap.pop(), None);
-
-// We can clear the heap of any remaining items.
-heap.clear();
-
-// The heap should now be empty.
-assert!(heap.is_empty())
-

Implementations§

source§

impl<T, K, const N: usize> BinaryHeap<T, K, N>

source

pub const fn new() -> BinaryHeap<T, K, N>

Creates an empty BinaryHeap as a $K-heap.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-// allocate the binary heap on the stack
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-heap.push(4).unwrap();
-
-// allocate the binary heap in a static variable
-static mut HEAP: BinaryHeap<i32, Max, 8> = BinaryHeap::new();
-
source§

impl<T, K, const N: usize> BinaryHeap<T, K, N>where - T: Ord, - K: Kind,

source

pub fn capacity(&self) -> usize

Returns the capacity of the binary heap.

-
source

pub fn clear(&mut self)

Drops all items from the binary heap.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-heap.push(1).unwrap();
-heap.push(3).unwrap();
-
-assert!(!heap.is_empty());
-
-heap.clear();
-
-assert!(heap.is_empty());
-
source

pub fn len(&self) -> usize

Returns the length of the binary heap.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-heap.push(1).unwrap();
-heap.push(3).unwrap();
-
-assert_eq!(heap.len(), 2);
-
source

pub fn is_empty(&self) -> bool

Checks if the binary heap is empty.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-
-assert!(heap.is_empty());
-
-heap.push(3).unwrap();
-heap.push(5).unwrap();
-heap.push(1).unwrap();
-
-assert!(!heap.is_empty());
-
source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator visiting all values in the underlying vector, in arbitrary order.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-heap.push(1).unwrap();
-heap.push(2).unwrap();
-heap.push(3).unwrap();
-heap.push(4).unwrap();
-
-// Print 1, 2, 3, 4 in arbitrary order
-for x in heap.iter() {
-    println!("{}", x);
-
-}
-
source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns a mutable iterator visiting all values in the underlying vector, in arbitrary order.

-

WARNING Mutating the items in the binary heap can leave the heap in an inconsistent -state.

-
source

pub fn peek(&self) -> Option<&T>

Returns the top (greatest if max-heap, smallest if min-heap) item in the binary heap, or -None if it is empty.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-assert_eq!(heap.peek(), None);
-
-heap.push(1).unwrap();
-heap.push(5).unwrap();
-heap.push(2).unwrap();
-assert_eq!(heap.peek(), Some(&5));
-
source

pub fn peek_mut(&mut self) -> Option<PeekMut<'_, T, K, N>>

Returns a mutable reference to the greatest item in the binary heap, or -None if it is empty.

-

Note: If the PeekMut value is leaked, the heap may be in an -inconsistent state.

-
Examples
-

Basic usage:

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-assert!(heap.peek_mut().is_none());
-
-heap.push(1);
-heap.push(5);
-heap.push(2);
-{
-    let mut val = heap.peek_mut().unwrap();
-    *val = 0;
-}
-
-assert_eq!(heap.peek(), Some(&2));
-
source

pub fn pop(&mut self) -> Option<T>

Removes the top (greatest if max-heap, smallest if min-heap) item from the binary heap and -returns it, or None if it is empty.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-heap.push(1).unwrap();
-heap.push(3).unwrap();
-
-assert_eq!(heap.pop(), Some(3));
-assert_eq!(heap.pop(), Some(1));
-assert_eq!(heap.pop(), None);
-
source

pub unsafe fn pop_unchecked(&mut self) -> T

Removes the top (greatest if max-heap, smallest if min-heap) item from the binary heap and -returns it, without checking if the binary heap is empty.

-
source

pub fn push(&mut self, item: T) -> Result<(), T>

Pushes an item onto the binary heap.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-heap.push(3).unwrap();
-heap.push(5).unwrap();
-heap.push(1).unwrap();
-
-assert_eq!(heap.len(), 3);
-assert_eq!(heap.peek(), Some(&5));
-
source

pub unsafe fn push_unchecked(&mut self, item: T)

Pushes an item onto the binary heap without first checking if it’s full.

-
source

pub fn into_vec(self) -> Vec<T, N>

Returns the underlying Vec<T,N>. Order is arbitrary and time is O(1).

-

Trait Implementations§

source§

impl<T, K, const N: usize> Clone for BinaryHeap<T, K, N>where - K: Kind, - T: Ord + Clone,

source§

fn clone(&self) -> BinaryHeap<T, K, N>

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, K, const N: usize> Debug for BinaryHeap<T, K, N>where - K: Kind, - T: Ord + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<T, K, const N: usize> Default for BinaryHeap<T, K, N>where - T: Ord, - K: Kind,

source§

fn default() -> BinaryHeap<T, K, N>

Returns the “default value” for a type. Read more
source§

impl<'a, T, K, const N: usize> IntoIterator for &'a BinaryHeap<T, K, N>where - K: Kind, - T: Ord,

§

type Item = &'a T

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <&'a BinaryHeap<T, K, N> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<T, K, const N: usize> RefUnwindSafe for BinaryHeap<T, K, N>where - K: RefUnwindSafe, - T: RefUnwindSafe,

§

impl<T, K, const N: usize> Send for BinaryHeap<T, K, N>where - K: Send, - T: Send,

§

impl<T, K, const N: usize> Sync for BinaryHeap<T, K, N>where - K: Sync, - T: Sync,

§

impl<T, K, const N: usize> Unpin for BinaryHeap<T, K, N>where - K: Unpin, - T: Unpin,

§

impl<T, K, const N: usize> UnwindSafe for BinaryHeap<T, K, N>where - K: UnwindSafe, - T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/binary_heap/struct.PeekMut.html b/docs/doc/arduboy_rust/heapless/binary_heap/struct.PeekMut.html deleted file mode 100644 index 8e99a57..0000000 --- a/docs/doc/arduboy_rust/heapless/binary_heap/struct.PeekMut.html +++ /dev/null @@ -1,32 +0,0 @@ -PeekMut in arduboy_rust::heapless::binary_heap - Rust
pub struct PeekMut<'a, T, K, const N: usize>where
-    T: Ord,
-    K: Kind,{ /* private fields */ }
Expand description

Structure wrapping a mutable reference to the greatest item on a -BinaryHeap.

-

This struct is created by the peek_mut method on BinaryHeap. See -its documentation for more.

-

Implementations§

source§

impl<'a, T, K, const N: usize> PeekMut<'a, T, K, N>where - T: Ord, - K: Kind,

source

pub fn pop(this: PeekMut<'a, T, K, N>) -> T

Removes the peeked value from the heap and returns it.

-

Trait Implementations§

source§

impl<T, K, const N: usize> Deref for PeekMut<'_, T, K, N>where - T: Ord, - K: Kind,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
source§

impl<T, K, const N: usize> DerefMut for PeekMut<'_, T, K, N>where - T: Ord, - K: Kind,

source§

fn deref_mut(&mut self) -> &mut T

Mutably dereferences the value.
source§

impl<T, K, const N: usize> Drop for PeekMut<'_, T, K, N>where - T: Ord, - K: Kind,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a, T, K, const N: usize> RefUnwindSafe for PeekMut<'a, T, K, N>where - K: RefUnwindSafe, - T: RefUnwindSafe,

§

impl<'a, T, K, const N: usize> Send for PeekMut<'a, T, K, N>where - K: Send, - T: Send,

§

impl<'a, T, K, const N: usize> Sync for PeekMut<'a, T, K, N>where - K: Sync, - T: Sync,

§

impl<'a, T, K, const N: usize> Unpin for PeekMut<'a, T, K, N>

§

impl<'a, T, K, const N: usize> !UnwindSafe for PeekMut<'a, T, K, N>

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/binary_heap/trait.Kind.html b/docs/doc/arduboy_rust/heapless/binary_heap/trait.Kind.html deleted file mode 100644 index 98f4454..0000000 --- a/docs/doc/arduboy_rust/heapless/binary_heap/trait.Kind.html +++ /dev/null @@ -1,2 +0,0 @@ -Kind in arduboy_rust::heapless::binary_heap - Rust
pub trait Kind: Sealed { }
Expand description

The binary heap kind: min-heap or max-heap

-

Implementors§

source§

impl Kind for Max

source§

impl Kind for Min

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/enum.Entry.html b/docs/doc/arduboy_rust/heapless/enum.Entry.html deleted file mode 100644 index 56dc76c..0000000 --- a/docs/doc/arduboy_rust/heapless/enum.Entry.html +++ /dev/null @@ -1,24 +0,0 @@ -Entry in arduboy_rust::heapless - Rust
pub enum Entry<'a, K, V, const N: usize> {
-    Occupied(OccupiedEntry<'a, K, V, N>),
-    Vacant(VacantEntry<'a, K, V, N>),
-}
Expand description

A view into an entry in the map

-

Variants§

§

Occupied(OccupiedEntry<'a, K, V, N>)

The entry corresponding to the key K exists in the map

-
§

Vacant(VacantEntry<'a, K, V, N>)

The entry corresponding to the key K does not exist in the map

-

Auto Trait Implementations§

§

impl<'a, K, V, const N: usize> RefUnwindSafe for Entry<'a, K, V, N>where - K: RefUnwindSafe, - V: RefUnwindSafe,

§

impl<'a, K, V, const N: usize> Send for Entry<'a, K, V, N>where - K: Send, - V: Send,

§

impl<'a, K, V, const N: usize> Sync for Entry<'a, K, V, N>where - K: Sync, - V: Sync,

§

impl<'a, K, V, const N: usize> Unpin for Entry<'a, K, V, N>where - K: Unpin,

§

impl<'a, K, V, const N: usize> !UnwindSafe for Entry<'a, K, V, N>

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/index.html b/docs/doc/arduboy_rust/heapless/index.html deleted file mode 100644 index 0dc61aa..0000000 --- a/docs/doc/arduboy_rust/heapless/index.html +++ /dev/null @@ -1,64 +0,0 @@ -arduboy_rust::heapless - Rust
Expand description

static friendly data structures that don’t require dynamic memory allocation

-

The core principle behind heapless is that its data structures are backed by a static memory -allocation. For example, you can think of heapless::Vec as an alternative version of -std::Vec with fixed capacity and that can’t be re-allocated on the fly (e.g. via push).

-

All heapless data structures store their memory allocation inline and specify their capacity -via their type parameter N. This means that you can instantiate a heapless data structure on -the stack, in a static variable, or even in the heap.

- -
use heapless::Vec; // fixed capacity `std::Vec`
-
-// on the stack
-let mut xs: Vec<u8, 8> = Vec::new(); // can hold up to 8 elements
-xs.push(42).unwrap();
-assert_eq!(xs.pop(), Some(42));
-
-// in a `static` variable
-static mut XS: Vec<u8, 8> = Vec::new();
-
-let xs = unsafe { &mut XS };
-
-xs.push(42);
-assert_eq!(xs.pop(), Some(42));
-
-// in the heap (though kind of pointless because no reallocation)
-let mut ys: Box<Vec<u8, 8>> = Box::new(Vec::new());
-ys.push(42).unwrap();
-assert_eq!(ys.pop(), Some(42));
-

Because they have fixed capacity heapless data structures don’t implicitly reallocate. This -means that operations like heapless::Vec.push are truly constant time rather than amortized -constant time with potentially unbounded (depends on the allocator) worst case execution time -(which is bad / unacceptable for hard real time applications).

-

heapless data structures don’t use a memory allocator which means no risk of an uncatchable -Out Of Memory (OOM) condition while performing operations on them. It’s certainly possible to -run out of capacity while growing heapless data structures, but the API lets you handle this -possibility by returning a Result on operations that may exhaust the capacity of the data -structure.

-

List of currently implemented data structures:

- -

Optional Features

-

The heapless crate provides the following optional Cargo features:

- -

Minimum Supported Rust Version (MSRV)

-

This crate is guaranteed to compile on stable Rust 1.51 and up with its default set of features. -It might compile on older versions but that may change in any new patch release.

-

Modules

  • A priority queue implemented with a binary heap.
  • A fixed sorted priority linked list, similar to BinaryHeap but with different properties -on push, pop, etc. -For example, the sorting of the list will never memcpy the underlying value, so having large -objects in the list will not cause a performance hit.

Structs

Enums

  • A view into an entry in the map

Type Aliases

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/sidebar-items.js b/docs/doc/arduboy_rust/heapless/sidebar-items.js deleted file mode 100644 index 47fb163..0000000 --- a/docs/doc/arduboy_rust/heapless/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["Entry"],"mod":["binary_heap","sorted_linked_list"],"struct":["BinaryHeap","Deque","HistoryBuffer","IndexMap","IndexSet","LinearMap","OccupiedEntry","OldestOrdered","String","VacantEntry","Vec"],"type":["FnvIndexMap","FnvIndexSet"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/sorted_linked_list/index.html b/docs/doc/arduboy_rust/heapless/sorted_linked_list/index.html deleted file mode 100644 index d0fc77b..0000000 --- a/docs/doc/arduboy_rust/heapless/sorted_linked_list/index.html +++ /dev/null @@ -1,21 +0,0 @@ -arduboy_rust::heapless::sorted_linked_list - Rust
Expand description

A fixed sorted priority linked list, similar to BinaryHeap but with different properties -on push, pop, etc. -For example, the sorting of the list will never memcpy the underlying value, so having large -objects in the list will not cause a performance hit.

-

Examples

-
use heapless::sorted_linked_list::{SortedLinkedList, Max};
-let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-// The largest value will always be first
-ll.push(1).unwrap();
-assert_eq!(ll.peek(), Some(&1));
-
-ll.push(2).unwrap();
-assert_eq!(ll.peek(), Some(&2));
-
-ll.push(3).unwrap();
-assert_eq!(ll.peek(), Some(&3));
-
-// This will not fit in the queue.
-assert_eq!(ll.push(4), Err(4));
-

Structs

Traits

  • The linked list kind: min-list or max-list
  • Trait for defining an index for the linked list, never implemented by users.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/sorted_linked_list/sidebar-items.js b/docs/doc/arduboy_rust/heapless/sorted_linked_list/sidebar-items.js deleted file mode 100644 index ae6b39f..0000000 --- a/docs/doc/arduboy_rust/heapless/sorted_linked_list/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"struct":["FindMut","Iter","LinkedIndexU16","LinkedIndexU8","LinkedIndexUsize","Max","Min","Node","SortedLinkedList"],"trait":["Kind","SortedLinkedListIndex"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.FindMut.html b/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.FindMut.html deleted file mode 100644 index c081c20..0000000 --- a/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.FindMut.html +++ /dev/null @@ -1,77 +0,0 @@ -FindMut in arduboy_rust::heapless::sorted_linked_list - Rust
pub struct FindMut<'a, T, Idx, K, const N: usize>where
-    T: Ord,
-    Idx: SortedLinkedListIndex,
-    K: Kind,{ /* private fields */ }
Expand description

Implementations§

source§

impl<'a, T, Idx, K, const N: usize> FindMut<'a, T, Idx, K, N>where - T: Ord, - Idx: SortedLinkedListIndex, - K: Kind,

source

pub fn pop(self) -> T

This will pop the element from the list.

-

Complexity is worst-case O(1).

-
Example
-
use heapless::sorted_linked_list::{SortedLinkedList, Max};
-let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-ll.push(1).unwrap();
-ll.push(2).unwrap();
-ll.push(3).unwrap();
-
-// Find a value and update it
-let mut find = ll.find_mut(|v| *v == 2).unwrap();
-find.pop();
-
-assert_eq!(ll.pop(), Ok(3));
-assert_eq!(ll.pop(), Ok(1));
-assert_eq!(ll.pop(), Err(()));
-
source

pub fn finish(self)

This will resort the element into the correct position in the list if needed. The resorting -will only happen if the element has been accessed mutably.

-

Same as calling drop.

-

Complexity is worst-case O(N).

-
Example
-
use heapless::sorted_linked_list::{SortedLinkedList, Max};
-let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-ll.push(1).unwrap();
-ll.push(2).unwrap();
-ll.push(3).unwrap();
-
-let mut find = ll.find_mut(|v| *v == 2).unwrap();
-find.finish(); // No resort, we did not access the value.
-
-let mut find = ll.find_mut(|v| *v == 2).unwrap();
-*find += 1000;
-find.finish(); // Will resort, we accessed (and updated) the value.
-
-assert_eq!(ll.pop(), Ok(1002));
-assert_eq!(ll.pop(), Ok(3));
-assert_eq!(ll.pop(), Ok(1));
-assert_eq!(ll.pop(), Err(()));
-

Trait Implementations§

source§

impl<T, Idx, K, const N: usize> Deref for FindMut<'_, T, Idx, K, N>where - T: Ord, - Idx: SortedLinkedListIndex, - K: Kind,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &<FindMut<'_, T, Idx, K, N> as Deref>::Target

Dereferences the value.
source§

impl<T, Idx, K, const N: usize> DerefMut for FindMut<'_, T, Idx, K, N>where - T: Ord, - Idx: SortedLinkedListIndex, - K: Kind,

source§

fn deref_mut(&mut self) -> &mut <FindMut<'_, T, Idx, K, N> as Deref>::Target

Mutably dereferences the value.
source§

impl<T, Idx, K, const N: usize> Drop for FindMut<'_, T, Idx, K, N>where - T: Ord, - Idx: SortedLinkedListIndex, - K: Kind,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a, T, Idx, K, const N: usize> RefUnwindSafe for FindMut<'a, T, Idx, K, N>where - Idx: RefUnwindSafe, - K: RefUnwindSafe, - T: RefUnwindSafe,

§

impl<'a, T, Idx, K, const N: usize> Send for FindMut<'a, T, Idx, K, N>where - Idx: Send, - K: Send, - T: Send,

§

impl<'a, T, Idx, K, const N: usize> Sync for FindMut<'a, T, Idx, K, N>where - Idx: Sync, - K: Sync, - T: Sync,

§

impl<'a, T, Idx, K, const N: usize> Unpin for FindMut<'a, T, Idx, K, N>where - Idx: Unpin,

§

impl<'a, T, Idx, K, const N: usize> !UnwindSafe for FindMut<'a, T, Idx, K, N>

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.Iter.html b/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.Iter.html deleted file mode 100644 index ef1081d..0000000 --- a/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.Iter.html +++ /dev/null @@ -1,209 +0,0 @@ -Iter in arduboy_rust::heapless::sorted_linked_list - Rust
pub struct Iter<'a, T, Idx, K, const N: usize>where
-    T: Ord,
-    Idx: SortedLinkedListIndex,
-    K: Kind,{ /* private fields */ }
Expand description

Iterator for the linked list.

-

Trait Implementations§

source§

impl<'a, T, Idx, K, const N: usize> Iterator for Iter<'a, T, Idx, K, N>where - T: Ord, - Idx: SortedLinkedListIndex, - K: Kind,

§

type Item = &'a T

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<<Iter<'a, T, Idx, K, N> as Iterator>::Item>

Advances the iterator and returns the next value. Read more
§

fn next_chunk<const N: usize>( - &mut self -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where - Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
1.0.0§

fn count(self) -> usizewhere - Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0§

fn last(self) -> Option<Self::Item>where - Self: Sized,

Consumes the iterator, returning the last element. Read more
§

fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0§

fn step_by(self, step: usize) -> StepBy<Self>where - Self: Sized,

Creates an iterator starting at the same point, but stepping by -the given amount at each iteration. Read more
1.0.0§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where - Self: Sized, - U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where - Self: Sized, - U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>where - Self: Sized, - G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator -between adjacent items of the original iterator. Read more
1.0.0§

fn map<B, F>(self, f: F) -> Map<Self, F>where - Self: Sized, - F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each -element. Read more
1.21.0§

fn for_each<F>(self, f: F)where - Self: Sized, - F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0§

fn filter<P>(self, predicate: P) -> Filter<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element -should be yielded. Read more
1.0.0§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>where - Self: Sized, - F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0§

fn enumerate(self) -> Enumerate<Self>where - Self: Sized,

Creates an iterator which gives the current iteration count as well as -the next value. Read more
1.0.0§

fn peekable(self) -> Peekable<Self>where - Self: Sized,

Creates an iterator which can use the peek and peek_mut methods -to look at the next element of the iterator without consuming it. See -their documentation for more information. Read more
1.0.0§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where - Self: Sized, - P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0§

fn skip(self, n: usize) -> Skip<Self>where - Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0§

fn take(self, n: usize) -> Take<Self>where - Self: Sized,

Creates an iterator that yields the first n elements, or fewer -if the underlying iterator ends sooner. Read more
1.0.0§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>where - Self: Sized, - F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but -unlike fold, produces a new iterator. Read more
1.0.0§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where - Self: Sized, - U: IntoIterator, - F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
§

fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>where - Self: Sized, - F: FnMut(&[Self::Item; N]) -> R,

🔬This is a nightly-only experimental API. (iter_map_windows)
Calls the given function f for each contiguous window of size N over -self and returns an iterator over the outputs of f. Like slice::windows(), -the windows during mapping overlap as well. Read more
1.0.0§

fn fuse(self) -> Fuse<Self>where - Self: Sized,

Creates an iterator which ends after the first [None]. Read more
1.0.0§

fn inspect<F>(self, f: F) -> Inspect<Self, F>where - Self: Sized, - F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0§

fn by_ref(&mut self) -> &mut Selfwhere - Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0§

fn collect<B>(self) -> Bwhere - B: FromIterator<Self::Item>, - Self: Sized,

Transforms an iterator into a collection. Read more
§

fn collect_into<E>(self, collection: &mut E) -> &mut Ewhere - E: Extend<Self::Item>, - Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0§

fn partition<B, F>(self, f: F) -> (B, B)where - Self: Sized, - B: Default + Extend<Self::Item>, - F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
§

fn is_partitioned<P>(self, predicate: P) -> boolwhere - Self: Sized, - P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate, -such that all those that return true precede all those that return false. Read more
1.27.0§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere - Self: Sized, - F: FnMut(B, Self::Item) -> R, - R: Try<Output = B>,

An iterator method that applies a function as long as it returns -successfully, producing a single, final value. Read more
1.27.0§

fn try_for_each<F, R>(&mut self, f: F) -> Rwhere - Self: Sized, - F: FnMut(Self::Item) -> R, - R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the -iterator, stopping at the first error and returning that error. Read more
1.0.0§

fn fold<B, F>(self, init: B, f: F) -> Bwhere - Self: Sized, - F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation, -returning the final result. Read more
1.51.0§

fn reduce<F>(self, f: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing -operation. Read more
§

fn try_reduce<F, R>( - &mut self, - f: F -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> R, - R: Try<Output = Self::Item>, - <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the -closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0§

fn all<F>(&mut self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0§

fn any<F>(&mut self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0§

fn find_map<B, F>(&mut self, f: F) -> Option<B>where - Self: Sized, - F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns -the first non-none result. Read more
§

fn try_find<F, R>( - &mut self, - f: F -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere - Self: Sized, - F: FnMut(&Self::Item) -> R, - R: Try<Output = bool>, - <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns -the first true result or the first error. Read more
1.0.0§

fn position<P>(&mut self, predicate: P) -> Option<usize>where - Self: Sized, - P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.6.0§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>where - B: Ord, - Self: Sized, - F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the -specified function. Read more
1.15.0§

fn max_by<F>(self, compare: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the -specified comparison function. Read more
1.6.0§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>where - B: Ord, - Self: Sized, - F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the -specified function. Read more
1.15.0§

fn min_by<F>(self, compare: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the -specified comparison function. Read more
1.0.0§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where - FromA: Default + Extend<A>, - FromB: Default + Extend<B>, - Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0§

fn copied<'a, T>(self) -> Copied<Self>where - T: 'a + Copy, - Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0§

fn cloned<'a, T>(self) -> Cloned<Self>where - T: 'a + Clone, - Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where - Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0§

fn sum<S>(self) -> Swhere - Self: Sized, - S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0§

fn product<P>(self) -> Pwhere - Self: Sized, - P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this [Iterator] with those -of another with respect to the specified comparison function. Read more
1.5.0§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>where - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Lexicographically compares the [PartialOrd] elements of -this [Iterator] with those of another. The comparison works like short-circuit -evaluation, returning a result without comparing the remaining elements. -As soon as an order can be determined, the evaluation stops and a result is returned. Read more
§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this [Iterator] with those -of another with respect to the specified comparison function. Read more
1.5.0§

fn eq<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialEq<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are equal to those of -another. Read more
§

fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this [Iterator] are equal to those of -another with respect to the specified equality function. Read more
1.5.0§

fn ne<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialEq<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are not equal to those of -another. Read more
1.5.0§

fn lt<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are lexicographically -less than those of another. Read more
1.5.0§

fn le<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are lexicographically -less or equal to those of another. Read more
1.5.0§

fn gt<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are lexicographically -greater than those of another. Read more
1.5.0§

fn ge<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are lexicographically -greater than or equal to those of another. Read more
§

fn is_sorted_by<F>(self, compare: F) -> boolwhere - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
§

fn is_sorted_by_key<F, K>(self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> K, - K: PartialOrd<K>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction -function. Read more

Auto Trait Implementations§

§

impl<'a, T, Idx, K, const N: usize> RefUnwindSafe for Iter<'a, T, Idx, K, N>where - Idx: RefUnwindSafe, - K: RefUnwindSafe, - T: RefUnwindSafe,

§

impl<'a, T, Idx, K, const N: usize> Send for Iter<'a, T, Idx, K, N>where - Idx: Send + Sync, - K: Sync, - T: Sync,

§

impl<'a, T, Idx, K, const N: usize> Sync for Iter<'a, T, Idx, K, N>where - Idx: Sync, - K: Sync, - T: Sync,

§

impl<'a, T, Idx, K, const N: usize> Unpin for Iter<'a, T, Idx, K, N>where - Idx: Unpin,

§

impl<'a, T, Idx, K, const N: usize> UnwindSafe for Iter<'a, T, Idx, K, N>where - Idx: UnwindSafe + RefUnwindSafe, - K: RefUnwindSafe, - T: RefUnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<I> IntoIterator for Iwhere - I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.LinkedIndexU16.html b/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.LinkedIndexU16.html deleted file mode 100644 index f54e985..0000000 --- a/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.LinkedIndexU16.html +++ /dev/null @@ -1,19 +0,0 @@ -LinkedIndexU16 in arduboy_rust::heapless::sorted_linked_list - Rust
pub struct LinkedIndexU16(/* private fields */);
Expand description

Index for the SortedLinkedList with specific backing storage.

-

Trait Implementations§

source§

impl Clone for LinkedIndexU16

source§

fn clone(&self) -> LinkedIndexU16

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LinkedIndexU16

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Ord for LinkedIndexU16

source§

fn cmp(&self, other: &LinkedIndexU16) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<LinkedIndexU16> for LinkedIndexU16

source§

fn eq(&self, other: &LinkedIndexU16) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<LinkedIndexU16> for LinkedIndexU16

source§

fn partial_cmp(&self, other: &LinkedIndexU16) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for LinkedIndexU16

source§

impl Eq for LinkedIndexU16

source§

impl SortedLinkedListIndex for LinkedIndexU16

source§

impl StructuralEq for LinkedIndexU16

source§

impl StructuralPartialEq for LinkedIndexU16

Auto Trait Implementations§

§

impl RefUnwindSafe for LinkedIndexU16

§

impl Send for LinkedIndexU16

§

impl Sync for LinkedIndexU16

§

impl Unpin for LinkedIndexU16

§

impl UnwindSafe for LinkedIndexU16

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.LinkedIndexU8.html b/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.LinkedIndexU8.html deleted file mode 100644 index b5b60ad..0000000 --- a/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.LinkedIndexU8.html +++ /dev/null @@ -1,19 +0,0 @@ -LinkedIndexU8 in arduboy_rust::heapless::sorted_linked_list - Rust
pub struct LinkedIndexU8(/* private fields */);
Expand description

Index for the SortedLinkedList with specific backing storage.

-

Trait Implementations§

source§

impl Clone for LinkedIndexU8

source§

fn clone(&self) -> LinkedIndexU8

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LinkedIndexU8

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Ord for LinkedIndexU8

source§

fn cmp(&self, other: &LinkedIndexU8) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<LinkedIndexU8> for LinkedIndexU8

source§

fn eq(&self, other: &LinkedIndexU8) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<LinkedIndexU8> for LinkedIndexU8

source§

fn partial_cmp(&self, other: &LinkedIndexU8) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for LinkedIndexU8

source§

impl Eq for LinkedIndexU8

source§

impl SortedLinkedListIndex for LinkedIndexU8

source§

impl StructuralEq for LinkedIndexU8

source§

impl StructuralPartialEq for LinkedIndexU8

Auto Trait Implementations§

§

impl RefUnwindSafe for LinkedIndexU8

§

impl Send for LinkedIndexU8

§

impl Sync for LinkedIndexU8

§

impl Unpin for LinkedIndexU8

§

impl UnwindSafe for LinkedIndexU8

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.LinkedIndexUsize.html b/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.LinkedIndexUsize.html deleted file mode 100644 index f1a6db9..0000000 --- a/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.LinkedIndexUsize.html +++ /dev/null @@ -1,19 +0,0 @@ -LinkedIndexUsize in arduboy_rust::heapless::sorted_linked_list - Rust
pub struct LinkedIndexUsize(/* private fields */);
Expand description

Index for the SortedLinkedList with specific backing storage.

-

Trait Implementations§

source§

impl Clone for LinkedIndexUsize

source§

fn clone(&self) -> LinkedIndexUsize

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LinkedIndexUsize

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Ord for LinkedIndexUsize

source§

fn cmp(&self, other: &LinkedIndexUsize) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<LinkedIndexUsize> for LinkedIndexUsize

source§

fn eq(&self, other: &LinkedIndexUsize) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<LinkedIndexUsize> for LinkedIndexUsize

source§

fn partial_cmp(&self, other: &LinkedIndexUsize) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for LinkedIndexUsize

source§

impl Eq for LinkedIndexUsize

source§

impl SortedLinkedListIndex for LinkedIndexUsize

source§

impl StructuralEq for LinkedIndexUsize

source§

impl StructuralPartialEq for LinkedIndexUsize

Auto Trait Implementations§

§

impl RefUnwindSafe for LinkedIndexUsize

§

impl Send for LinkedIndexUsize

§

impl Sync for LinkedIndexUsize

§

impl Unpin for LinkedIndexUsize

§

impl UnwindSafe for LinkedIndexUsize

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.Max.html b/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.Max.html deleted file mode 100644 index 2eb2dab..0000000 --- a/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.Max.html +++ /dev/null @@ -1,12 +0,0 @@ -Max in arduboy_rust::heapless::sorted_linked_list - Rust
pub struct Max;
Expand description

Marker for Max sorted SortedLinkedList.

-

Trait Implementations§

source§

impl Kind for Max

Auto Trait Implementations§

§

impl RefUnwindSafe for Max

§

impl Send for Max

§

impl Sync for Max

§

impl Unpin for Max

§

impl UnwindSafe for Max

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.Min.html b/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.Min.html deleted file mode 100644 index 9786691..0000000 --- a/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.Min.html +++ /dev/null @@ -1,12 +0,0 @@ -Min in arduboy_rust::heapless::sorted_linked_list - Rust
pub struct Min;
Expand description

Marker for Min sorted SortedLinkedList.

-

Trait Implementations§

source§

impl Kind for Min

Auto Trait Implementations§

§

impl RefUnwindSafe for Min

§

impl Send for Min

§

impl Sync for Min

§

impl Unpin for Min

§

impl UnwindSafe for Min

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.Node.html b/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.Node.html deleted file mode 100644 index 89f5ec4..0000000 --- a/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.Node.html +++ /dev/null @@ -1,22 +0,0 @@ -Node in arduboy_rust::heapless::sorted_linked_list - Rust
pub struct Node<T, Idx> { /* private fields */ }
Expand description

A node in the SortedLinkedList.

-

Auto Trait Implementations§

§

impl<T, Idx> RefUnwindSafe for Node<T, Idx>where - Idx: RefUnwindSafe, - T: RefUnwindSafe,

§

impl<T, Idx> Send for Node<T, Idx>where - Idx: Send, - T: Send,

§

impl<T, Idx> Sync for Node<T, Idx>where - Idx: Sync, - T: Sync,

§

impl<T, Idx> Unpin for Node<T, Idx>where - Idx: Unpin, - T: Unpin,

§

impl<T, Idx> UnwindSafe for Node<T, Idx>where - Idx: UnwindSafe, - T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.SortedLinkedList.html b/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.SortedLinkedList.html deleted file mode 100644 index 315e977..0000000 --- a/docs/doc/arduboy_rust/heapless/sorted_linked_list/struct.SortedLinkedList.html +++ /dev/null @@ -1,151 +0,0 @@ -SortedLinkedList in arduboy_rust::heapless::sorted_linked_list - Rust
pub struct SortedLinkedList<T, Idx, K, const N: usize>where
-    Idx: SortedLinkedListIndex,{ /* private fields */ }
Expand description

The linked list.

-

Implementations§

source§

impl<T, K, const N: usize> SortedLinkedList<T, LinkedIndexU8, K, N>

source

pub const fn new_u8() -> SortedLinkedList<T, LinkedIndexU8, K, N>

Create a new linked list.

-
source§

impl<T, K, const N: usize> SortedLinkedList<T, LinkedIndexU16, K, N>

source

pub const fn new_u16() -> SortedLinkedList<T, LinkedIndexU16, K, N>

Create a new linked list.

-
source§

impl<T, K, const N: usize> SortedLinkedList<T, LinkedIndexUsize, K, N>

source

pub const fn new_usize() -> SortedLinkedList<T, LinkedIndexUsize, K, N>

Create a new linked list.

-
source§

impl<T, Idx, K, const N: usize> SortedLinkedList<T, Idx, K, N>where - T: Ord, - Idx: SortedLinkedListIndex, - K: Kind,

source

pub unsafe fn push_unchecked(&mut self, value: T)

Pushes a value onto the list without checking if the list is full.

-

Complexity is worst-case O(N).

-
Safety
-

Assumes that the list is not full.

-
source

pub fn push(&mut self, value: T) -> Result<(), T>

Pushes an element to the linked list and sorts it into place.

-

Complexity is worst-case O(N).

-
Example
-
use heapless::sorted_linked_list::{SortedLinkedList, Max};
-let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-// The largest value will always be first
-ll.push(1).unwrap();
-assert_eq!(ll.peek(), Some(&1));
-
-ll.push(2).unwrap();
-assert_eq!(ll.peek(), Some(&2));
-
-ll.push(3).unwrap();
-assert_eq!(ll.peek(), Some(&3));
-
-// This will not fit in the queue.
-assert_eq!(ll.push(4), Err(4));
-
source

pub fn iter(&self) -> Iter<'_, T, Idx, K, N>

Get an iterator over the sorted list.

-
Example
-
use heapless::sorted_linked_list::{SortedLinkedList, Max};
-let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-ll.push(1).unwrap();
-ll.push(2).unwrap();
-
-let mut iter = ll.iter();
-
-assert_eq!(iter.next(), Some(&2));
-assert_eq!(iter.next(), Some(&1));
-assert_eq!(iter.next(), None);
-
source

pub fn find_mut<F>(&mut self, f: F) -> Option<FindMut<'_, T, Idx, K, N>>where - F: FnMut(&T) -> bool,

Find an element in the list that can be changed and resorted.

-
Example
-
use heapless::sorted_linked_list::{SortedLinkedList, Max};
-let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-ll.push(1).unwrap();
-ll.push(2).unwrap();
-ll.push(3).unwrap();
-
-// Find a value and update it
-let mut find = ll.find_mut(|v| *v == 2).unwrap();
-*find += 1000;
-find.finish();
-
-assert_eq!(ll.pop(), Ok(1002));
-assert_eq!(ll.pop(), Ok(3));
-assert_eq!(ll.pop(), Ok(1));
-assert_eq!(ll.pop(), Err(()));
-
source

pub fn peek(&self) -> Option<&T>

Peek at the first element.

-
Example
-
use heapless::sorted_linked_list::{SortedLinkedList, Max, Min};
-let mut ll_max: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-// The largest value will always be first
-ll_max.push(1).unwrap();
-assert_eq!(ll_max.peek(), Some(&1));
-ll_max.push(2).unwrap();
-assert_eq!(ll_max.peek(), Some(&2));
-ll_max.push(3).unwrap();
-assert_eq!(ll_max.peek(), Some(&3));
-
-let mut ll_min: SortedLinkedList<_, _, Min, 3> = SortedLinkedList::new_usize();
-
-// The Smallest value will always be first
-ll_min.push(3).unwrap();
-assert_eq!(ll_min.peek(), Some(&3));
-ll_min.push(2).unwrap();
-assert_eq!(ll_min.peek(), Some(&2));
-ll_min.push(1).unwrap();
-assert_eq!(ll_min.peek(), Some(&1));
-
source

pub unsafe fn pop_unchecked(&mut self) -> T

Pop an element from the list without checking so the list is not empty.

-
Safety
-

Assumes that the list is not empty.

-
source

pub fn pop(&mut self) -> Result<T, ()>

Pops the first element in the list.

-

Complexity is worst-case O(1).

-
Example
-
use heapless::sorted_linked_list::{SortedLinkedList, Max};
-let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-ll.push(1).unwrap();
-ll.push(2).unwrap();
-
-assert_eq!(ll.pop(), Ok(2));
-assert_eq!(ll.pop(), Ok(1));
-assert_eq!(ll.pop(), Err(()));
-
source

pub fn is_full(&self) -> bool

Checks if the linked list is full.

-
Example
-
use heapless::sorted_linked_list::{SortedLinkedList, Max};
-let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-assert_eq!(ll.is_full(), false);
-
-ll.push(1).unwrap();
-assert_eq!(ll.is_full(), false);
-ll.push(2).unwrap();
-assert_eq!(ll.is_full(), false);
-ll.push(3).unwrap();
-assert_eq!(ll.is_full(), true);
-
source

pub fn is_empty(&self) -> bool

Checks if the linked list is empty.

-
Example
-
use heapless::sorted_linked_list::{SortedLinkedList, Max};
-let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-assert_eq!(ll.is_empty(), true);
-
-ll.push(1).unwrap();
-assert_eq!(ll.is_empty(), false);
-

Trait Implementations§

source§

impl<T, Idx, K, const N: usize> Debug for SortedLinkedList<T, Idx, K, N>where - T: Ord + Debug, - Idx: SortedLinkedListIndex, - K: Kind,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<T, Idx, K, const N: usize> Drop for SortedLinkedList<T, Idx, K, N>where - Idx: SortedLinkedListIndex,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<T, Idx, K, const N: usize> RefUnwindSafe for SortedLinkedList<T, Idx, K, N>where - Idx: RefUnwindSafe, - K: RefUnwindSafe, - T: RefUnwindSafe,

§

impl<T, Idx, K, const N: usize> Send for SortedLinkedList<T, Idx, K, N>where - Idx: Send, - K: Send, - T: Send,

§

impl<T, Idx, K, const N: usize> Sync for SortedLinkedList<T, Idx, K, N>where - Idx: Sync, - K: Sync, - T: Sync,

§

impl<T, Idx, K, const N: usize> Unpin for SortedLinkedList<T, Idx, K, N>where - Idx: Unpin, - K: Unpin, - T: Unpin,

§

impl<T, Idx, K, const N: usize> UnwindSafe for SortedLinkedList<T, Idx, K, N>where - Idx: UnwindSafe, - K: UnwindSafe, - T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/sorted_linked_list/trait.Kind.html b/docs/doc/arduboy_rust/heapless/sorted_linked_list/trait.Kind.html deleted file mode 100644 index 39117d6..0000000 --- a/docs/doc/arduboy_rust/heapless/sorted_linked_list/trait.Kind.html +++ /dev/null @@ -1,2 +0,0 @@ -Kind in arduboy_rust::heapless::sorted_linked_list - Rust
pub trait Kind: Sealed { }
Expand description

The linked list kind: min-list or max-list

-

Implementors§

source§

impl Kind for Max

source§

impl Kind for Min

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/sorted_linked_list/trait.SortedLinkedListIndex.html b/docs/doc/arduboy_rust/heapless/sorted_linked_list/trait.SortedLinkedListIndex.html deleted file mode 100644 index 687ac06..0000000 --- a/docs/doc/arduboy_rust/heapless/sorted_linked_list/trait.SortedLinkedListIndex.html +++ /dev/null @@ -1,2 +0,0 @@ -SortedLinkedListIndex in arduboy_rust::heapless::sorted_linked_list - Rust
pub trait SortedLinkedListIndex: Copy { }
Expand description

Trait for defining an index for the linked list, never implemented by users.

-

Implementors§

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/struct.BinaryHeap.html b/docs/doc/arduboy_rust/heapless/struct.BinaryHeap.html deleted file mode 100644 index c3cb969..0000000 --- a/docs/doc/arduboy_rust/heapless/struct.BinaryHeap.html +++ /dev/null @@ -1,197 +0,0 @@ -BinaryHeap in arduboy_rust::heapless - Rust
pub struct BinaryHeap<T, K, const N: usize> { /* private fields */ }
Expand description

A priority queue implemented with a binary heap.

-

This can be either a min-heap or a max-heap.

-

It is a logic error for an item to be modified in such a way that the item’s ordering relative -to any other item, as determined by the Ord trait, changes while it is in the heap. This is -normally only possible through Cell, RefCell, global state, I/O, or unsafe code.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-
-// We can use peek to look at the next item in the heap. In this case,
-// there's no items in there yet so we get None.
-assert_eq!(heap.peek(), None);
-
-// Let's add some scores...
-heap.push(1).unwrap();
-heap.push(5).unwrap();
-heap.push(2).unwrap();
-
-// Now peek shows the most important item in the heap.
-assert_eq!(heap.peek(), Some(&5));
-
-// We can check the length of a heap.
-assert_eq!(heap.len(), 3);
-
-// We can iterate over the items in the heap, although they are returned in
-// a random order.
-for x in &heap {
-    println!("{}", x);
-}
-
-// If we instead pop these scores, they should come back in order.
-assert_eq!(heap.pop(), Some(5));
-assert_eq!(heap.pop(), Some(2));
-assert_eq!(heap.pop(), Some(1));
-assert_eq!(heap.pop(), None);
-
-// We can clear the heap of any remaining items.
-heap.clear();
-
-// The heap should now be empty.
-assert!(heap.is_empty())
-

Implementations§

source§

impl<T, K, const N: usize> BinaryHeap<T, K, N>

source

pub const fn new() -> BinaryHeap<T, K, N>

Creates an empty BinaryHeap as a $K-heap.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-// allocate the binary heap on the stack
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-heap.push(4).unwrap();
-
-// allocate the binary heap in a static variable
-static mut HEAP: BinaryHeap<i32, Max, 8> = BinaryHeap::new();
-
source§

impl<T, K, const N: usize> BinaryHeap<T, K, N>where - T: Ord, - K: Kind,

source

pub fn capacity(&self) -> usize

Returns the capacity of the binary heap.

-
source

pub fn clear(&mut self)

Drops all items from the binary heap.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-heap.push(1).unwrap();
-heap.push(3).unwrap();
-
-assert!(!heap.is_empty());
-
-heap.clear();
-
-assert!(heap.is_empty());
-
source

pub fn len(&self) -> usize

Returns the length of the binary heap.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-heap.push(1).unwrap();
-heap.push(3).unwrap();
-
-assert_eq!(heap.len(), 2);
-
source

pub fn is_empty(&self) -> bool

Checks if the binary heap is empty.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-
-assert!(heap.is_empty());
-
-heap.push(3).unwrap();
-heap.push(5).unwrap();
-heap.push(1).unwrap();
-
-assert!(!heap.is_empty());
-
source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator visiting all values in the underlying vector, in arbitrary order.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-heap.push(1).unwrap();
-heap.push(2).unwrap();
-heap.push(3).unwrap();
-heap.push(4).unwrap();
-
-// Print 1, 2, 3, 4 in arbitrary order
-for x in heap.iter() {
-    println!("{}", x);
-
-}
-
source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns a mutable iterator visiting all values in the underlying vector, in arbitrary order.

-

WARNING Mutating the items in the binary heap can leave the heap in an inconsistent -state.

-
source

pub fn peek(&self) -> Option<&T>

Returns the top (greatest if max-heap, smallest if min-heap) item in the binary heap, or -None if it is empty.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-assert_eq!(heap.peek(), None);
-
-heap.push(1).unwrap();
-heap.push(5).unwrap();
-heap.push(2).unwrap();
-assert_eq!(heap.peek(), Some(&5));
-
source

pub fn peek_mut(&mut self) -> Option<PeekMut<'_, T, K, N>>

Returns a mutable reference to the greatest item in the binary heap, or -None if it is empty.

-

Note: If the PeekMut value is leaked, the heap may be in an -inconsistent state.

-
Examples
-

Basic usage:

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-assert!(heap.peek_mut().is_none());
-
-heap.push(1);
-heap.push(5);
-heap.push(2);
-{
-    let mut val = heap.peek_mut().unwrap();
-    *val = 0;
-}
-
-assert_eq!(heap.peek(), Some(&2));
-
source

pub fn pop(&mut self) -> Option<T>

Removes the top (greatest if max-heap, smallest if min-heap) item from the binary heap and -returns it, or None if it is empty.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-heap.push(1).unwrap();
-heap.push(3).unwrap();
-
-assert_eq!(heap.pop(), Some(3));
-assert_eq!(heap.pop(), Some(1));
-assert_eq!(heap.pop(), None);
-
source

pub unsafe fn pop_unchecked(&mut self) -> T

Removes the top (greatest if max-heap, smallest if min-heap) item from the binary heap and -returns it, without checking if the binary heap is empty.

-
source

pub fn push(&mut self, item: T) -> Result<(), T>

Pushes an item onto the binary heap.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-heap.push(3).unwrap();
-heap.push(5).unwrap();
-heap.push(1).unwrap();
-
-assert_eq!(heap.len(), 3);
-assert_eq!(heap.peek(), Some(&5));
-
source

pub unsafe fn push_unchecked(&mut self, item: T)

Pushes an item onto the binary heap without first checking if it’s full.

-
source

pub fn into_vec(self) -> Vec<T, N>

Returns the underlying Vec<T,N>. Order is arbitrary and time is O(1).

-

Trait Implementations§

source§

impl<T, K, const N: usize> Clone for BinaryHeap<T, K, N>where - K: Kind, - T: Ord + Clone,

source§

fn clone(&self) -> BinaryHeap<T, K, N>

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, K, const N: usize> Debug for BinaryHeap<T, K, N>where - K: Kind, - T: Ord + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<T, K, const N: usize> Default for BinaryHeap<T, K, N>where - T: Ord, - K: Kind,

source§

fn default() -> BinaryHeap<T, K, N>

Returns the “default value” for a type. Read more
source§

impl<'a, T, K, const N: usize> IntoIterator for &'a BinaryHeap<T, K, N>where - K: Kind, - T: Ord,

§

type Item = &'a T

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <&'a BinaryHeap<T, K, N> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<T, K, const N: usize> RefUnwindSafe for BinaryHeap<T, K, N>where - K: RefUnwindSafe, - T: RefUnwindSafe,

§

impl<T, K, const N: usize> Send for BinaryHeap<T, K, N>where - K: Send, - T: Send,

§

impl<T, K, const N: usize> Sync for BinaryHeap<T, K, N>where - K: Sync, - T: Sync,

§

impl<T, K, const N: usize> Unpin for BinaryHeap<T, K, N>where - K: Unpin, - T: Unpin,

§

impl<T, K, const N: usize> UnwindSafe for BinaryHeap<T, K, N>where - K: UnwindSafe, - T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/struct.Deque.html b/docs/doc/arduboy_rust/heapless/struct.Deque.html deleted file mode 100644 index 7734d8a..0000000 --- a/docs/doc/arduboy_rust/heapless/struct.Deque.html +++ /dev/null @@ -1,90 +0,0 @@ -Deque in arduboy_rust::heapless - Rust
pub struct Deque<T, const N: usize> { /* private fields */ }
Expand description

A fixed capacity double-ended queue.

-

Examples

-
use heapless::Deque;
-
-// A deque with a fixed capacity of 8 elements allocated on the stack
-let mut deque = Deque::<_, 8>::new();
-
-// You can use it as a good old FIFO queue.
-deque.push_back(1);
-deque.push_back(2);
-assert_eq!(deque.len(), 2);
-
-assert_eq!(deque.pop_front(), Some(1));
-assert_eq!(deque.pop_front(), Some(2));
-assert_eq!(deque.len(), 0);
-
-// Deque is double-ended, you can push and pop from the front and back.
-deque.push_back(1);
-deque.push_front(2);
-deque.push_back(3);
-deque.push_front(4);
-assert_eq!(deque.pop_front(), Some(4));
-assert_eq!(deque.pop_front(), Some(2));
-assert_eq!(deque.pop_front(), Some(1));
-assert_eq!(deque.pop_front(), Some(3));
-
-// You can iterate it, yielding all the elements front-to-back.
-for x in &deque {
-    println!("{}", x);
-}
-

Implementations§

source§

impl<T, const N: usize> Deque<T, N>

source

pub const fn new() -> Deque<T, N>

Constructs a new, empty deque with a fixed capacity of N

-
Examples
-
use heapless::Deque;
-
-// allocate the deque on the stack
-let mut x: Deque<u8, 16> = Deque::new();
-
-// allocate the deque in a static variable
-static mut X: Deque<u8, 16> = Deque::new();
-
source

pub const fn capacity(&self) -> usize

Returns the maximum number of elements the deque can hold.

-
source

pub const fn len(&self) -> usize

Returns the number of elements currently in the deque.

-
source

pub fn clear(&mut self)

Clears the deque, removing all values.

-
source

pub fn is_empty(&self) -> bool

Returns whether the deque is empty.

-
source

pub fn is_full(&self) -> bool

Returns whether the deque is full (i.e. if len() == capacity().

-
source

pub fn as_slices(&self) -> (&[T], &[T])

Returns a pair of slices which contain, in order, the contents of the Deque.

-
source

pub fn as_mut_slices(&mut self) -> (&mut [T], &mut [T])

Returns a pair of mutable slices which contain, in order, the contents of the Deque.

-
source

pub fn front(&self) -> Option<&T>

Provides a reference to the front element, or None if the Deque is empty.

-
source

pub fn front_mut(&mut self) -> Option<&mut T>

Provides a mutable reference to the front element, or None if the Deque is empty.

-
source

pub fn back(&self) -> Option<&T>

Provides a reference to the back element, or None if the Deque is empty.

-
source

pub fn back_mut(&mut self) -> Option<&mut T>

Provides a mutable reference to the back element, or None if the Deque is empty.

-
source

pub fn pop_front(&mut self) -> Option<T>

Removes the item from the front of the deque and returns it, or None if it’s empty

-
source

pub fn pop_back(&mut self) -> Option<T>

Removes the item from the back of the deque and returns it, or None if it’s empty

-
source

pub fn push_front(&mut self, item: T) -> Result<(), T>

Appends an item to the front of the deque

-

Returns back the item if the deque is full

-
source

pub fn push_back(&mut self, item: T) -> Result<(), T>

Appends an item to the back of the deque

-

Returns back the item if the deque is full

-
source

pub unsafe fn pop_front_unchecked(&mut self) -> T

Removes an item from the front of the deque and returns it, without checking that the deque -is not empty

-
Safety
-

It’s undefined behavior to call this on an empty deque

-
source

pub unsafe fn pop_back_unchecked(&mut self) -> T

Removes an item from the back of the deque and returns it, without checking that the deque -is not empty

-
Safety
-

It’s undefined behavior to call this on an empty deque

-
source

pub unsafe fn push_front_unchecked(&mut self, item: T)

Appends an item to the front of the deque

-
Safety
-

This assumes the deque is not full.

-
source

pub unsafe fn push_back_unchecked(&mut self, item: T)

Appends an item to the back of the deque

-
Safety
-

This assumes the deque is not full.

-
source

pub fn iter(&self) -> Iter<'_, T, N>

Returns an iterator over the deque.

-
source

pub fn iter_mut(&mut self) -> IterMut<'_, T, N>

Returns an iterator that allows modifying each value.

-

Trait Implementations§

source§

impl<T, const N: usize> Clone for Deque<T, N>where - T: Clone,

source§

fn clone(&self) -> Deque<T, N>

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, const N: usize> Debug for Deque<T, N>where - T: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<T, const N: usize> Default for Deque<T, N>

source§

fn default() -> Deque<T, N>

Returns the “default value” for a type. Read more
source§

impl<T, const N: usize> Drop for Deque<T, N>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'a, T, const N: usize> IntoIterator for &'a Deque<T, N>

§

type Item = &'a T

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, T, N>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <&'a Deque<T, N> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, T, const N: usize> IntoIterator for &'a mut Deque<T, N>

§

type Item = &'a mut T

The type of the elements being iterated over.
§

type IntoIter = IterMut<'a, T, N>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <&'a mut Deque<T, N> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, const N: usize> IntoIterator for Deque<T, N>

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T, N>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <Deque<T, N> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<T, const N: usize> RefUnwindSafe for Deque<T, N>where - T: RefUnwindSafe,

§

impl<T, const N: usize> Send for Deque<T, N>where - T: Send,

§

impl<T, const N: usize> Sync for Deque<T, N>where - T: Sync,

§

impl<T, const N: usize> Unpin for Deque<T, N>where - T: Unpin,

§

impl<T, const N: usize> UnwindSafe for Deque<T, N>where - T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/struct.HistoryBuffer.html b/docs/doc/arduboy_rust/heapless/struct.HistoryBuffer.html deleted file mode 100644 index 7b97bc8..0000000 --- a/docs/doc/arduboy_rust/heapless/struct.HistoryBuffer.html +++ /dev/null @@ -1,1089 +0,0 @@ -HistoryBuffer in arduboy_rust::heapless - Rust
pub struct HistoryBuffer<T, const N: usize> { /* private fields */ }
Expand description

A “history buffer”, similar to a write-only ring buffer of fixed length.

-

This buffer keeps a fixed number of elements. On write, the oldest element -is overwritten. Thus, the buffer is useful to keep a history of values with -some desired depth, and for example calculate a rolling average.

-

Examples

-
use heapless::HistoryBuffer;
-
-// Initialize a new buffer with 8 elements.
-let mut buf = HistoryBuffer::<_, 8>::new();
-
-// Starts with no data
-assert_eq!(buf.recent(), None);
-
-buf.write(3);
-buf.write(5);
-buf.extend(&[4, 4]);
-
-// The most recent written element is a four.
-assert_eq!(buf.recent(), Some(&4));
-
-// To access all elements in an unspecified order, use `as_slice()`.
-for el in buf.as_slice() { println!("{:?}", el); }
-
-// Now we can prepare an average of all values, which comes out to 4.
-let avg = buf.as_slice().iter().sum::<usize>() / buf.len();
-assert_eq!(avg, 4);
-

Implementations§

source§

impl<T, const N: usize> HistoryBuffer<T, N>

source

pub const fn new() -> HistoryBuffer<T, N>

Constructs a new history buffer.

-

The construction of a HistoryBuffer works in const contexts.

-
Examples
-
use heapless::HistoryBuffer;
-
-// Allocate a 16-element buffer on the stack
-let x: HistoryBuffer<u8, 16> = HistoryBuffer::new();
-assert_eq!(x.len(), 0);
-
source

pub fn clear(&mut self)

Clears the buffer, replacing every element with the default value of -type T.

-
source§

impl<T, const N: usize> HistoryBuffer<T, N>where - T: Copy + Clone,

source

pub fn new_with(t: T) -> HistoryBuffer<T, N>

Constructs a new history buffer, where every element is the given value.

-
Examples
-
use heapless::HistoryBuffer;
-
-// Allocate a 16-element buffer on the stack
-let mut x: HistoryBuffer<u8, 16> = HistoryBuffer::new_with(4);
-// All elements are four
-assert_eq!(x.as_slice(), [4; 16]);
-
source

pub fn clear_with(&mut self, t: T)

Clears the buffer, replacing every element with the given value.

-
source§

impl<T, const N: usize> HistoryBuffer<T, N>

source

pub fn len(&self) -> usize

Returns the current fill level of the buffer.

-
source

pub fn capacity(&self) -> usize

Returns the capacity of the buffer, which is the length of the -underlying backing array.

-
source

pub fn write(&mut self, t: T)

Writes an element to the buffer, overwriting the oldest value.

-
source

pub fn extend_from_slice(&mut self, other: &[T])where - T: Clone,

Clones and writes all elements in a slice to the buffer.

-

If the slice is longer than the buffer, only the last self.len() -elements will actually be stored.

-
source

pub fn recent(&self) -> Option<&T>

Returns a reference to the most recently written value.

-
Examples
-
use heapless::HistoryBuffer;
-
-let mut x: HistoryBuffer<u8, 16> = HistoryBuffer::new();
-x.write(4);
-x.write(10);
-assert_eq!(x.recent(), Some(&10));
-
source

pub fn as_slice(&self) -> &[T]

Returns the array slice backing the buffer, without keeping track -of the write position. Therefore, the element order is unspecified.

-
source

pub fn oldest_ordered<'a>(&'a self) -> OldestOrdered<'a, T, N>

Returns an iterator for iterating over the buffer from oldest to newest.

-
Examples
-
use heapless::HistoryBuffer;
-
-let mut buffer: HistoryBuffer<u8, 6> = HistoryBuffer::new();
-buffer.extend([0, 0, 0, 1, 2, 3, 4, 5, 6]);
-let expected = [1, 2, 3, 4, 5, 6];
-for (x, y) in buffer.oldest_ordered().zip(expected.iter()) {
-    assert_eq!(x, y)
-}
-
-

Methods from Deref<Target = [T]>§

pub fn flatten(&self) -> &[T]

🔬This is a nightly-only experimental API. (slice_flatten)

Takes a &[[T; N]], and flattens it to a &[T].

-
Panics
-

This panics if the length of the resulting slice would overflow a usize.

-

This is only possible when flattening a slice of arrays of zero-sized -types, and thus tends to be irrelevant in practice. If -size_of::<T>() > 0, this will never panic.

-
Examples
-
#![feature(slice_flatten)]
-
-assert_eq!([[1, 2, 3], [4, 5, 6]].flatten(), &[1, 2, 3, 4, 5, 6]);
-
-assert_eq!(
-    [[1, 2, 3], [4, 5, 6]].flatten(),
-    [[1, 2], [3, 4], [5, 6]].flatten(),
-);
-
-let slice_of_empty_arrays: &[[i32; 0]] = &[[], [], [], [], []];
-assert!(slice_of_empty_arrays.flatten().is_empty());
-
-let empty_slice_of_arrays: &[[u32; 10]] = &[];
-assert!(empty_slice_of_arrays.flatten().is_empty());
-
1.23.0

pub fn is_ascii(&self) -> bool

Checks if all bytes in this slice are within the ASCII range.

-

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this slice is_ascii, returns it as a slice of -ASCII characters, otherwise returns None.

-

pub unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar]

🔬This is a nightly-only experimental API. (ascii_char)

Converts this slice of bytes into a slice of ASCII characters, -without checking whether they’re valid.

-
Safety
-

Every byte in the slice must be in 0..=127, or else this is UB.

-
1.23.0

pub fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool

Checks that two slices are an ASCII case-insensitive match.

-

Same as to_ascii_lowercase(a) == to_ascii_lowercase(b), -but without allocating and copying temporaries.

-
1.60.0

pub fn escape_ascii(&self) -> EscapeAscii<'_>

Returns an iterator that produces an escaped version of this slice, -treating it as an ASCII string.

-
Examples
-

-let s = b"0\t\r\n'\"\\\x9d";
-let escaped = s.escape_ascii().to_string();
-assert_eq!(escaped, "0\\t\\r\\n\\'\\\"\\\\\\x9d");
-

pub fn trim_ascii_start(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with leading ASCII whitespace bytes removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b" \t hello world\n".trim_ascii_start(), b"hello world\n");
-assert_eq!(b"  ".trim_ascii_start(), b"");
-assert_eq!(b"".trim_ascii_start(), b"");
-

pub fn trim_ascii_end(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with trailing ASCII whitespace bytes removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b"\r hello world\n ".trim_ascii_end(), b"\r hello world");
-assert_eq!(b"  ".trim_ascii_end(), b"");
-assert_eq!(b"".trim_ascii_end(), b"");
-

pub fn trim_ascii(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with leading and trailing ASCII whitespace bytes -removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b"\r hello world\n ".trim_ascii(), b"hello world");
-assert_eq!(b"  ".trim_ascii(), b"");
-assert_eq!(b"".trim_ascii(), b"");
-

pub fn as_str(&self) -> &str

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a UTF-8 str.

-

pub fn as_bytes(&self) -> &[u8]

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a slice of u8 bytes.

-
1.0.0

pub fn len(&self) -> usize

Returns the number of elements in the slice.

-
Examples
-
let a = [1, 2, 3];
-assert_eq!(a.len(), 3);
-
1.0.0

pub fn is_empty(&self) -> bool

Returns true if the slice has a length of 0.

-
Examples
-
let a = [1, 2, 3];
-assert!(!a.is_empty());
-
1.0.0

pub fn first(&self) -> Option<&T>

Returns the first element of the slice, or None if it is empty.

-
Examples
-
let v = [10, 40, 30];
-assert_eq!(Some(&10), v.first());
-
-let w: &[i32] = &[];
-assert_eq!(None, w.first());
-
1.5.0

pub fn split_first(&self) -> Option<(&T, &[T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
let x = &[0, 1, 2];
-
-if let Some((first, elements)) = x.split_first() {
-    assert_eq!(first, &0);
-    assert_eq!(elements, &[1, 2]);
-}
-
1.5.0

pub fn split_last(&self) -> Option<(&T, &[T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
let x = &[0, 1, 2];
-
-if let Some((last, elements)) = x.split_last() {
-    assert_eq!(last, &2);
-    assert_eq!(elements, &[0, 1]);
-}
-
1.0.0

pub fn last(&self) -> Option<&T>

Returns the last element of the slice, or None if it is empty.

-
Examples
-
let v = [10, 40, 30];
-assert_eq!(Some(&30), v.last());
-
-let w: &[i32] = &[];
-assert_eq!(None, w.last());
-

pub fn first_chunk<const N: usize>(&self) -> Option<&[T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the first N elements of the slice, or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let u = [10, 40, 30];
-assert_eq!(Some(&[10, 40]), u.first_chunk::<2>());
-
-let v: &[i32] = &[10];
-assert_eq!(None, v.first_chunk::<2>());
-
-let w: &[i32] = &[];
-assert_eq!(Some(&[]), w.first_chunk::<0>());
-

pub fn split_first_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the first N elements of the slice and the remainder, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &[0, 1, 2];
-
-if let Some((first, elements)) = x.split_first_chunk::<2>() {
-    assert_eq!(first, &[0, 1]);
-    assert_eq!(elements, &[2]);
-}
-

pub fn split_last_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the last N elements of the slice and the remainder, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &[0, 1, 2];
-
-if let Some((last, elements)) = x.split_last_chunk::<2>() {
-    assert_eq!(last, &[1, 2]);
-    assert_eq!(elements, &[0]);
-}
-

pub fn last_chunk<const N: usize>(&self) -> Option<&[T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the last element of the slice, or None if it is empty.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let u = [10, 40, 30];
-assert_eq!(Some(&[40, 30]), u.last_chunk::<2>());
-
-let v: &[i32] = &[10];
-assert_eq!(None, v.last_chunk::<2>());
-
-let w: &[i32] = &[];
-assert_eq!(Some(&[]), w.last_chunk::<0>());
-
1.0.0

pub fn get<I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output>where - I: SliceIndex<[T]>,

Returns a reference to an element or subslice depending on the type of -index.

-
    -
  • If given a position, returns a reference to the element at that -position or None if out of bounds.
  • -
  • If given a range, returns the subslice corresponding to that range, -or None if out of bounds.
  • -
-
Examples
-
let v = [10, 40, 30];
-assert_eq!(Some(&40), v.get(1));
-assert_eq!(Some(&[10, 40][..]), v.get(0..2));
-assert_eq!(None, v.get(3));
-assert_eq!(None, v.get(0..4));
-
1.0.0

pub unsafe fn get_unchecked<I>( - &self, - index: I -) -> &<I as SliceIndex<[T]>>::Outputwhere - I: SliceIndex<[T]>,

Returns a reference to an element or subslice, without doing bounds -checking.

-

For a safe alternative see get.

-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior -even if the resulting reference is not used.

-
Examples
-
let x = &[1, 2, 4];
-
-unsafe {
-    assert_eq!(x.get_unchecked(1), &2);
-}
-
1.0.0

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the slice’s buffer.

-

The caller must ensure that the slice outlives the pointer this -function returns, or else it will end up pointing to garbage.

-

The caller must also ensure that the memory the pointer (non-transitively) points to -is never written to (except inside an UnsafeCell) using this pointer or any pointer -derived from it. If you need to mutate the contents of the slice, use as_mut_ptr.

-

Modifying the container referenced by this slice may cause its buffer -to be reallocated, which would also make any pointers to it invalid.

-
Examples
-
let x = &[1, 2, 4];
-let x_ptr = x.as_ptr();
-
-unsafe {
-    for i in 0..x.len() {
-        assert_eq!(x.get_unchecked(i), &*x_ptr.add(i));
-    }
-}
-
1.48.0

pub fn as_ptr_range(&self) -> Range<*const T>

Returns the two raw pointers spanning the slice.

-

The returned range is half-open, which means that the end pointer -points one past the last element of the slice. This way, an empty -slice is represented by two equal pointers, and the difference between -the two pointers represents the size of the slice.

-

See as_ptr for warnings on using these pointers. The end pointer -requires extra caution, as it does not point to a valid element in the -slice.

-

This function is useful for interacting with foreign interfaces which -use two pointers to refer to a range of elements in memory, as is -common in C++.

-

It can also be useful to check if a pointer to an element refers to an -element of this slice:

- -
let a = [1, 2, 3];
-let x = &a[1] as *const _;
-let y = &5 as *const _;
-
-assert!(a.as_ptr_range().contains(&x));
-assert!(!a.as_ptr_range().contains(&y));
-
1.0.0

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the slice.

-

The iterator yields all items from start to end.

-
Examples
-
let x = &[1, 2, 4];
-let mut iterator = x.iter();
-
-assert_eq!(iterator.next(), Some(&1));
-assert_eq!(iterator.next(), Some(&2));
-assert_eq!(iterator.next(), Some(&4));
-assert_eq!(iterator.next(), None);
-
1.0.0

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length -size. The windows overlap. If the slice is shorter than -size, the iterator returns no values.

-
Panics
-

Panics if size is 0.

-
Examples
-
let slice = ['r', 'u', 's', 't'];
-let mut iter = slice.windows(2);
-assert_eq!(iter.next().unwrap(), &['r', 'u']);
-assert_eq!(iter.next().unwrap(), &['u', 's']);
-assert_eq!(iter.next().unwrap(), &['s', 't']);
-assert!(iter.next().is_none());
-

If the slice is shorter than size:

- -
let slice = ['f', 'o', 'o'];
-let mut iter = slice.windows(4);
-assert!(iter.next().is_none());
-

There’s no windows_mut, as that existing would let safe code violate the -“only one &mut at a time to the same thing” rule. However, you can sometimes -use Cell::as_slice_of_cells in -conjunction with windows to accomplish something similar:

- -
use std::cell::Cell;
-
-let mut array = ['R', 'u', 's', 't', ' ', '2', '0', '1', '5'];
-let slice = &mut array[..];
-let slice_of_cells: &[Cell<char>] = Cell::from_mut(slice).as_slice_of_cells();
-for w in slice_of_cells.windows(3) {
-    Cell::swap(&w[0], &w[2]);
-}
-assert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
-
1.0.0

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last chunk will not have length chunk_size.

-

See chunks_exact for a variant of this iterator that returns chunks of always exactly -chunk_size elements, and rchunks for the same iterator but starting at the end of the -slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.chunks(2);
-assert_eq!(iter.next().unwrap(), &['l', 'o']);
-assert_eq!(iter.next().unwrap(), &['r', 'e']);
-assert_eq!(iter.next().unwrap(), &['m']);
-assert!(iter.next().is_none());
-
1.31.0

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved -from the remainder function of the iterator.

-

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the -resulting code better than in the case of chunks.

-

See chunks for a variant of this iterator that also returns the remainder as a smaller -chunk, and rchunks_exact for the same iterator but starting at the end of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.chunks_exact(2);
-assert_eq!(iter.next().unwrap(), &['l', 'o']);
-assert_eq!(iter.next().unwrap(), &['r', 'e']);
-assert!(iter.next().is_none());
-assert_eq!(iter.remainder(), &['m']);
-

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -assuming that there’s no remainder.

-
Safety
-

This may only be called when

-
    -
  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • -
  • N != 0.
  • -
-
Examples
-
#![feature(slice_as_chunks)]
-let slice: &[char] = &['l', 'o', 'r', 'e', 'm', '!'];
-let chunks: &[[char; 1]] =
-    // SAFETY: 1-element chunks never have remainder
-    unsafe { slice.as_chunks_unchecked() };
-assert_eq!(chunks, &[['l'], ['o'], ['r'], ['e'], ['m'], ['!']]);
-let chunks: &[[char; 3]] =
-    // SAFETY: The slice length (6) is a multiple of 3
-    unsafe { slice.as_chunks_unchecked() };
-assert_eq!(chunks, &[['l', 'o', 'r'], ['e', 'm', '!']]);
-
-// These would be unsound:
-// let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5
-// let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed
-

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -starting at the beginning of the slice, -and a remainder slice with length strictly less than N.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(slice_as_chunks)]
-let slice = ['l', 'o', 'r', 'e', 'm'];
-let (chunks, remainder) = slice.as_chunks();
-assert_eq!(chunks, &[['l', 'o'], ['r', 'e']]);
-assert_eq!(remainder, &['m']);
-

If you expect the slice to be an exact multiple, you can combine -let-else with an empty slice pattern:

- -
#![feature(slice_as_chunks)]
-let slice = ['R', 'u', 's', 't'];
-let (chunks, []) = slice.as_chunks::<2>() else {
-    panic!("slice didn't have even length")
-};
-assert_eq!(chunks, &[['R', 'u'], ['s', 't']]);
-

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -starting at the end of the slice, -and a remainder slice with length strictly less than N.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(slice_as_chunks)]
-let slice = ['l', 'o', 'r', 'e', 'm'];
-let (remainder, chunks) = slice.as_rchunks();
-assert_eq!(remainder, &['l']);
-assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]);
-

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are array references and do not overlap. If N does not divide the -length of the slice, then the last up to N-1 elements will be omitted and can be -retrieved from the remainder function of the iterator.

-

This method is the const generic equivalent of chunks_exact.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(array_chunks)]
-let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.array_chunks();
-assert_eq!(iter.next().unwrap(), &['l', 'o']);
-assert_eq!(iter.next().unwrap(), &['r', 'e']);
-assert!(iter.next().is_none());
-assert_eq!(iter.remainder(), &['m']);
-

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, -starting at the beginning of the slice.

-

This is the const generic equivalent of windows.

-

If N is greater than the size of the slice, it will return no windows.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(array_windows)]
-let slice = [0, 1, 2, 3];
-let mut iter = slice.array_windows();
-assert_eq!(iter.next().unwrap(), &[0, 1]);
-assert_eq!(iter.next().unwrap(), &[1, 2]);
-assert_eq!(iter.next().unwrap(), &[2, 3]);
-assert!(iter.next().is_none());
-
1.31.0

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end -of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last chunk will not have length chunk_size.

-

See rchunks_exact for a variant of this iterator that returns chunks of always exactly -chunk_size elements, and chunks for the same iterator but starting at the beginning -of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.rchunks(2);
-assert_eq!(iter.next().unwrap(), &['e', 'm']);
-assert_eq!(iter.next().unwrap(), &['o', 'r']);
-assert_eq!(iter.next().unwrap(), &['l']);
-assert!(iter.next().is_none());
-
1.31.0

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -end of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved -from the remainder function of the iterator.

-

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the -resulting code better than in the case of rchunks.

-

See rchunks for a variant of this iterator that also returns the remainder as a smaller -chunk, and chunks_exact for the same iterator but starting at the beginning of the -slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.rchunks_exact(2);
-assert_eq!(iter.next().unwrap(), &['e', 'm']);
-assert_eq!(iter.next().unwrap(), &['o', 'r']);
-assert!(iter.next().is_none());
-assert_eq!(iter.remainder(), &['l']);
-

pub fn group_by<F>(&self, pred: F) -> GroupBy<'_, T, F>where - F: FnMut(&T, &T) -> bool,

🔬This is a nightly-only experimental API. (slice_group_by)

Returns an iterator over the slice producing non-overlapping runs -of elements using the predicate to separate them.

-

The predicate is called on two elements following themselves, -it means the predicate is called on slice[0] and slice[1] -then on slice[1] and slice[2] and so on.

-
Examples
-
#![feature(slice_group_by)]
-
-let slice = &[1, 1, 1, 3, 3, 2, 2, 2];
-
-let mut iter = slice.group_by(|a, b| a == b);
-
-assert_eq!(iter.next(), Some(&[1, 1, 1][..]));
-assert_eq!(iter.next(), Some(&[3, 3][..]));
-assert_eq!(iter.next(), Some(&[2, 2, 2][..]));
-assert_eq!(iter.next(), None);
-

This method can be used to extract the sorted subslices:

- -
#![feature(slice_group_by)]
-
-let slice = &[1, 1, 2, 3, 2, 3, 2, 3, 4];
-
-let mut iter = slice.group_by(|a, b| a <= b);
-
-assert_eq!(iter.next(), Some(&[1, 1, 2, 3][..]));
-assert_eq!(iter.next(), Some(&[2, 3][..]));
-assert_eq!(iter.next(), Some(&[2, 3, 4][..]));
-assert_eq!(iter.next(), None);
-
1.0.0

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

-

The first will contain all indices from [0, mid) (excluding -the index mid itself) and the second will contain all -indices from [mid, len) (excluding the index len itself).

-
Panics
-

Panics if mid > len.

-
Examples
-
let v = [1, 2, 3, 4, 5, 6];
-
-{
-   let (left, right) = v.split_at(0);
-   assert_eq!(left, []);
-   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_at(2);
-    assert_eq!(left, [1, 2]);
-    assert_eq!(right, [3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_at(6);
-    assert_eq!(left, [1, 2, 3, 4, 5, 6]);
-    assert_eq!(right, []);
-}
-

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

🔬This is a nightly-only experimental API. (slice_split_at_unchecked)

Divides one slice into two at an index, without doing bounds checking.

-

The first will contain all indices from [0, mid) (excluding -the index mid itself) and the second will contain all -indices from [mid, len) (excluding the index len itself).

-

For a safe alternative see split_at.

-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior -even if the resulting reference is not used. The caller has to ensure that -0 <= mid <= self.len().

-
Examples
-
#![feature(slice_split_at_unchecked)]
-
-let v = [1, 2, 3, 4, 5, 6];
-
-unsafe {
-   let (left, right) = v.split_at_unchecked(0);
-   assert_eq!(left, []);
-   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
-}
-
-unsafe {
-    let (left, right) = v.split_at_unchecked(2);
-    assert_eq!(left, [1, 2]);
-    assert_eq!(right, [3, 4, 5, 6]);
-}
-
-unsafe {
-    let (left, right) = v.split_at_unchecked(6);
-    assert_eq!(left, [1, 2, 3, 4, 5, 6]);
-    assert_eq!(right, []);
-}
-

pub fn split_array_ref<const N: usize>(&self) -> (&[T; N], &[T])

🔬This is a nightly-only experimental API. (split_array)

Divides one slice into an array and a remainder slice at an index.

-

The array will contain all indices from [0, N) (excluding -the index N itself) and the slice will contain all -indices from [N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let v = &[1, 2, 3, 4, 5, 6][..];
-
-{
-   let (left, right) = v.split_array_ref::<0>();
-   assert_eq!(left, &[]);
-   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_array_ref::<2>();
-    assert_eq!(left, &[1, 2]);
-    assert_eq!(right, [3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_array_ref::<6>();
-    assert_eq!(left, &[1, 2, 3, 4, 5, 6]);
-    assert_eq!(right, []);
-}
-

pub fn rsplit_array_ref<const N: usize>(&self) -> (&[T], &[T; N])

🔬This is a nightly-only experimental API. (split_array)

Divides one slice into an array and a remainder slice at an index from -the end.

-

The slice will contain all indices from [0, len - N) (excluding -the index len - N itself) and the array will contain all -indices from [len - N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let v = &[1, 2, 3, 4, 5, 6][..];
-
-{
-   let (left, right) = v.rsplit_array_ref::<0>();
-   assert_eq!(left, [1, 2, 3, 4, 5, 6]);
-   assert_eq!(right, &[]);
-}
-
-{
-    let (left, right) = v.rsplit_array_ref::<2>();
-    assert_eq!(left, [1, 2, 3, 4]);
-    assert_eq!(right, &[5, 6]);
-}
-
-{
-    let (left, right) = v.rsplit_array_ref::<6>();
-    assert_eq!(left, []);
-    assert_eq!(right, &[1, 2, 3, 4, 5, 6]);
-}
-
1.0.0

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred. The matched element is not contained in the subslices.

-
Examples
-
let slice = [10, 40, 33, 20];
-let mut iter = slice.split(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10, 40]);
-assert_eq!(iter.next().unwrap(), &[20]);
-assert!(iter.next().is_none());
-

If the first element is matched, an empty slice will be the first item -returned by the iterator. Similarly, if the last element in the slice -is matched, an empty slice will be the last item returned by the -iterator:

- -
let slice = [10, 40, 33];
-let mut iter = slice.split(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10, 40]);
-assert_eq!(iter.next().unwrap(), &[]);
-assert!(iter.next().is_none());
-

If two matched elements are directly adjacent, an empty slice will be -present between them:

- -
let slice = [10, 6, 33, 20];
-let mut iter = slice.split(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10]);
-assert_eq!(iter.next().unwrap(), &[]);
-assert_eq!(iter.next().unwrap(), &[20]);
-assert!(iter.next().is_none());
-
1.51.0

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred. The matched element is contained in the end of the previous -subslice as a terminator.

-
Examples
-
let slice = [10, 40, 33, 20];
-let mut iter = slice.split_inclusive(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10, 40, 33]);
-assert_eq!(iter.next().unwrap(), &[20]);
-assert!(iter.next().is_none());
-

If the last element of the slice is matched, -that element will be considered the terminator of the preceding slice. -That slice will be the last item returned by the iterator.

- -
let slice = [3, 10, 40, 33];
-let mut iter = slice.split_inclusive(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[3]);
-assert_eq!(iter.next().unwrap(), &[10, 40, 33]);
-assert!(iter.next().is_none());
-
1.27.0

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred, starting at the end of the slice and working backwards. -The matched element is not contained in the subslices.

-
Examples
-
let slice = [11, 22, 33, 0, 44, 55];
-let mut iter = slice.rsplit(|num| *num == 0);
-
-assert_eq!(iter.next().unwrap(), &[44, 55]);
-assert_eq!(iter.next().unwrap(), &[11, 22, 33]);
-assert_eq!(iter.next(), None);
-

As with split(), if the first or last element is matched, an empty -slice will be the first (or last) item returned by the iterator.

- -
let v = &[0, 1, 1, 2, 3, 5, 8];
-let mut it = v.rsplit(|n| *n % 2 == 0);
-assert_eq!(it.next().unwrap(), &[]);
-assert_eq!(it.next().unwrap(), &[3, 5]);
-assert_eq!(it.next().unwrap(), &[1, 1]);
-assert_eq!(it.next().unwrap(), &[]);
-assert_eq!(it.next(), None);
-
1.0.0

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred, limited to returning at most n items. The matched element is -not contained in the subslices.

-

The last element returned, if any, will contain the remainder of the -slice.

-
Examples
-

Print the slice split once by numbers divisible by 3 (i.e., [10, 40], -[20, 60, 50]):

- -
let v = [10, 40, 30, 20, 60, 50];
-
-for group in v.splitn(2, |num| *num % 3 == 0) {
-    println!("{group:?}");
-}
-
1.0.0

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred limited to returning at most n items. This starts at the end of -the slice and works backwards. The matched element is not contained in -the subslices.

-

The last element returned, if any, will contain the remainder of the -slice.

-
Examples
-

Print the slice split once, starting from the end, by numbers divisible -by 3 (i.e., [50], [10, 40, 30, 20]):

- -
let v = [10, 40, 30, 20, 60, 50];
-
-for group in v.rsplitn(2, |num| *num % 3 == 0) {
-    println!("{group:?}");
-}
-
1.0.0

pub fn contains(&self, x: &T) -> boolwhere - T: PartialEq<T>,

Returns true if the slice contains an element with the given value.

-

This operation is O(n).

-

Note that if you have a sorted slice, binary_search may be faster.

-
Examples
-
let v = [10, 40, 30];
-assert!(v.contains(&30));
-assert!(!v.contains(&50));
-

If you do not have a &T, but some other value that you can compare -with one (for example, String implements PartialEq<str>), you can -use iter().any:

- -
let v = [String::from("hello"), String::from("world")]; // slice of `String`
-assert!(v.iter().any(|e| e == "hello")); // search with `&str`
-assert!(!v.iter().any(|e| e == "hi"));
-
1.0.0

pub fn starts_with(&self, needle: &[T]) -> boolwhere - T: PartialEq<T>,

Returns true if needle is a prefix of the slice.

-
Examples
-
let v = [10, 40, 30];
-assert!(v.starts_with(&[10]));
-assert!(v.starts_with(&[10, 40]));
-assert!(!v.starts_with(&[50]));
-assert!(!v.starts_with(&[10, 50]));
-

Always returns true if needle is an empty slice:

- -
let v = &[10, 40, 30];
-assert!(v.starts_with(&[]));
-let v: &[u8] = &[];
-assert!(v.starts_with(&[]));
-
1.0.0

pub fn ends_with(&self, needle: &[T]) -> boolwhere - T: PartialEq<T>,

Returns true if needle is a suffix of the slice.

-
Examples
-
let v = [10, 40, 30];
-assert!(v.ends_with(&[30]));
-assert!(v.ends_with(&[40, 30]));
-assert!(!v.ends_with(&[50]));
-assert!(!v.ends_with(&[50, 30]));
-

Always returns true if needle is an empty slice:

- -
let v = &[10, 40, 30];
-assert!(v.ends_with(&[]));
-let v: &[u8] = &[];
-assert!(v.ends_with(&[]));
-
1.51.0

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>where - P: SlicePattern<Item = T> + ?Sized, - T: PartialEq<T>,

Returns a subslice with the prefix removed.

-

If the slice starts with prefix, returns the subslice after the prefix, wrapped in Some. -If prefix is empty, simply returns the original slice.

-

If the slice does not start with prefix, returns None.

-
Examples
-
let v = &[10, 40, 30];
-assert_eq!(v.strip_prefix(&[10]), Some(&[40, 30][..]));
-assert_eq!(v.strip_prefix(&[10, 40]), Some(&[30][..]));
-assert_eq!(v.strip_prefix(&[50]), None);
-assert_eq!(v.strip_prefix(&[10, 50]), None);
-
-let prefix : &str = "he";
-assert_eq!(b"hello".strip_prefix(prefix.as_bytes()),
-           Some(b"llo".as_ref()));
-
1.51.0

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>where - P: SlicePattern<Item = T> + ?Sized, - T: PartialEq<T>,

Returns a subslice with the suffix removed.

-

If the slice ends with suffix, returns the subslice before the suffix, wrapped in Some. -If suffix is empty, simply returns the original slice.

-

If the slice does not end with suffix, returns None.

-
Examples
-
let v = &[10, 40, 30];
-assert_eq!(v.strip_suffix(&[30]), Some(&[10, 40][..]));
-assert_eq!(v.strip_suffix(&[40, 30]), Some(&[10][..]));
-assert_eq!(v.strip_suffix(&[50]), None);
-assert_eq!(v.strip_suffix(&[50, 30]), None);
-

Binary searches this slice for a given element. -If the slice is not sorted, the returned result is unspecified and -meaningless.

-

If the value is found then [Result::Ok] is returned, containing the -index of the matching element. If there are multiple matches, then any -one of the matches could be returned. The index is chosen -deterministically, but is subject to change in future versions of Rust. -If the value is not found then [Result::Err] is returned, containing -the index where a matching element could be inserted while maintaining -sorted order.

-

See also binary_search_by, binary_search_by_key, and partition_point.

-
Examples
-

Looks up a series of four elements. The first is found, with a -uniquely determined position; the second and third are not -found; the fourth could match any position in [1, 4].

- -
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-
-assert_eq!(s.binary_search(&13),  Ok(9));
-assert_eq!(s.binary_search(&4),   Err(7));
-assert_eq!(s.binary_search(&100), Err(13));
-let r = s.binary_search(&1);
-assert!(match r { Ok(1..=4) => true, _ => false, });
-

If you want to find that whole range of matching items, rather than -an arbitrary matching one, that can be done using partition_point:

- -
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-
-let low = s.partition_point(|x| x < &1);
-assert_eq!(low, 1);
-let high = s.partition_point(|x| x <= &1);
-assert_eq!(high, 5);
-let r = s.binary_search(&1);
-assert!((low..high).contains(&r.unwrap()));
-
-assert!(s[..low].iter().all(|&x| x < 1));
-assert!(s[low..high].iter().all(|&x| x == 1));
-assert!(s[high..].iter().all(|&x| x > 1));
-
-// For something not found, the "range" of equal items is empty
-assert_eq!(s.partition_point(|x| x < &11), 9);
-assert_eq!(s.partition_point(|x| x <= &11), 9);
-assert_eq!(s.binary_search(&11), Err(9));
-

If you want to insert an item to a sorted vector, while maintaining -sort order, consider using partition_point:

- -
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-let num = 42;
-let idx = s.partition_point(|&x| x < num);
-// The above is equivalent to `let idx = s.binary_search(&num).unwrap_or_else(|x| x);`
-s.insert(idx, num);
-assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
1.0.0

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>where - F: FnMut(&'a T) -> Ordering,

Binary searches this slice with a comparator function.

-

The comparator function should return an order code that indicates -whether its argument is Less, Equal or Greater the desired -target. -If the slice is not sorted or if the comparator function does not -implement an order consistent with the sort order of the underlying -slice, the returned result is unspecified and meaningless.

-

If the value is found then [Result::Ok] is returned, containing the -index of the matching element. If there are multiple matches, then any -one of the matches could be returned. The index is chosen -deterministically, but is subject to change in future versions of Rust. -If the value is not found then [Result::Err] is returned, containing -the index where a matching element could be inserted while maintaining -sorted order.

-

See also binary_search, binary_search_by_key, and partition_point.

-
Examples
-

Looks up a series of four elements. The first is found, with a -uniquely determined position; the second and third are not -found; the fourth could match any position in [1, 4].

- -
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-
-let seek = 13;
-assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Ok(9));
-let seek = 4;
-assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(7));
-let seek = 100;
-assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(13));
-let seek = 1;
-let r = s.binary_search_by(|probe| probe.cmp(&seek));
-assert!(match r { Ok(1..=4) => true, _ => false, });
-
1.10.0

pub fn binary_search_by_key<'a, B, F>( - &'a self, - b: &B, - f: F -) -> Result<usize, usize>where - F: FnMut(&'a T) -> B, - B: Ord,

Binary searches this slice with a key extraction function.

-

Assumes that the slice is sorted by the key, for instance with -sort_by_key using the same key extraction function. -If the slice is not sorted by the key, the returned result is -unspecified and meaningless.

-

If the value is found then [Result::Ok] is returned, containing the -index of the matching element. If there are multiple matches, then any -one of the matches could be returned. The index is chosen -deterministically, but is subject to change in future versions of Rust. -If the value is not found then [Result::Err] is returned, containing -the index where a matching element could be inserted while maintaining -sorted order.

-

See also binary_search, binary_search_by, and partition_point.

-
Examples
-

Looks up a series of four elements in a slice of pairs sorted by -their second elements. The first is found, with a uniquely -determined position; the second and third are not found; the -fourth could match any position in [1, 4].

- -
let s = [(0, 0), (2, 1), (4, 1), (5, 1), (3, 1),
-         (1, 2), (2, 3), (4, 5), (5, 8), (3, 13),
-         (1, 21), (2, 34), (4, 55)];
-
-assert_eq!(s.binary_search_by_key(&13, |&(a, b)| b),  Ok(9));
-assert_eq!(s.binary_search_by_key(&4, |&(a, b)| b),   Err(7));
-assert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13));
-let r = s.binary_search_by_key(&1, |&(a, b)| b);
-assert!(match r { Ok(1..=4) => true, _ => false, });
-
1.30.0

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmute the slice to a slice of another type, ensuring alignment of the types is -maintained.

-

This method splits the slice into three distinct slices: prefix, correctly aligned middle -slice of a new type, and the suffix slice. How exactly the slice is split up is not -specified; the middle part may be smaller than necessary. However, if this fails to return a -maximal middle part, that is because code is running in a context where performance does not -matter, such as a sanitizer attempting to find alignment bugs. Regular code running -in a default (debug or release) execution will return a maximal middle part.

-

This method has no purpose when either input element T or output element U are -zero-sized and will return the original slice without splitting anything.

-
Safety
-

This method is essentially a transmute with respect to the elements in the returned -middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

-
Examples
-

Basic usage:

- -
unsafe {
-    let bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];
-    let (prefix, shorts, suffix) = bytes.align_to::<u16>();
-    // less_efficient_algorithm_for_bytes(prefix);
-    // more_efficient_algorithm_for_aligned_shorts(shorts);
-    // less_efficient_algorithm_for_bytes(suffix);
-}
-

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])where - Simd<T, LANES>: AsRef<[T; LANES]>, - T: SimdElement, - LaneCount<LANES>: SupportedLaneCount,

🔬This is a nightly-only experimental API. (portable_simd)

Split a slice into a prefix, a middle of aligned SIMD types, and a suffix.

-

This is a safe wrapper around [slice::align_to], so has the same weak -postconditions as that method. You’re only assured that -self.len() == prefix.len() + middle.len() * LANES + suffix.len().

-

Notably, all of the following are possible:

-
    -
  • prefix.len() >= LANES.
  • -
  • middle.is_empty() despite self.len() >= 3 * LANES.
  • -
  • suffix.len() >= LANES.
  • -
-

That said, this is a safe method, so if you’re only writing safe code, -then this can at most cause incorrect logic, not unsoundness.

-
Panics
-

This will panic if the size of the SIMD type is different from -LANES times that of the scalar.

-

At the time of writing, the trait restrictions on Simd<T, LANES> keeps -that from ever happening, as only power-of-two numbers of lanes are -supported. It’s possible that, in the future, those restrictions might -be lifted in a way that would make it possible to see panics from this -method for something like LANES == 3.

-
Examples
-
#![feature(portable_simd)]
-use core::simd::SimdFloat;
-
-let short = &[1, 2, 3];
-let (prefix, middle, suffix) = short.as_simd::<4>();
-assert_eq!(middle, []); // Not enough elements for anything in the middle
-
-// They might be split in any possible way between prefix and suffix
-let it = prefix.iter().chain(suffix).copied();
-assert_eq!(it.collect::<Vec<_>>(), vec![1, 2, 3]);
-
-fn basic_simd_sum(x: &[f32]) -> f32 {
-    use std::ops::Add;
-    use std::simd::f32x4;
-    let (prefix, middle, suffix) = x.as_simd();
-    let sums = f32x4::from_array([
-        prefix.iter().copied().sum(),
-        0.0,
-        0.0,
-        suffix.iter().copied().sum(),
-    ]);
-    let sums = middle.iter().copied().fold(sums, f32x4::add);
-    sums.reduce_sum()
-}
-
-let numbers: Vec<f32> = (1..101).map(|x| x as _).collect();
-assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0);
-

pub fn is_sorted(&self) -> boolwhere - T: PartialOrd<T>,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted.

-

That is, for each element a and its following element b, a <= b must hold. If the -slice yields exactly zero or one element, true is returned.

-

Note that if Self::Item is only PartialOrd, but not Ord, the above definition -implies that this function returns false if any two consecutive items are not -comparable.

-
Examples
-
#![feature(is_sorted)]
-let empty: [i32; 0] = [];
-
-assert!([1, 2, 2, 9].is_sorted());
-assert!(![1, 3, 2, 4].is_sorted());
-assert!([0].is_sorted());
-assert!(empty.is_sorted());
-assert!(![0.0, 1.0, f32::NAN].is_sorted());
-

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> boolwhere - F: FnMut(&'a T, &'a T) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given comparator function.

-

Instead of using PartialOrd::partial_cmp, this function uses the given compare -function to determine the ordering of two elements. Apart from that, it’s equivalent to -is_sorted; see its documentation for more information.

-

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> boolwhere - F: FnMut(&'a T) -> K, - K: PartialOrd<K>,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given key extraction function.

-

Instead of comparing the slice’s elements directly, this function compares the keys of the -elements, as determined by f. Apart from that, it’s equivalent to is_sorted; see its -documentation for more information.

-
Examples
-
#![feature(is_sorted)]
-
-assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
-assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
-
1.52.0

pub fn partition_point<P>(&self, pred: P) -> usizewhere - P: FnMut(&T) -> bool,

Returns the index of the partition point according to the given predicate -(the index of the first element of the second partition).

-

The slice is assumed to be partitioned according to the given predicate. -This means that all elements for which the predicate returns true are at the start of the slice -and all elements for which the predicate returns false are at the end. -For example, [7, 15, 3, 5, 4, 12, 6] is partitioned under the predicate x % 2 != 0 -(all odd numbers are at the start, all even at the end).

-

If this slice is not partitioned, the returned result is unspecified and meaningless, -as this method performs a kind of binary search.

-

See also binary_search, binary_search_by, and binary_search_by_key.

-
Examples
-
let v = [1, 2, 3, 3, 5, 6, 7];
-let i = v.partition_point(|&x| x < 5);
-
-assert_eq!(i, 4);
-assert!(v[..i].iter().all(|&x| x < 5));
-assert!(v[i..].iter().all(|&x| !(x < 5)));
-

If all elements of the slice match the predicate, including if the slice -is empty, then the length of the slice will be returned:

- -
let a = [2, 4, 8];
-assert_eq!(a.partition_point(|x| x < &100), a.len());
-let a: [i32; 0] = [];
-assert_eq!(a.partition_point(|x| x < &100), 0);
-

If you want to insert an item to a sorted vector, while maintaining -sort order:

- -
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-let num = 42;
-let idx = s.partition_point(|&x| x < num);
-s.insert(idx, num);
-assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-

Trait Implementations§

source§

impl<T, const N: usize> AsRef<[T]> for HistoryBuffer<T, N>

source§

fn as_ref(&self) -> &[T]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T, const N: usize> Debug for HistoryBuffer<T, N>where - T: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<T, const N: usize> Default for HistoryBuffer<T, N>

source§

fn default() -> HistoryBuffer<T, N>

Returns the “default value” for a type. Read more
source§

impl<T, const N: usize> Deref for HistoryBuffer<T, N>

§

type Target = [T]

The resulting type after dereferencing.
source§

fn deref(&self) -> &[T]

Dereferences the value.
source§

impl<T, const N: usize> Drop for HistoryBuffer<T, N>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'a, T, const N: usize> Extend<&'a T> for HistoryBuffer<T, N>where - T: 'a + Clone,

source§

fn extend<I>(&mut self, iter: I)where - I: IntoIterator<Item = &'a T>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, const N: usize> Extend<T> for HistoryBuffer<T, N>

source§

fn extend<I>(&mut self, iter: I)where - I: IntoIterator<Item = T>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more

Auto Trait Implementations§

§

impl<T, const N: usize> RefUnwindSafe for HistoryBuffer<T, N>where - T: RefUnwindSafe,

§

impl<T, const N: usize> Send for HistoryBuffer<T, N>where - T: Send,

§

impl<T, const N: usize> Sync for HistoryBuffer<T, N>where - T: Sync,

§

impl<T, const N: usize> Unpin for HistoryBuffer<T, N>where - T: Unpin,

§

impl<T, const N: usize> UnwindSafe for HistoryBuffer<T, N>where - T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/struct.IndexMap.html b/docs/doc/arduboy_rust/heapless/struct.IndexMap.html deleted file mode 100644 index eb6633e..0000000 --- a/docs/doc/arduboy_rust/heapless/struct.IndexMap.html +++ /dev/null @@ -1,306 +0,0 @@ -IndexMap in arduboy_rust::heapless - Rust
pub struct IndexMap<K, V, S, const N: usize> { /* private fields */ }
Expand description

Fixed capacity IndexMap

-

Note that you cannot use IndexMap directly, since it is generic around the hashing algorithm -in use. Pick a concrete instantiation like FnvIndexMap instead -or create your own.

-

Note that the capacity of the IndexMap must be a power of 2.

-

Examples

-

Since IndexMap cannot be used directly, we’re using its FnvIndexMap instantiation -for this example.

- -
use heapless::FnvIndexMap;
-
-// A hash map with a capacity of 16 key-value pairs allocated on the stack
-let mut book_reviews = FnvIndexMap::<_, _, 16>::new();
-
-// review some books.
-book_reviews.insert("Adventures of Huckleberry Finn",    "My favorite book.").unwrap();
-book_reviews.insert("Grimms' Fairy Tales",               "Masterpiece.").unwrap();
-book_reviews.insert("Pride and Prejudice",               "Very enjoyable.").unwrap();
-book_reviews.insert("The Adventures of Sherlock Holmes", "Eye lyked it alot.").unwrap();
-
-// check for a specific one.
-if !book_reviews.contains_key("Les Misérables") {
-    println!("We've got {} reviews, but Les Misérables ain't one.",
-             book_reviews.len());
-}
-
-// oops, this review has a lot of spelling mistakes, let's delete it.
-book_reviews.remove("The Adventures of Sherlock Holmes");
-
-// look up the values associated with some keys.
-let to_find = ["Pride and Prejudice", "Alice's Adventure in Wonderland"];
-for book in &to_find {
-    match book_reviews.get(book) {
-        Some(review) => println!("{}: {}", book, review),
-        None => println!("{} is unreviewed.", book)
-    }
-}
-
-// iterate over everything.
-for (book, review) in &book_reviews {
-    println!("{}: \"{}\"", book, review);
-}
-

Implementations§

source§

impl<K, V, S, const N: usize> IndexMap<K, V, BuildHasherDefault<S>, N>

source

pub const fn new() -> IndexMap<K, V, BuildHasherDefault<S>, N>

Creates an empty IndexMap.

-
source§

impl<K, V, S, const N: usize> IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher,

source

pub fn capacity(&self) -> usize

Returns the number of elements the map can hold

-
source

pub fn keys(&self) -> impl Iterator<Item = &K>

Return an iterator over the keys of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for key in map.keys() {
-    println!("{}", key);
-}
-
source

pub fn values(&self) -> impl Iterator<Item = &V>

Return an iterator over the values of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for val in map.values() {
-    println!("{}", val);
-}
-
source

pub fn values_mut(&mut self) -> impl Iterator<Item = &mut V>

Return an iterator over mutable references to the the values of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for val in map.values_mut() {
-    *val += 10;
-}
-
-for val in map.values() {
-    println!("{}", val);
-}
-
source

pub fn iter(&self) -> Iter<'_, K, V>

Return an iterator over the key-value pairs of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for (key, val) in map.iter() {
-    println!("key: {} val: {}", key, val);
-}
-
source

pub fn iter_mut(&mut self) -> IterMut<'_, K, V>

Return an iterator over the key-value pairs of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for (_, val) in map.iter_mut() {
-    *val = 2;
-}
-
-for (key, val) in &map {
-    println!("key: {} val: {}", key, val);
-}
-
source

pub fn first(&self) -> Option<(&K, &V)>

Get the first key-value pair

-

Computes in O(1) time

-
source

pub fn first_mut(&mut self) -> Option<(&K, &mut V)>

Get the first key-value pair, with mutable access to the value

-

Computes in O(1) time

-
source

pub fn last(&self) -> Option<(&K, &V)>

Get the last key-value pair

-

Computes in O(1) time

-
source

pub fn last_mut(&mut self) -> Option<(&K, &mut V)>

Get the last key-value pair, with mutable access to the value

-

Computes in O(1) time

-
source

pub fn entry(&mut self, key: K) -> Entry<'_, K, V, N>

Returns an entry for the corresponding key

- -
use heapless::FnvIndexMap;
-use heapless::Entry;
-let mut map = FnvIndexMap::<_, _, 16>::new();
-if let Entry::Vacant(v) = map.entry("a") {
-    v.insert(1).unwrap();
-}
-if let Entry::Occupied(mut o) = map.entry("a") {
-    println!("found {}", *o.get()); // Prints 1
-    o.insert(2);
-}
-// Prints 2
-println!("val: {}", *map.get("a").unwrap());
-
source

pub fn len(&self) -> usize

Return the number of key-value pairs in the map.

-

Computes in O(1) time.

- -
use heapless::FnvIndexMap;
-
-let mut a = FnvIndexMap::<_, _, 16>::new();
-assert_eq!(a.len(), 0);
-a.insert(1, "a").unwrap();
-assert_eq!(a.len(), 1);
-
source

pub fn is_empty(&self) -> bool

Returns true if the map contains no elements.

-

Computes in O(1) time.

- -
use heapless::FnvIndexMap;
-
-let mut a = FnvIndexMap::<_, _, 16>::new();
-assert!(a.is_empty());
-a.insert(1, "a");
-assert!(!a.is_empty());
-
source

pub fn clear(&mut self)

Remove all key-value pairs in the map, while preserving its capacity.

-

Computes in O(n) time.

- -
use heapless::FnvIndexMap;
-
-let mut a = FnvIndexMap::<_, _, 16>::new();
-a.insert(1, "a");
-a.clear();
-assert!(a.is_empty());
-
source

pub fn get<Q>(&self, key: &Q) -> Option<&V>where - K: Borrow<Q>, - Q: Hash + Eq + ?Sized,

Returns a reference to the value corresponding to the key.

-

The key may be any borrowed form of the map’s key type, but Hash and Eq on the borrowed -form must match those for the key type.

-

Computes in O(1) time (average).

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.get(&1), Some(&"a"));
-assert_eq!(map.get(&2), None);
-
source

pub fn contains_key<Q>(&self, key: &Q) -> boolwhere - K: Borrow<Q>, - Q: Eq + Hash + ?Sized,

Returns true if the map contains a value for the specified key.

-

The key may be any borrowed form of the map’s key type, but Hash and Eq on the borrowed -form must match those for the key type.

-

Computes in O(1) time (average).

-
Examples
-
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 8>::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.contains_key(&1), true);
-assert_eq!(map.contains_key(&2), false);
-
source

pub fn get_mut<Q, 'v>(&'v mut self, key: &Q) -> Option<&'v mut V>where - K: Borrow<Q>, - Q: Hash + Eq + ?Sized,

Returns a mutable reference to the value corresponding to the key.

-

The key may be any borrowed form of the map’s key type, but Hash and Eq on the borrowed -form must match those for the key type.

-

Computes in O(1) time (average).

-
Examples
-
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 8>::new();
-map.insert(1, "a").unwrap();
-if let Some(x) = map.get_mut(&1) {
-    *x = "b";
-}
-assert_eq!(map[&1], "b");
-
source

pub fn insert(&mut self, key: K, value: V) -> Result<Option<V>, (K, V)>

Inserts a key-value pair into the map.

-

If an equivalent key already exists in the map: the key remains and retains in its place in -the order, its corresponding value is updated with value and the older value is returned -inside Some(_).

-

If no equivalent key existed in the map: the new key-value pair is inserted, last in order, -and None is returned.

-

Computes in O(1) time (average).

-

See also entry if you you want to insert or modify or if you need to get the index of the -corresponding key-value pair.

-
Examples
-
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 8>::new();
-assert_eq!(map.insert(37, "a"), Ok(None));
-assert_eq!(map.is_empty(), false);
-
-map.insert(37, "b");
-assert_eq!(map.insert(37, "c"), Ok(Some("b")));
-assert_eq!(map[&37], "c");
-
source

pub fn remove<Q>(&mut self, key: &Q) -> Option<V>where - K: Borrow<Q>, - Q: Hash + Eq + ?Sized,

Same as swap_remove

-

Computes in O(1) time (average).

-
Examples
-
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 8>::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.remove(&1), Some("a"));
-assert_eq!(map.remove(&1), None);
-
source

pub fn swap_remove<Q>(&mut self, key: &Q) -> Option<V>where - K: Borrow<Q>, - Q: Hash + Eq + ?Sized,

Remove the key-value pair equivalent to key and return its value.

-

Like Vec::swap_remove, the pair is removed by swapping it with the last element of the map -and popping it off. This perturbs the postion of what used to be the last element!

-

Return None if key is not in map.

-

Computes in O(1) time (average).

-

Trait Implementations§

source§

impl<K, V, S, const N: usize> Clone for IndexMap<K, V, S, N>where - K: Eq + Hash + Clone, - V: Clone, - S: Clone,

source§

fn clone(&self) -> IndexMap<K, V, S, N>

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<K, V, S, const N: usize> Debug for IndexMap<K, V, S, N>where - K: Eq + Hash + Debug, - V: Debug, - S: BuildHasher,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<K, V, S, const N: usize> Default for IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher + Default,

source§

fn default() -> IndexMap<K, V, S, N>

Returns the “default value” for a type. Read more
source§

impl<'a, K, V, S, const N: usize> Extend<(&'a K, &'a V)> for IndexMap<K, V, S, N>where - K: Eq + Hash + Copy, - V: Copy, - S: BuildHasher,

source§

fn extend<I>(&mut self, iterable: I)where - I: IntoIterator<Item = (&'a K, &'a V)>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<K, V, S, const N: usize> Extend<(K, V)> for IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher,

source§

fn extend<I>(&mut self, iterable: I)where - I: IntoIterator<Item = (K, V)>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<K, V, S, const N: usize> FromIterator<(K, V)> for IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher + Default,

source§

fn from_iter<I>(iterable: I) -> IndexMap<K, V, S, N>where - I: IntoIterator<Item = (K, V)>,

Creates a value from an iterator. Read more
source§

impl<'a, K, Q, V, S, const N: usize> Index<&'a Q> for IndexMap<K, V, S, N>where - K: Eq + Hash + Borrow<Q>, - Q: Eq + Hash + ?Sized, - S: BuildHasher,

§

type Output = V

The returned type after indexing.
source§

fn index(&self, key: &Q) -> &V

Performs the indexing (container[index]) operation. Read more
source§

impl<'a, K, Q, V, S, const N: usize> IndexMut<&'a Q> for IndexMap<K, V, S, N>where - K: Eq + Hash + Borrow<Q>, - Q: Eq + Hash + ?Sized, - S: BuildHasher,

source§

fn index_mut(&mut self, key: &Q) -> &mut V

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<'a, K, V, S, const N: usize> IntoIterator for &'a IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher,

§

type Item = (&'a K, &'a V)

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, K, V>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <&'a IndexMap<K, V, S, N> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, K, V, S, const N: usize> IntoIterator for &'a mut IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher,

§

type Item = (&'a K, &'a mut V)

The type of the elements being iterated over.
§

type IntoIter = IterMut<'a, K, V>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <&'a mut IndexMap<K, V, S, N> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<K, V, S, const N: usize> IntoIterator for IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher,

§

type Item = (K, V)

The type of the elements being iterated over.
§

type IntoIter = IntoIter<K, V, N>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <IndexMap<K, V, S, N> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<K, V, S, S2, const N: usize, const N2: usize> PartialEq<IndexMap<K, V, S2, N2>> for IndexMap<K, V, S, N>where - K: Eq + Hash, - V: Eq, - S: BuildHasher, - S2: BuildHasher,

source§

fn eq(&self, other: &IndexMap<K, V, S2, N2>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<K, V, S, const N: usize> Eq for IndexMap<K, V, S, N>where - K: Eq + Hash, - V: Eq, - S: BuildHasher,

Auto Trait Implementations§

§

impl<K, V, S, const N: usize> RefUnwindSafe for IndexMap<K, V, S, N>where - K: RefUnwindSafe, - S: RefUnwindSafe, - V: RefUnwindSafe,

§

impl<K, V, S, const N: usize> Send for IndexMap<K, V, S, N>where - K: Send, - S: Send, - V: Send,

§

impl<K, V, S, const N: usize> Sync for IndexMap<K, V, S, N>where - K: Sync, - S: Sync, - V: Sync,

§

impl<K, V, S, const N: usize> Unpin for IndexMap<K, V, S, N>where - K: Unpin, - S: Unpin, - V: Unpin,

§

impl<K, V, S, const N: usize> UnwindSafe for IndexMap<K, V, S, N>where - K: UnwindSafe, - S: UnwindSafe, - V: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/struct.IndexSet.html b/docs/doc/arduboy_rust/heapless/struct.IndexSet.html deleted file mode 100644 index b2f7599..0000000 --- a/docs/doc/arduboy_rust/heapless/struct.IndexSet.html +++ /dev/null @@ -1,296 +0,0 @@ -IndexSet in arduboy_rust::heapless - Rust
pub struct IndexSet<T, S, const N: usize> { /* private fields */ }
Expand description

Fixed capacity IndexSet.

-

Note that you cannot use IndexSet directly, since it is generic around the hashing algorithm -in use. Pick a concrete instantiation like FnvIndexSet instead -or create your own.

-

Note that the capacity of the IndexSet must be a power of 2.

-

Examples

-

Since IndexSet cannot be used directly, we’re using its FnvIndexSet instantiation -for this example.

- -
use heapless::FnvIndexSet;
-
-// A hash set with a capacity of 16 elements allocated on the stack
-let mut books = FnvIndexSet::<_, 16>::new();
-
-// Add some books.
-books.insert("A Dance With Dragons").unwrap();
-books.insert("To Kill a Mockingbird").unwrap();
-books.insert("The Odyssey").unwrap();
-books.insert("The Great Gatsby").unwrap();
-
-// Check for a specific one.
-if !books.contains("The Winds of Winter") {
-    println!("We have {} books, but The Winds of Winter ain't one.",
-             books.len());
-}
-
-// Remove a book.
-books.remove("The Odyssey");
-
-// Iterate over everything.
-for book in &books {
-    println!("{}", book);
-}
-

Implementations§

source§

impl<T, S, const N: usize> IndexSet<T, BuildHasherDefault<S>, N>

source

pub const fn new() -> IndexSet<T, BuildHasherDefault<S>, N>

Creates an empty IndexSet

-
source§

impl<T, S, const N: usize> IndexSet<T, S, N>where - T: Eq + Hash, - S: BuildHasher,

source

pub fn capacity(&self) -> usize

Returns the number of elements the set can hold

-
Examples
-
use heapless::FnvIndexSet;
-
-let set = FnvIndexSet::<i32, 16>::new();
-assert_eq!(set.capacity(), 16);
-
source

pub fn iter(&self) -> Iter<'_, T>

Return an iterator over the values of the set, in their order

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut set = FnvIndexSet::<_, 16>::new();
-set.insert("a").unwrap();
-set.insert("b").unwrap();
-
-// Will print in an arbitrary order.
-for x in set.iter() {
-    println!("{}", x);
-}
-
source

pub fn first(&self) -> Option<&T>

Get the first value

-

Computes in O(1) time

-
source

pub fn last(&self) -> Option<&T>

Get the last value

-

Computes in O(1) time

-
source

pub fn difference<S2, const N2: usize, 'a>( - &'a self, - other: &'a IndexSet<T, S2, N2> -) -> Difference<'a, T, S2, N2>where - S2: BuildHasher,

Visits the values representing the difference, i.e. the values that are in self but not in -other.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-
-// Can be seen as `a - b`.
-for x in a.difference(&b) {
-    println!("{}", x); // Print 1
-}
-
-let diff: FnvIndexSet<_, 16> = a.difference(&b).collect();
-assert_eq!(diff, [1].iter().collect::<FnvIndexSet<_, 16>>());
-
-// Note that difference is not symmetric,
-// and `b - a` means something else:
-let diff: FnvIndexSet<_, 16> = b.difference(&a).collect();
-assert_eq!(diff, [4].iter().collect::<FnvIndexSet<_, 16>>());
-
source

pub fn symmetric_difference<S2, const N2: usize, 'a>( - &'a self, - other: &'a IndexSet<T, S2, N2> -) -> impl Iterator<Item = &'a T>where - S2: BuildHasher,

Visits the values representing the symmetric difference, i.e. the values that are in self -or in other but not in both.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-
-// Print 1, 4 in that order order.
-for x in a.symmetric_difference(&b) {
-    println!("{}", x);
-}
-
-let diff1: FnvIndexSet<_, 16> = a.symmetric_difference(&b).collect();
-let diff2: FnvIndexSet<_, 16> = b.symmetric_difference(&a).collect();
-
-assert_eq!(diff1, diff2);
-assert_eq!(diff1, [1, 4].iter().collect::<FnvIndexSet<_, 16>>());
-
source

pub fn intersection<S2, const N2: usize, 'a>( - &'a self, - other: &'a IndexSet<T, S2, N2> -) -> Intersection<'a, T, S2, N2>where - S2: BuildHasher,

Visits the values representing the intersection, i.e. the values that are both in self and -other.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-
-// Print 2, 3 in that order.
-for x in a.intersection(&b) {
-    println!("{}", x);
-}
-
-let intersection: FnvIndexSet<_, 16> = a.intersection(&b).collect();
-assert_eq!(intersection, [2, 3].iter().collect::<FnvIndexSet<_, 16>>());
-
source

pub fn union<S2, const N2: usize, 'a>( - &'a self, - other: &'a IndexSet<T, S2, N2> -) -> impl Iterator<Item = &'a T>where - S2: BuildHasher,

Visits the values representing the union, i.e. all the values in self or other, without -duplicates.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-
-// Print 1, 2, 3, 4 in that order.
-for x in a.union(&b) {
-    println!("{}", x);
-}
-
-let union: FnvIndexSet<_, 16> = a.union(&b).collect();
-assert_eq!(union, [1, 2, 3, 4].iter().collect::<FnvIndexSet<_, 16>>());
-
source

pub fn len(&self) -> usize

Returns the number of elements in the set.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut v: FnvIndexSet<_, 16> = FnvIndexSet::new();
-assert_eq!(v.len(), 0);
-v.insert(1).unwrap();
-assert_eq!(v.len(), 1);
-
source

pub fn is_empty(&self) -> bool

Returns true if the set contains no elements.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut v: FnvIndexSet<_, 16> = FnvIndexSet::new();
-assert!(v.is_empty());
-v.insert(1).unwrap();
-assert!(!v.is_empty());
-
source

pub fn clear(&mut self)

Clears the set, removing all values.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut v: FnvIndexSet<_, 16> = FnvIndexSet::new();
-v.insert(1).unwrap();
-v.clear();
-assert!(v.is_empty());
-
source

pub fn contains<Q>(&self, value: &Q) -> boolwhere - T: Borrow<Q>, - Q: Eq + Hash + ?Sized,

Returns true if the set contains a value.

-

The value may be any borrowed form of the set’s value type, but Hash and Eq on the -borrowed form must match those for the value type.

-
Examples
-
use heapless::FnvIndexSet;
-
-let set: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-assert_eq!(set.contains(&1), true);
-assert_eq!(set.contains(&4), false);
-
source

pub fn is_disjoint<S2, const N2: usize>( - &self, - other: &IndexSet<T, S2, N2> -) -> boolwhere - S2: BuildHasher,

Returns true if self has no elements in common with other. This is equivalent to -checking for an empty intersection.

-
Examples
-
use heapless::FnvIndexSet;
-
-let a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b = FnvIndexSet::<_, 16>::new();
-
-assert_eq!(a.is_disjoint(&b), true);
-b.insert(4).unwrap();
-assert_eq!(a.is_disjoint(&b), true);
-b.insert(1).unwrap();
-assert_eq!(a.is_disjoint(&b), false);
-
source

pub fn is_subset<S2, const N2: usize>( - &self, - other: &IndexSet<T, S2, N2> -) -> boolwhere - S2: BuildHasher,

Returns true if the set is a subset of another, i.e. other contains at least all the -values in self.

-
Examples
-
use heapless::FnvIndexSet;
-
-let sup: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut set = FnvIndexSet::<_, 16>::new();
-
-assert_eq!(set.is_subset(&sup), true);
-set.insert(2).unwrap();
-assert_eq!(set.is_subset(&sup), true);
-set.insert(4).unwrap();
-assert_eq!(set.is_subset(&sup), false);
-
source

pub fn is_superset<S2, const N2: usize>( - &self, - other: &IndexSet<T, S2, N2> -) -> boolwhere - S2: BuildHasher,

Examples
-
use heapless::FnvIndexSet;
-
-let sub: FnvIndexSet<_, 16> = [1, 2].iter().cloned().collect();
-let mut set = FnvIndexSet::<_, 16>::new();
-
-assert_eq!(set.is_superset(&sub), false);
-
-set.insert(0).unwrap();
-set.insert(1).unwrap();
-assert_eq!(set.is_superset(&sub), false);
-
-set.insert(2).unwrap();
-assert_eq!(set.is_superset(&sub), true);
-
source

pub fn insert(&mut self, value: T) -> Result<bool, T>

Adds a value to the set.

-

If the set did not have this value present, true is returned.

-

If the set did have this value present, false is returned.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut set = FnvIndexSet::<_, 16>::new();
-
-assert_eq!(set.insert(2).unwrap(), true);
-assert_eq!(set.insert(2).unwrap(), false);
-assert_eq!(set.len(), 1);
-
source

pub fn remove<Q>(&mut self, value: &Q) -> boolwhere - T: Borrow<Q>, - Q: Eq + Hash + ?Sized,

Removes a value from the set. Returns true if the value was present in the set.

-

The value may be any borrowed form of the set’s value type, but Hash and Eq on the -borrowed form must match those for the value type.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut set = FnvIndexSet::<_, 16>::new();
-
-set.insert(2).unwrap();
-assert_eq!(set.remove(&2), true);
-assert_eq!(set.remove(&2), false);
-

Trait Implementations§

source§

impl<T, S, const N: usize> Clone for IndexSet<T, S, N>where - T: Eq + Hash + Clone, - S: Clone,

source§

fn clone(&self) -> IndexSet<T, S, N>

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, S, const N: usize> Debug for IndexSet<T, S, N>where - T: Eq + Hash + Debug, - S: BuildHasher,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<T, S, const N: usize> Default for IndexSet<T, S, N>where - T: Eq + Hash, - S: BuildHasher + Default,

source§

fn default() -> IndexSet<T, S, N>

Returns the “default value” for a type. Read more
source§

impl<'a, T, S, const N: usize> Extend<&'a T> for IndexSet<T, S, N>where - T: 'a + Eq + Hash + Copy, - S: BuildHasher,

source§

fn extend<I>(&mut self, iterable: I)where - I: IntoIterator<Item = &'a T>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, S, const N: usize> Extend<T> for IndexSet<T, S, N>where - T: Eq + Hash, - S: BuildHasher,

source§

fn extend<I>(&mut self, iterable: I)where - I: IntoIterator<Item = T>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, S, const N: usize> FromIterator<T> for IndexSet<T, S, N>where - T: Eq + Hash, - S: BuildHasher + Default,

source§

fn from_iter<I>(iter: I) -> IndexSet<T, S, N>where - I: IntoIterator<Item = T>,

Creates a value from an iterator. Read more
source§

impl<'a, T, S, const N: usize> IntoIterator for &'a IndexSet<T, S, N>where - T: Eq + Hash, - S: BuildHasher,

§

type Item = &'a T

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <&'a IndexSet<T, S, N> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, S1, S2, const N1: usize, const N2: usize> PartialEq<IndexSet<T, S2, N2>> for IndexSet<T, S1, N1>where - T: Eq + Hash, - S1: BuildHasher, - S2: BuildHasher,

source§

fn eq(&self, other: &IndexSet<T, S2, N2>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

§

impl<T, S, const N: usize> RefUnwindSafe for IndexSet<T, S, N>where - S: RefUnwindSafe, - T: RefUnwindSafe,

§

impl<T, S, const N: usize> Send for IndexSet<T, S, N>where - S: Send, - T: Send,

§

impl<T, S, const N: usize> Sync for IndexSet<T, S, N>where - S: Sync, - T: Sync,

§

impl<T, S, const N: usize> Unpin for IndexSet<T, S, N>where - S: Unpin, - T: Unpin,

§

impl<T, S, const N: usize> UnwindSafe for IndexSet<T, S, N>where - S: UnwindSafe, - T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/struct.LinearMap.html b/docs/doc/arduboy_rust/heapless/struct.LinearMap.html deleted file mode 100644 index 6b0c526..0000000 --- a/docs/doc/arduboy_rust/heapless/struct.LinearMap.html +++ /dev/null @@ -1,214 +0,0 @@ -LinearMap in arduboy_rust::heapless - Rust
pub struct LinearMap<K, V, const N: usize> { /* private fields */ }
Expand description

A fixed capacity map / dictionary that performs lookups via linear search

-

Note that as this map doesn’t use hashing so most operations are O(N) instead of O(1)

-

Implementations§

source§

impl<K, V, const N: usize> LinearMap<K, V, N>

source

pub const fn new() -> LinearMap<K, V, N>

Creates an empty LinearMap

-
Examples
-
use heapless::LinearMap;
-
-// allocate the map on the stack
-let mut map: LinearMap<&str, isize, 8> = LinearMap::new();
-
-// allocate the map in a static variable
-static mut MAP: LinearMap<&str, isize, 8> = LinearMap::new();
-
source§

impl<K, V, const N: usize> LinearMap<K, V, N>where - K: Eq,

source

pub fn capacity(&self) -> usize

Returns the number of elements that the map can hold

-

Computes in O(1) time

-
Examples
-
use heapless::LinearMap;
-
-let map: LinearMap<&str, isize, 8> = LinearMap::new();
-assert_eq!(map.capacity(), 8);
-
source

pub fn clear(&mut self)

Clears the map, removing all key-value pairs

-

Computes in O(1) time

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert(1, "a").unwrap();
-map.clear();
-assert!(map.is_empty());
-
source

pub fn contains_key(&self, key: &K) -> bool

Returns true if the map contains a value for the specified key.

-

Computes in O(N) time

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.contains_key(&1), true);
-assert_eq!(map.contains_key(&2), false);
-
source

pub fn get<Q>(&self, key: &Q) -> Option<&V>where - K: Borrow<Q>, - Q: Eq + ?Sized,

Returns a reference to the value corresponding to the key

-

Computes in O(N) time

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.get(&1), Some(&"a"));
-assert_eq!(map.get(&2), None);
-
source

pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>where - K: Borrow<Q>, - Q: Eq + ?Sized,

Returns a mutable reference to the value corresponding to the key

-

Computes in O(N) time

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert(1, "a").unwrap();
-if let Some(x) = map.get_mut(&1) {
-    *x = "b";
-}
-assert_eq!(map[&1], "b");
-
source

pub fn len(&self) -> usize

Returns the number of elements in this map

-

Computes in O(1) time

-
Examples
-
use heapless::LinearMap;
-
-let mut a: LinearMap<_, _, 8> = LinearMap::new();
-assert_eq!(a.len(), 0);
-a.insert(1, "a").unwrap();
-assert_eq!(a.len(), 1);
-
source

pub fn insert(&mut self, key: K, value: V) -> Result<Option<V>, (K, V)>

Inserts a key-value pair into the map.

-

If the map did not have this key present, None is returned.

-

If the map did have this key present, the value is updated, and the old value is returned.

-

Computes in O(N) time

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-assert_eq!(map.insert(37, "a").unwrap(), None);
-assert_eq!(map.is_empty(), false);
-
-map.insert(37, "b").unwrap();
-assert_eq!(map.insert(37, "c").unwrap(), Some("b"));
-assert_eq!(map[&37], "c");
-
source

pub fn is_empty(&self) -> bool

Returns true if the map contains no elements

-

Computes in O(1) time

-
Examples
-
use heapless::LinearMap;
-
-let mut a: LinearMap<_, _, 8> = LinearMap::new();
-assert!(a.is_empty());
-a.insert(1, "a").unwrap();
-assert!(!a.is_empty());
-
source

pub fn iter(&self) -> Iter<'_, K, V>

An iterator visiting all key-value pairs in arbitrary order.

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for (key, val) in map.iter() {
-    println!("key: {} val: {}", key, val);
-}
-
source

pub fn iter_mut(&mut self) -> IterMut<'_, K, V>

An iterator visiting all key-value pairs in arbitrary order, with mutable references to the -values

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-// Update all values
-for (_, val) in map.iter_mut() {
-    *val = 2;
-}
-
-for (key, val) in &map {
-    println!("key: {} val: {}", key, val);
-}
-
source

pub fn keys(&self) -> impl Iterator<Item = &K>

An iterator visiting all keys in arbitrary order

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for key in map.keys() {
-    println!("{}", key);
-}
-
source

pub fn remove<Q>(&mut self, key: &Q) -> Option<V>where - K: Borrow<Q>, - Q: Eq + ?Sized,

Removes a key from the map, returning the value at the key if the key was previously in the -map

-

Computes in O(N) time

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.remove(&1), Some("a"));
-assert_eq!(map.remove(&1), None);
-
source

pub fn values(&self) -> impl Iterator<Item = &V>

An iterator visiting all values in arbitrary order

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for val in map.values() {
-    println!("{}", val);
-}
-
source

pub fn values_mut(&mut self) -> impl Iterator<Item = &mut V>

An iterator visiting all values mutably in arbitrary order

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for val in map.values_mut() {
-    *val += 10;
-}
-
-for val in map.values() {
-    println!("{}", val);
-}
-

Trait Implementations§

source§

impl<K, V, const N: usize> Clone for LinearMap<K, V, N>where - K: Eq + Clone, - V: Clone,

source§

fn clone(&self) -> LinearMap<K, V, N>

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<K, V, const N: usize> Debug for LinearMap<K, V, N>where - K: Eq + Debug, - V: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<K, V, const N: usize> Default for LinearMap<K, V, N>where - K: Eq,

source§

fn default() -> LinearMap<K, V, N>

Returns the “default value” for a type. Read more
source§

impl<K, V, const N: usize> Drop for LinearMap<K, V, N>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<K, V, const N: usize> FromIterator<(K, V)> for LinearMap<K, V, N>where - K: Eq,

source§

fn from_iter<I>(iter: I) -> LinearMap<K, V, N>where - I: IntoIterator<Item = (K, V)>,

Creates a value from an iterator. Read more
source§

impl<'a, K, V, Q, const N: usize> Index<&'a Q> for LinearMap<K, V, N>where - K: Borrow<Q> + Eq, - Q: Eq + ?Sized,

§

type Output = V

The returned type after indexing.
source§

fn index(&self, key: &Q) -> &V

Performs the indexing (container[index]) operation. Read more
source§

impl<'a, K, V, Q, const N: usize> IndexMut<&'a Q> for LinearMap<K, V, N>where - K: Borrow<Q> + Eq, - Q: Eq + ?Sized,

source§

fn index_mut(&mut self, key: &Q) -> &mut V

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<'a, K, V, const N: usize> IntoIterator for &'a LinearMap<K, V, N>where - K: Eq,

§

type Item = (&'a K, &'a V)

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, K, V>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <&'a LinearMap<K, V, N> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<K, V, const N: usize, const N2: usize> PartialEq<LinearMap<K, V, N2>> for LinearMap<K, V, N>where - K: Eq, - V: PartialEq<V>,

source§

fn eq(&self, other: &LinearMap<K, V, N2>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<K, V, const N: usize> Eq for LinearMap<K, V, N>where - K: Eq, - V: PartialEq<V>,

Auto Trait Implementations§

§

impl<K, V, const N: usize> RefUnwindSafe for LinearMap<K, V, N>where - K: RefUnwindSafe, - V: RefUnwindSafe,

§

impl<K, V, const N: usize> Send for LinearMap<K, V, N>where - K: Send, - V: Send,

§

impl<K, V, const N: usize> Sync for LinearMap<K, V, N>where - K: Sync, - V: Sync,

§

impl<K, V, const N: usize> Unpin for LinearMap<K, V, N>where - K: Unpin, - V: Unpin,

§

impl<K, V, const N: usize> UnwindSafe for LinearMap<K, V, N>where - K: UnwindSafe, - V: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/struct.OccupiedEntry.html b/docs/doc/arduboy_rust/heapless/struct.OccupiedEntry.html deleted file mode 100644 index 01a8c22..0000000 --- a/docs/doc/arduboy_rust/heapless/struct.OccupiedEntry.html +++ /dev/null @@ -1,27 +0,0 @@ -OccupiedEntry in arduboy_rust::heapless - Rust
pub struct OccupiedEntry<'a, K, V, const N: usize> { /* private fields */ }
Expand description

An occupied entry which can be manipulated

-

Implementations§

source§

impl<'a, K, V, const N: usize> OccupiedEntry<'a, K, V, N>where - K: Eq + Hash,

source

pub fn key(&self) -> &K

Gets a reference to the key that this entity corresponds to

-
source

pub fn remove_entry(self) -> (K, V)

Removes this entry from the map and yields its corresponding key and value

-
source

pub fn get(&self) -> &V

Gets a reference to the value associated with this entry

-
source

pub fn get_mut(&mut self) -> &mut V

Gets a mutable reference to the value associated with this entry

-
source

pub fn into_mut(self) -> &'a mut V

Consumes this entry and yields a reference to the underlying value

-
source

pub fn insert(self, value: V) -> V

Overwrites the underlying map’s value with this entry’s value

-
source

pub fn remove(self) -> V

Removes this entry from the map and yields its value

-

Auto Trait Implementations§

§

impl<'a, K, V, const N: usize> RefUnwindSafe for OccupiedEntry<'a, K, V, N>where - K: RefUnwindSafe, - V: RefUnwindSafe,

§

impl<'a, K, V, const N: usize> Send for OccupiedEntry<'a, K, V, N>where - K: Send, - V: Send,

§

impl<'a, K, V, const N: usize> Sync for OccupiedEntry<'a, K, V, N>where - K: Sync, - V: Sync,

§

impl<'a, K, V, const N: usize> Unpin for OccupiedEntry<'a, K, V, N>where - K: Unpin,

§

impl<'a, K, V, const N: usize> !UnwindSafe for OccupiedEntry<'a, K, V, N>

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/struct.OldestOrdered.html b/docs/doc/arduboy_rust/heapless/struct.OldestOrdered.html deleted file mode 100644 index 7aff1ee..0000000 --- a/docs/doc/arduboy_rust/heapless/struct.OldestOrdered.html +++ /dev/null @@ -1,195 +0,0 @@ -OldestOrdered in arduboy_rust::heapless - Rust
pub struct OldestOrdered<'a, T, const N: usize> { /* private fields */ }
Expand description

An iterator on the underlying buffer ordered from oldest data to newest

-

Trait Implementations§

source§

impl<'a, T, const N: usize> Clone for OldestOrdered<'a, T, N>where - T: Clone,

source§

fn clone(&self) -> OldestOrdered<'a, T, N>

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, T, const N: usize> Iterator for OldestOrdered<'a, T, N>

§

type Item = &'a T

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<&'a T>

Advances the iterator and returns the next value. Read more
§

fn next_chunk<const N: usize>( - &mut self -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where - Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
1.0.0§

fn count(self) -> usizewhere - Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0§

fn last(self) -> Option<Self::Item>where - Self: Sized,

Consumes the iterator, returning the last element. Read more
§

fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0§

fn step_by(self, step: usize) -> StepBy<Self>where - Self: Sized,

Creates an iterator starting at the same point, but stepping by -the given amount at each iteration. Read more
1.0.0§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where - Self: Sized, - U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where - Self: Sized, - U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>where - Self: Sized, - G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator -between adjacent items of the original iterator. Read more
1.0.0§

fn map<B, F>(self, f: F) -> Map<Self, F>where - Self: Sized, - F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each -element. Read more
1.21.0§

fn for_each<F>(self, f: F)where - Self: Sized, - F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0§

fn filter<P>(self, predicate: P) -> Filter<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element -should be yielded. Read more
1.0.0§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>where - Self: Sized, - F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0§

fn enumerate(self) -> Enumerate<Self>where - Self: Sized,

Creates an iterator which gives the current iteration count as well as -the next value. Read more
1.0.0§

fn peekable(self) -> Peekable<Self>where - Self: Sized,

Creates an iterator which can use the peek and peek_mut methods -to look at the next element of the iterator without consuming it. See -their documentation for more information. Read more
1.0.0§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where - Self: Sized, - P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0§

fn skip(self, n: usize) -> Skip<Self>where - Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0§

fn take(self, n: usize) -> Take<Self>where - Self: Sized,

Creates an iterator that yields the first n elements, or fewer -if the underlying iterator ends sooner. Read more
1.0.0§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>where - Self: Sized, - F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but -unlike fold, produces a new iterator. Read more
1.0.0§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where - Self: Sized, - U: IntoIterator, - F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
§

fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>where - Self: Sized, - F: FnMut(&[Self::Item; N]) -> R,

🔬This is a nightly-only experimental API. (iter_map_windows)
Calls the given function f for each contiguous window of size N over -self and returns an iterator over the outputs of f. Like slice::windows(), -the windows during mapping overlap as well. Read more
1.0.0§

fn fuse(self) -> Fuse<Self>where - Self: Sized,

Creates an iterator which ends after the first [None]. Read more
1.0.0§

fn inspect<F>(self, f: F) -> Inspect<Self, F>where - Self: Sized, - F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0§

fn by_ref(&mut self) -> &mut Selfwhere - Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0§

fn collect<B>(self) -> Bwhere - B: FromIterator<Self::Item>, - Self: Sized,

Transforms an iterator into a collection. Read more
§

fn collect_into<E>(self, collection: &mut E) -> &mut Ewhere - E: Extend<Self::Item>, - Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0§

fn partition<B, F>(self, f: F) -> (B, B)where - Self: Sized, - B: Default + Extend<Self::Item>, - F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
§

fn is_partitioned<P>(self, predicate: P) -> boolwhere - Self: Sized, - P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate, -such that all those that return true precede all those that return false. Read more
1.27.0§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere - Self: Sized, - F: FnMut(B, Self::Item) -> R, - R: Try<Output = B>,

An iterator method that applies a function as long as it returns -successfully, producing a single, final value. Read more
1.27.0§

fn try_for_each<F, R>(&mut self, f: F) -> Rwhere - Self: Sized, - F: FnMut(Self::Item) -> R, - R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the -iterator, stopping at the first error and returning that error. Read more
1.0.0§

fn fold<B, F>(self, init: B, f: F) -> Bwhere - Self: Sized, - F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation, -returning the final result. Read more
1.51.0§

fn reduce<F>(self, f: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing -operation. Read more
§

fn try_reduce<F, R>( - &mut self, - f: F -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> R, - R: Try<Output = Self::Item>, - <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the -closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0§

fn all<F>(&mut self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0§

fn any<F>(&mut self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0§

fn find_map<B, F>(&mut self, f: F) -> Option<B>where - Self: Sized, - F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns -the first non-none result. Read more
§

fn try_find<F, R>( - &mut self, - f: F -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere - Self: Sized, - F: FnMut(&Self::Item) -> R, - R: Try<Output = bool>, - <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns -the first true result or the first error. Read more
1.0.0§

fn position<P>(&mut self, predicate: P) -> Option<usize>where - Self: Sized, - P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.6.0§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>where - B: Ord, - Self: Sized, - F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the -specified function. Read more
1.15.0§

fn max_by<F>(self, compare: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the -specified comparison function. Read more
1.6.0§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>where - B: Ord, - Self: Sized, - F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the -specified function. Read more
1.15.0§

fn min_by<F>(self, compare: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the -specified comparison function. Read more
1.0.0§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where - FromA: Default + Extend<A>, - FromB: Default + Extend<B>, - Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0§

fn copied<'a, T>(self) -> Copied<Self>where - T: 'a + Copy, - Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0§

fn cloned<'a, T>(self) -> Cloned<Self>where - T: 'a + Clone, - Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where - Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0§

fn sum<S>(self) -> Swhere - Self: Sized, - S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0§

fn product<P>(self) -> Pwhere - Self: Sized, - P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this [Iterator] with those -of another with respect to the specified comparison function. Read more
1.5.0§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>where - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Lexicographically compares the [PartialOrd] elements of -this [Iterator] with those of another. The comparison works like short-circuit -evaluation, returning a result without comparing the remaining elements. -As soon as an order can be determined, the evaluation stops and a result is returned. Read more
§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this [Iterator] with those -of another with respect to the specified comparison function. Read more
1.5.0§

fn eq<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialEq<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are equal to those of -another. Read more
§

fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this [Iterator] are equal to those of -another with respect to the specified equality function. Read more
1.5.0§

fn ne<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialEq<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are not equal to those of -another. Read more
1.5.0§

fn lt<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are lexicographically -less than those of another. Read more
1.5.0§

fn le<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are lexicographically -less or equal to those of another. Read more
1.5.0§

fn gt<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are lexicographically -greater than those of another. Read more
1.5.0§

fn ge<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are lexicographically -greater than or equal to those of another. Read more
§

fn is_sorted_by<F>(self, compare: F) -> boolwhere - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
§

fn is_sorted_by_key<F, K>(self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> K, - K: PartialOrd<K>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction -function. Read more

Auto Trait Implementations§

§

impl<'a, T, const N: usize> RefUnwindSafe for OldestOrdered<'a, T, N>where - T: RefUnwindSafe,

§

impl<'a, T, const N: usize> Send for OldestOrdered<'a, T, N>where - T: Sync,

§

impl<'a, T, const N: usize> Sync for OldestOrdered<'a, T, N>where - T: Sync,

§

impl<'a, T, const N: usize> Unpin for OldestOrdered<'a, T, N>

§

impl<'a, T, const N: usize> UnwindSafe for OldestOrdered<'a, T, N>where - T: RefUnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<I> IntoIterator for Iwhere - I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/struct.String.html b/docs/doc/arduboy_rust/heapless/struct.String.html deleted file mode 100644 index c378d1b..0000000 --- a/docs/doc/arduboy_rust/heapless/struct.String.html +++ /dev/null @@ -1,1376 +0,0 @@ -String in arduboy_rust::heapless - Rust
pub struct String<const N: usize> { /* private fields */ }
Expand description

A fixed capacity String

-

Implementations§

source§

impl<const N: usize> String<N>

source

pub const fn new() -> String<N>

Constructs a new, empty String with a fixed capacity of N bytes

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-// allocate the string on the stack
-let mut s: String<4> = String::new();
-
-// allocate the string in a static variable
-static mut S: String<4> = String::new();
-
source

pub fn into_bytes(self) -> Vec<u8, N>

Converts a String into a byte vector.

-

This consumes the String, so we do not need to copy its contents.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let s: String<4> = String::from("ab");
-let b = s.into_bytes();
-assert!(b.len() == 2);
-
-assert_eq!(&['a' as u8, 'b' as u8], &b[..]);
-
source

pub fn as_str(&self) -> &str

Extracts a string slice containing the entire string.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<4> = String::from("ab");
-assert!(s.as_str() == "ab");
-
-let _s = s.as_str();
-// s.push('c'); // <- cannot borrow `s` as mutable because it is also borrowed as immutable
-
source

pub fn as_mut_str(&mut self) -> &mut str

Converts a String into a mutable string slice.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<4> = String::from("ab");
-let s = s.as_mut_str();
-s.make_ascii_uppercase();
-
source

pub unsafe fn as_mut_vec(&mut self) -> &mut Vec<u8, N>

Returns a mutable reference to the contents of this String.

-
Safety
-

This function is unsafe because it does not check that the bytes passed -to it are valid UTF-8. If this constraint is violated, it may cause -memory unsafety issues with future users of the String, as the rest of -the library assumes that Strings are valid UTF-8.

-
Examples
-

Basic usage:

- -
let mut s = String::from("hello");
-
-unsafe {
-    let vec = s.as_mut_vec();
-    assert_eq!(&[104, 101, 108, 108, 111][..], &vec[..]);
-
-    vec.reverse();
-}
-assert_eq!(s, "olleh");
-
source

pub fn push_str(&mut self, string: &str) -> Result<(), ()>

Appends a given string slice onto the end of this String.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<8> = String::from("foo");
-
-assert!(s.push_str("bar").is_ok());
-
-assert_eq!("foobar", s);
-
-assert!(s.push_str("tender").is_err());
-
source

pub fn capacity(&self) -> usize

Returns the maximum number of elements the String can hold

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<4> = String::new();
-assert!(s.capacity() == 4);
-
source

pub fn push(&mut self, c: char) -> Result<(), ()>

Appends the given char to the end of this String.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<8> = String::from("abc");
-
-s.push('1').unwrap();
-s.push('2').unwrap();
-s.push('3').unwrap();
-
-assert!("abc123" == s.as_str());
-
-assert_eq!("abc123", s);
-
source

pub fn truncate(&mut self, new_len: usize)

Shortens this String to the specified length.

-

If new_len is greater than the string’s current length, this has no -effect.

-

Note that this method has no effect on the allocated capacity -of the string

-
Panics
-

Panics if new_len does not lie on a char boundary.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<8> = String::from("hello");
-
-s.truncate(2);
-
-assert_eq!("he", s);
-
source

pub fn pop(&mut self) -> Option<char>

Removes the last character from the string buffer and returns it.

-

Returns None if this String is empty.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<8> = String::from("foo");
-
-assert_eq!(s.pop(), Some('o'));
-assert_eq!(s.pop(), Some('o'));
-assert_eq!(s.pop(), Some('f'));
-
-assert_eq!(s.pop(), None);
-
source

pub fn clear(&mut self)

Truncates this String, removing all contents.

-

While this means the String will have a length of zero, it does not -touch its capacity.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<8> = String::from("foo");
-
-s.clear();
-
-assert!(s.is_empty());
-assert_eq!(0, s.len());
-assert_eq!(8, s.capacity());
-

Methods from Deref<Target = str>§

1.0.0

pub fn len(&self) -> usize

Returns the length of self.

-

This length is in bytes, not chars or graphemes. In other words, -it might not be what a human considers the length of the string.

-
Examples
-
let len = "foo".len();
-assert_eq!(3, len);
-
-assert_eq!("ƒoo".len(), 4); // fancy f!
-assert_eq!("ƒoo".chars().count(), 3);
-
1.0.0

pub fn is_empty(&self) -> bool

Returns true if self has a length of zero bytes.

-
Examples
-
let s = "";
-assert!(s.is_empty());
-
-let s = "not empty";
-assert!(!s.is_empty());
-
1.9.0

pub fn is_char_boundary(&self, index: usize) -> bool

Checks that index-th byte is the first byte in a UTF-8 code point -sequence or the end of the string.

-

The start and end of the string (when index == self.len()) are -considered to be boundaries.

-

Returns false if index is greater than self.len().

-
Examples
-
let s = "Löwe 老虎 Léopard";
-assert!(s.is_char_boundary(0));
-// start of `老`
-assert!(s.is_char_boundary(6));
-assert!(s.is_char_boundary(s.len()));
-
-// second byte of `ö`
-assert!(!s.is_char_boundary(2));
-
-// third byte of `老`
-assert!(!s.is_char_boundary(8));
-

pub fn floor_char_boundary(&self, index: usize) -> usize

🔬This is a nightly-only experimental API. (round_char_boundary)

Finds the closest x not exceeding index where is_char_boundary(x) is true.

-

This method can help you truncate a string so that it’s still valid UTF-8, but doesn’t -exceed a given number of bytes. Note that this is done purely at the character level -and can still visually split graphemes, even though the underlying characters aren’t -split. For example, the emoji 🧑‍🔬 (scientist) could be split so that the string only -includes 🧑 (person) instead.

-
Examples
-
#![feature(round_char_boundary)]
-let s = "❤️🧡💛💚💙💜";
-assert_eq!(s.len(), 26);
-assert!(!s.is_char_boundary(13));
-
-let closest = s.floor_char_boundary(13);
-assert_eq!(closest, 10);
-assert_eq!(&s[..closest], "❤️🧡");
-

pub fn ceil_char_boundary(&self, index: usize) -> usize

🔬This is a nightly-only experimental API. (round_char_boundary)

Finds the closest x not below index where is_char_boundary(x) is true.

-

If index is greater than the length of the string, this returns the length of the string.

-

This method is the natural complement to floor_char_boundary. See that method -for more details.

-
Examples
-
#![feature(round_char_boundary)]
-let s = "❤️🧡💛💚💙💜";
-assert_eq!(s.len(), 26);
-assert!(!s.is_char_boundary(13));
-
-let closest = s.ceil_char_boundary(13);
-assert_eq!(closest, 14);
-assert_eq!(&s[..closest], "❤️🧡💛");
-
1.0.0

pub fn as_bytes(&self) -> &[u8]

Converts a string slice to a byte slice. To convert the byte slice back -into a string slice, use the [from_utf8] function.

-
Examples
-
let bytes = "bors".as_bytes();
-assert_eq!(b"bors", bytes);
-
1.20.0

pub unsafe fn as_bytes_mut(&mut self) -> &mut [u8]

Converts a mutable string slice to a mutable byte slice.

-
Safety
-

The caller must ensure that the content of the slice is valid UTF-8 -before the borrow ends and the underlying str is used.

-

Use of a str whose contents are not valid UTF-8 is undefined behavior.

-
Examples
-

Basic usage:

- -
let mut s = String::from("Hello");
-let bytes = unsafe { s.as_bytes_mut() };
-
-assert_eq!(b"Hello", bytes);
-

Mutability:

- -
let mut s = String::from("🗻∈🌏");
-
-unsafe {
-    let bytes = s.as_bytes_mut();
-
-    bytes[0] = 0xF0;
-    bytes[1] = 0x9F;
-    bytes[2] = 0x8D;
-    bytes[3] = 0x94;
-}
-
-assert_eq!("🍔∈🌏", s);
-
1.0.0

pub fn as_ptr(&self) -> *const u8

Converts a string slice to a raw pointer.

-

As string slices are a slice of bytes, the raw pointer points to a -[u8]. This pointer will be pointing to the first byte of the string -slice.

-

The caller must ensure that the returned pointer is never written to. -If you need to mutate the contents of the string slice, use as_mut_ptr.

-
Examples
-
let s = "Hello";
-let ptr = s.as_ptr();
-
1.36.0

pub fn as_mut_ptr(&mut self) -> *mut u8

Converts a mutable string slice to a raw pointer.

-

As string slices are a slice of bytes, the raw pointer points to a -[u8]. This pointer will be pointing to the first byte of the string -slice.

-

It is your responsibility to make sure that the string slice only gets -modified in a way that it remains valid UTF-8.

-
1.20.0

pub fn get<I>(&self, i: I) -> Option<&<I as SliceIndex<str>>::Output>where - I: SliceIndex<str>,

Returns a subslice of str.

-

This is the non-panicking alternative to indexing the str. Returns -[None] whenever equivalent indexing operation would panic.

-
Examples
-
let v = String::from("🗻∈🌏");
-
-assert_eq!(Some("🗻"), v.get(0..4));
-
-// indices not on UTF-8 sequence boundaries
-assert!(v.get(1..).is_none());
-assert!(v.get(..8).is_none());
-
-// out of bounds
-assert!(v.get(..42).is_none());
-
1.20.0

pub fn get_mut<I>( - &mut self, - i: I -) -> Option<&mut <I as SliceIndex<str>>::Output>where - I: SliceIndex<str>,

Returns a mutable subslice of str.

-

This is the non-panicking alternative to indexing the str. Returns -[None] whenever equivalent indexing operation would panic.

-
Examples
-
let mut v = String::from("hello");
-// correct length
-assert!(v.get_mut(0..5).is_some());
-// out of bounds
-assert!(v.get_mut(..42).is_none());
-assert_eq!(Some("he"), v.get_mut(0..2).map(|v| &*v));
-
-assert_eq!("hello", v);
-{
-    let s = v.get_mut(0..2);
-    let s = s.map(|s| {
-        s.make_ascii_uppercase();
-        &*s
-    });
-    assert_eq!(Some("HE"), s);
-}
-assert_eq!("HEllo", v);
-
1.20.0

pub unsafe fn get_unchecked<I>(&self, i: I) -> &<I as SliceIndex<str>>::Outputwhere - I: SliceIndex<str>,

Returns an unchecked subslice of str.

-

This is the unchecked alternative to indexing the str.

-
Safety
-

Callers of this function are responsible that these preconditions are -satisfied:

-
    -
  • The starting index must not exceed the ending index;
  • -
  • Indexes must be within bounds of the original slice;
  • -
  • Indexes must lie on UTF-8 sequence boundaries.
  • -
-

Failing that, the returned string slice may reference invalid memory or -violate the invariants communicated by the str type.

-
Examples
-
let v = "🗻∈🌏";
-unsafe {
-    assert_eq!("🗻", v.get_unchecked(0..4));
-    assert_eq!("∈", v.get_unchecked(4..7));
-    assert_eq!("🌏", v.get_unchecked(7..11));
-}
-
1.20.0

pub unsafe fn get_unchecked_mut<I>( - &mut self, - i: I -) -> &mut <I as SliceIndex<str>>::Outputwhere - I: SliceIndex<str>,

Returns a mutable, unchecked subslice of str.

-

This is the unchecked alternative to indexing the str.

-
Safety
-

Callers of this function are responsible that these preconditions are -satisfied:

-
    -
  • The starting index must not exceed the ending index;
  • -
  • Indexes must be within bounds of the original slice;
  • -
  • Indexes must lie on UTF-8 sequence boundaries.
  • -
-

Failing that, the returned string slice may reference invalid memory or -violate the invariants communicated by the str type.

-
Examples
-
let mut v = String::from("🗻∈🌏");
-unsafe {
-    assert_eq!("🗻", v.get_unchecked_mut(0..4));
-    assert_eq!("∈", v.get_unchecked_mut(4..7));
-    assert_eq!("🌏", v.get_unchecked_mut(7..11));
-}
-
1.0.0

pub unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &str

👎Deprecated since 1.29.0: use get_unchecked(begin..end) instead

Creates a string slice from another string slice, bypassing safety -checks.

-

This is generally not recommended, use with caution! For a safe -alternative see [str] and Index.

-

This new slice goes from begin to end, including begin but -excluding end.

-

To get a mutable string slice instead, see the -slice_mut_unchecked method.

-
Safety
-

Callers of this function are responsible that three preconditions are -satisfied:

-
    -
  • begin must not exceed end.
  • -
  • begin and end must be byte positions within the string slice.
  • -
  • begin and end must lie on UTF-8 sequence boundaries.
  • -
-
Examples
-
let s = "Löwe 老虎 Léopard";
-
-unsafe {
-    assert_eq!("Löwe 老虎 Léopard", s.slice_unchecked(0, 21));
-}
-
-let s = "Hello, world!";
-
-unsafe {
-    assert_eq!("world", s.slice_unchecked(7, 12));
-}
-
1.5.0

pub unsafe fn slice_mut_unchecked( - &mut self, - begin: usize, - end: usize -) -> &mut str

👎Deprecated since 1.29.0: use get_unchecked_mut(begin..end) instead

Creates a string slice from another string slice, bypassing safety -checks. -This is generally not recommended, use with caution! For a safe -alternative see [str] and IndexMut.

-

This new slice goes from begin to end, including begin but -excluding end.

-

To get an immutable string slice instead, see the -slice_unchecked method.

-
Safety
-

Callers of this function are responsible that three preconditions are -satisfied:

-
    -
  • begin must not exceed end.
  • -
  • begin and end must be byte positions within the string slice.
  • -
  • begin and end must lie on UTF-8 sequence boundaries.
  • -
-
1.4.0

pub fn split_at(&self, mid: usize) -> (&str, &str)

Divide one string slice into two at an index.

-

The argument, mid, should be a byte offset from the start of the -string. It must also be on the boundary of a UTF-8 code point.

-

The two slices returned go from the start of the string slice to mid, -and from mid to the end of the string slice.

-

To get mutable string slices instead, see the split_at_mut -method.

-
Panics
-

Panics if mid is not on a UTF-8 code point boundary, or if it is -past the end of the last code point of the string slice.

-
Examples
-
let s = "Per Martin-Löf";
-
-let (first, last) = s.split_at(3);
-
-assert_eq!("Per", first);
-assert_eq!(" Martin-Löf", last);
-
1.4.0

pub fn split_at_mut(&mut self, mid: usize) -> (&mut str, &mut str)

Divide one mutable string slice into two at an index.

-

The argument, mid, should be a byte offset from the start of the -string. It must also be on the boundary of a UTF-8 code point.

-

The two slices returned go from the start of the string slice to mid, -and from mid to the end of the string slice.

-

To get immutable string slices instead, see the split_at method.

-
Panics
-

Panics if mid is not on a UTF-8 code point boundary, or if it is -past the end of the last code point of the string slice.

-
Examples
-
let mut s = "Per Martin-Löf".to_string();
-{
-    let (first, last) = s.split_at_mut(3);
-    first.make_ascii_uppercase();
-    assert_eq!("PER", first);
-    assert_eq!(" Martin-Löf", last);
-}
-assert_eq!("PER Martin-Löf", s);
-
1.0.0

pub fn chars(&self) -> Chars<'_>

Returns an iterator over the chars of a string slice.

-

As a string slice consists of valid UTF-8, we can iterate through a -string slice by char. This method returns such an iterator.

-

It’s important to remember that char represents a Unicode Scalar -Value, and might not match your idea of what a ‘character’ is. Iteration -over grapheme clusters may be what you actually want. This functionality -is not provided by Rust’s standard library, check crates.io instead.

-
Examples
-

Basic usage:

- -
let word = "goodbye";
-
-let count = word.chars().count();
-assert_eq!(7, count);
-
-let mut chars = word.chars();
-
-assert_eq!(Some('g'), chars.next());
-assert_eq!(Some('o'), chars.next());
-assert_eq!(Some('o'), chars.next());
-assert_eq!(Some('d'), chars.next());
-assert_eq!(Some('b'), chars.next());
-assert_eq!(Some('y'), chars.next());
-assert_eq!(Some('e'), chars.next());
-
-assert_eq!(None, chars.next());
-

Remember, chars might not match your intuition about characters:

- -
let y = "y̆";
-
-let mut chars = y.chars();
-
-assert_eq!(Some('y'), chars.next()); // not 'y̆'
-assert_eq!(Some('\u{0306}'), chars.next());
-
-assert_eq!(None, chars.next());
-
1.0.0

pub fn char_indices(&self) -> CharIndices<'_>

Returns an iterator over the chars of a string slice, and their -positions.

-

As a string slice consists of valid UTF-8, we can iterate through a -string slice by char. This method returns an iterator of both -these chars, as well as their byte positions.

-

The iterator yields tuples. The position is first, the char is -second.

-
Examples
-

Basic usage:

- -
let word = "goodbye";
-
-let count = word.char_indices().count();
-assert_eq!(7, count);
-
-let mut char_indices = word.char_indices();
-
-assert_eq!(Some((0, 'g')), char_indices.next());
-assert_eq!(Some((1, 'o')), char_indices.next());
-assert_eq!(Some((2, 'o')), char_indices.next());
-assert_eq!(Some((3, 'd')), char_indices.next());
-assert_eq!(Some((4, 'b')), char_indices.next());
-assert_eq!(Some((5, 'y')), char_indices.next());
-assert_eq!(Some((6, 'e')), char_indices.next());
-
-assert_eq!(None, char_indices.next());
-

Remember, chars might not match your intuition about characters:

- -
let yes = "y̆es";
-
-let mut char_indices = yes.char_indices();
-
-assert_eq!(Some((0, 'y')), char_indices.next()); // not (0, 'y̆')
-assert_eq!(Some((1, '\u{0306}')), char_indices.next());
-
-// note the 3 here - the last character took up two bytes
-assert_eq!(Some((3, 'e')), char_indices.next());
-assert_eq!(Some((4, 's')), char_indices.next());
-
-assert_eq!(None, char_indices.next());
-
1.0.0

pub fn bytes(&self) -> Bytes<'_>

An iterator over the bytes of a string slice.

-

As a string slice consists of a sequence of bytes, we can iterate -through a string slice by byte. This method returns such an iterator.

-
Examples
-
let mut bytes = "bors".bytes();
-
-assert_eq!(Some(b'b'), bytes.next());
-assert_eq!(Some(b'o'), bytes.next());
-assert_eq!(Some(b'r'), bytes.next());
-assert_eq!(Some(b's'), bytes.next());
-
-assert_eq!(None, bytes.next());
-
1.1.0

pub fn split_whitespace(&self) -> SplitWhitespace<'_>

Splits a string slice by whitespace.

-

The iterator returned will return string slices that are sub-slices of -the original string slice, separated by any amount of whitespace.

-

‘Whitespace’ is defined according to the terms of the Unicode Derived -Core Property White_Space. If you only want to split on ASCII whitespace -instead, use split_ascii_whitespace.

-
Examples
-

Basic usage:

- -
let mut iter = "A few words".split_whitespace();
-
-assert_eq!(Some("A"), iter.next());
-assert_eq!(Some("few"), iter.next());
-assert_eq!(Some("words"), iter.next());
-
-assert_eq!(None, iter.next());
-

All kinds of whitespace are considered:

- -
let mut iter = " Mary   had\ta\u{2009}little  \n\t lamb".split_whitespace();
-assert_eq!(Some("Mary"), iter.next());
-assert_eq!(Some("had"), iter.next());
-assert_eq!(Some("a"), iter.next());
-assert_eq!(Some("little"), iter.next());
-assert_eq!(Some("lamb"), iter.next());
-
-assert_eq!(None, iter.next());
-

If the string is empty or all whitespace, the iterator yields no string slices:

- -
assert_eq!("".split_whitespace().next(), None);
-assert_eq!("   ".split_whitespace().next(), None);
-
1.34.0

pub fn split_ascii_whitespace(&self) -> SplitAsciiWhitespace<'_>

Splits a string slice by ASCII whitespace.

-

The iterator returned will return string slices that are sub-slices of -the original string slice, separated by any amount of ASCII whitespace.

-

To split by Unicode Whitespace instead, use split_whitespace.

-
Examples
-

Basic usage:

- -
let mut iter = "A few words".split_ascii_whitespace();
-
-assert_eq!(Some("A"), iter.next());
-assert_eq!(Some("few"), iter.next());
-assert_eq!(Some("words"), iter.next());
-
-assert_eq!(None, iter.next());
-

All kinds of ASCII whitespace are considered:

- -
let mut iter = " Mary   had\ta little  \n\t lamb".split_ascii_whitespace();
-assert_eq!(Some("Mary"), iter.next());
-assert_eq!(Some("had"), iter.next());
-assert_eq!(Some("a"), iter.next());
-assert_eq!(Some("little"), iter.next());
-assert_eq!(Some("lamb"), iter.next());
-
-assert_eq!(None, iter.next());
-

If the string is empty or all ASCII whitespace, the iterator yields no string slices:

- -
assert_eq!("".split_ascii_whitespace().next(), None);
-assert_eq!("   ".split_ascii_whitespace().next(), None);
-
1.0.0

pub fn lines(&self) -> Lines<'_>

An iterator over the lines of a string, as string slices.

-

Lines are split at line endings that are either newlines (\n) or -sequences of a carriage return followed by a line feed (\r\n).

-

Line terminators are not included in the lines returned by the iterator.

-

Note that any carriage return (\r) not immediately followed by a -line feed (\n) does not split a line. These carriage returns are -thereby included in the produced lines.

-

The final line ending is optional. A string that ends with a final line -ending will return the same lines as an otherwise identical string -without a final line ending.

-
Examples
-

Basic usage:

- -
let text = "foo\r\nbar\n\nbaz\r";
-let mut lines = text.lines();
-
-assert_eq!(Some("foo"), lines.next());
-assert_eq!(Some("bar"), lines.next());
-assert_eq!(Some(""), lines.next());
-// Trailing carriage return is included in the last line
-assert_eq!(Some("baz\r"), lines.next());
-
-assert_eq!(None, lines.next());
-

The final line does not require any ending:

- -
let text = "foo\nbar\n\r\nbaz";
-let mut lines = text.lines();
-
-assert_eq!(Some("foo"), lines.next());
-assert_eq!(Some("bar"), lines.next());
-assert_eq!(Some(""), lines.next());
-assert_eq!(Some("baz"), lines.next());
-
-assert_eq!(None, lines.next());
-
1.0.0

pub fn lines_any(&self) -> LinesAny<'_>

👎Deprecated since 1.4.0: use lines() instead now

An iterator over the lines of a string.

-
1.8.0

pub fn encode_utf16(&self) -> EncodeUtf16<'_>

Returns an iterator of u16 over the string encoded as UTF-16.

-
Examples
-
let text = "Zażółć gęślą jaźń";
-
-let utf8_len = text.len();
-let utf16_len = text.encode_utf16().count();
-
-assert!(utf16_len <= utf8_len);
-
1.0.0

pub fn contains<'a, P>(&'a self, pat: P) -> boolwhere - P: Pattern<'a>,

Returns true if the given pattern matches a sub-slice of -this string slice.

-

Returns false if it does not.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-
let bananas = "bananas";
-
-assert!(bananas.contains("nana"));
-assert!(!bananas.contains("apples"));
-
1.0.0

pub fn starts_with<'a, P>(&'a self, pat: P) -> boolwhere - P: Pattern<'a>,

Returns true if the given pattern matches a prefix of this -string slice.

-

Returns false if it does not.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-
let bananas = "bananas";
-
-assert!(bananas.starts_with("bana"));
-assert!(!bananas.starts_with("nana"));
-
1.0.0

pub fn ends_with<'a, P>(&'a self, pat: P) -> boolwhere - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns true if the given pattern matches a suffix of this -string slice.

-

Returns false if it does not.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-
let bananas = "bananas";
-
-assert!(bananas.ends_with("anas"));
-assert!(!bananas.ends_with("nana"));
-
1.0.0

pub fn find<'a, P>(&'a self, pat: P) -> Option<usize>where - P: Pattern<'a>,

Returns the byte index of the first character of this string slice that -matches the pattern.

-

Returns [None] if the pattern doesn’t match.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-

Simple patterns:

- -
let s = "Löwe 老虎 Léopard Gepardi";
-
-assert_eq!(s.find('L'), Some(0));
-assert_eq!(s.find('é'), Some(14));
-assert_eq!(s.find("pard"), Some(17));
-

More complex patterns using point-free style and closures:

- -
let s = "Löwe 老虎 Léopard";
-
-assert_eq!(s.find(char::is_whitespace), Some(5));
-assert_eq!(s.find(char::is_lowercase), Some(1));
-assert_eq!(s.find(|c: char| c.is_whitespace() || c.is_lowercase()), Some(1));
-assert_eq!(s.find(|c: char| (c < 'o') && (c > 'a')), Some(4));
-

Not finding the pattern:

- -
let s = "Löwe 老虎 Léopard";
-let x: &[_] = &['1', '2'];
-
-assert_eq!(s.find(x), None);
-
1.0.0

pub fn rfind<'a, P>(&'a self, pat: P) -> Option<usize>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns the byte index for the first character of the last match of the pattern in -this string slice.

-

Returns [None] if the pattern doesn’t match.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-

Simple patterns:

- -
let s = "Löwe 老虎 Léopard Gepardi";
-
-assert_eq!(s.rfind('L'), Some(13));
-assert_eq!(s.rfind('é'), Some(14));
-assert_eq!(s.rfind("pard"), Some(24));
-

More complex patterns with closures:

- -
let s = "Löwe 老虎 Léopard";
-
-assert_eq!(s.rfind(char::is_whitespace), Some(12));
-assert_eq!(s.rfind(char::is_lowercase), Some(20));
-

Not finding the pattern:

- -
let s = "Löwe 老虎 Léopard";
-let x: &[_] = &['1', '2'];
-
-assert_eq!(s.rfind(x), None);
-
1.0.0

pub fn split<'a, P>(&'a self, pat: P) -> Split<'a, P>where - P: Pattern<'a>,

An iterator over substrings of this string slice, separated by -characters matched by a pattern.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator will be a [DoubleEndedIterator] if the pattern -allows a reverse search and forward/reverse search yields the same -elements. This is true for, e.g., char, but not for &str.

-

If the pattern allows a reverse search but its results might differ -from a forward search, the rsplit method can be used.

-
Examples
-

Simple patterns:

- -
let v: Vec<&str> = "Mary had a little lamb".split(' ').collect();
-assert_eq!(v, ["Mary", "had", "a", "little", "lamb"]);
-
-let v: Vec<&str> = "".split('X').collect();
-assert_eq!(v, [""]);
-
-let v: Vec<&str> = "lionXXtigerXleopard".split('X').collect();
-assert_eq!(v, ["lion", "", "tiger", "leopard"]);
-
-let v: Vec<&str> = "lion::tiger::leopard".split("::").collect();
-assert_eq!(v, ["lion", "tiger", "leopard"]);
-
-let v: Vec<&str> = "abc1def2ghi".split(char::is_numeric).collect();
-assert_eq!(v, ["abc", "def", "ghi"]);
-
-let v: Vec<&str> = "lionXtigerXleopard".split(char::is_uppercase).collect();
-assert_eq!(v, ["lion", "tiger", "leopard"]);
-

If the pattern is a slice of chars, split on each occurrence of any of the characters:

- -
let v: Vec<&str> = "2020-11-03 23:59".split(&['-', ' ', ':', '@'][..]).collect();
-assert_eq!(v, ["2020", "11", "03", "23", "59"]);
-

A more complex pattern, using a closure:

- -
let v: Vec<&str> = "abc1defXghi".split(|c| c == '1' || c == 'X').collect();
-assert_eq!(v, ["abc", "def", "ghi"]);
-

If a string contains multiple contiguous separators, you will end up -with empty strings in the output:

- -
let x = "||||a||b|c".to_string();
-let d: Vec<_> = x.split('|').collect();
-
-assert_eq!(d, &["", "", "", "", "a", "", "b", "c"]);
-

Contiguous separators are separated by the empty string.

- -
let x = "(///)".to_string();
-let d: Vec<_> = x.split('/').collect();
-
-assert_eq!(d, &["(", "", "", ")"]);
-

Separators at the start or end of a string are neighbored -by empty strings.

- -
let d: Vec<_> = "010".split("0").collect();
-assert_eq!(d, &["", "1", ""]);
-

When the empty string is used as a separator, it separates -every character in the string, along with the beginning -and end of the string.

- -
let f: Vec<_> = "rust".split("").collect();
-assert_eq!(f, &["", "r", "u", "s", "t", ""]);
-

Contiguous separators can lead to possibly surprising behavior -when whitespace is used as the separator. This code is correct:

- -
let x = "    a  b c".to_string();
-let d: Vec<_> = x.split(' ').collect();
-
-assert_eq!(d, &["", "", "", "", "a", "", "b", "c"]);
-

It does not give you:

- -
assert_eq!(d, &["a", "b", "c"]);
-

Use split_whitespace for this behavior.

-
1.51.0

pub fn split_inclusive<'a, P>(&'a self, pat: P) -> SplitInclusive<'a, P>where - P: Pattern<'a>,

An iterator over substrings of this string slice, separated by -characters matched by a pattern. Differs from the iterator produced by -split in that split_inclusive leaves the matched part as the -terminator of the substring.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-
let v: Vec<&str> = "Mary had a little lamb\nlittle lamb\nlittle lamb."
-    .split_inclusive('\n').collect();
-assert_eq!(v, ["Mary had a little lamb\n", "little lamb\n", "little lamb."]);
-

If the last element of the string is matched, -that element will be considered the terminator of the preceding substring. -That substring will be the last item returned by the iterator.

- -
let v: Vec<&str> = "Mary had a little lamb\nlittle lamb\nlittle lamb.\n"
-    .split_inclusive('\n').collect();
-assert_eq!(v, ["Mary had a little lamb\n", "little lamb\n", "little lamb.\n"]);
-
1.0.0

pub fn rsplit<'a, P>(&'a self, pat: P) -> RSplit<'a, P>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over substrings of the given string slice, separated by -characters matched by a pattern and yielded in reverse order.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator requires that the pattern supports a reverse -search, and it will be a [DoubleEndedIterator] if a forward/reverse -search yields the same elements.

-

For iterating from the front, the split method can be used.

-
Examples
-

Simple patterns:

- -
let v: Vec<&str> = "Mary had a little lamb".rsplit(' ').collect();
-assert_eq!(v, ["lamb", "little", "a", "had", "Mary"]);
-
-let v: Vec<&str> = "".rsplit('X').collect();
-assert_eq!(v, [""]);
-
-let v: Vec<&str> = "lionXXtigerXleopard".rsplit('X').collect();
-assert_eq!(v, ["leopard", "tiger", "", "lion"]);
-
-let v: Vec<&str> = "lion::tiger::leopard".rsplit("::").collect();
-assert_eq!(v, ["leopard", "tiger", "lion"]);
-

A more complex pattern, using a closure:

- -
let v: Vec<&str> = "abc1defXghi".rsplit(|c| c == '1' || c == 'X').collect();
-assert_eq!(v, ["ghi", "def", "abc"]);
-
1.0.0

pub fn split_terminator<'a, P>(&'a self, pat: P) -> SplitTerminator<'a, P>where - P: Pattern<'a>,

An iterator over substrings of the given string slice, separated by -characters matched by a pattern.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-

Equivalent to split, except that the trailing substring -is skipped if empty.

-

This method can be used for string data that is terminated, -rather than separated by a pattern.

-
Iterator behavior
-

The returned iterator will be a [DoubleEndedIterator] if the pattern -allows a reverse search and forward/reverse search yields the same -elements. This is true for, e.g., char, but not for &str.

-

If the pattern allows a reverse search but its results might differ -from a forward search, the rsplit_terminator method can be used.

-
Examples
-
let v: Vec<&str> = "A.B.".split_terminator('.').collect();
-assert_eq!(v, ["A", "B"]);
-
-let v: Vec<&str> = "A..B..".split_terminator(".").collect();
-assert_eq!(v, ["A", "", "B", ""]);
-
-let v: Vec<&str> = "A.B:C.D".split_terminator(&['.', ':'][..]).collect();
-assert_eq!(v, ["A", "B", "C", "D"]);
-
1.0.0

pub fn rsplit_terminator<'a, P>(&'a self, pat: P) -> RSplitTerminator<'a, P>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over substrings of self, separated by characters -matched by a pattern and yielded in reverse order.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-

Equivalent to split, except that the trailing substring is -skipped if empty.

-

This method can be used for string data that is terminated, -rather than separated by a pattern.

-
Iterator behavior
-

The returned iterator requires that the pattern supports a -reverse search, and it will be double ended if a forward/reverse -search yields the same elements.

-

For iterating from the front, the split_terminator method can be -used.

-
Examples
-
let v: Vec<&str> = "A.B.".rsplit_terminator('.').collect();
-assert_eq!(v, ["B", "A"]);
-
-let v: Vec<&str> = "A..B..".rsplit_terminator(".").collect();
-assert_eq!(v, ["", "B", "", "A"]);
-
-let v: Vec<&str> = "A.B:C.D".rsplit_terminator(&['.', ':'][..]).collect();
-assert_eq!(v, ["D", "C", "B", "A"]);
-
1.0.0

pub fn splitn<'a, P>(&'a self, n: usize, pat: P) -> SplitN<'a, P>where - P: Pattern<'a>,

An iterator over substrings of the given string slice, separated by a -pattern, restricted to returning at most n items.

-

If n substrings are returned, the last substring (the nth substring) -will contain the remainder of the string.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator will not be double ended, because it is -not efficient to support.

-

If the pattern allows a reverse search, the rsplitn method can be -used.

-
Examples
-

Simple patterns:

- -
let v: Vec<&str> = "Mary had a little lambda".splitn(3, ' ').collect();
-assert_eq!(v, ["Mary", "had", "a little lambda"]);
-
-let v: Vec<&str> = "lionXXtigerXleopard".splitn(3, "X").collect();
-assert_eq!(v, ["lion", "", "tigerXleopard"]);
-
-let v: Vec<&str> = "abcXdef".splitn(1, 'X').collect();
-assert_eq!(v, ["abcXdef"]);
-
-let v: Vec<&str> = "".splitn(1, 'X').collect();
-assert_eq!(v, [""]);
-

A more complex pattern, using a closure:

- -
let v: Vec<&str> = "abc1defXghi".splitn(2, |c| c == '1' || c == 'X').collect();
-assert_eq!(v, ["abc", "defXghi"]);
-
1.0.0

pub fn rsplitn<'a, P>(&'a self, n: usize, pat: P) -> RSplitN<'a, P>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over substrings of this string slice, separated by a -pattern, starting from the end of the string, restricted to returning -at most n items.

-

If n substrings are returned, the last substring (the nth substring) -will contain the remainder of the string.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator will not be double ended, because it is not -efficient to support.

-

For splitting from the front, the splitn method can be used.

-
Examples
-

Simple patterns:

- -
let v: Vec<&str> = "Mary had a little lamb".rsplitn(3, ' ').collect();
-assert_eq!(v, ["lamb", "little", "Mary had a"]);
-
-let v: Vec<&str> = "lionXXtigerXleopard".rsplitn(3, 'X').collect();
-assert_eq!(v, ["leopard", "tiger", "lionX"]);
-
-let v: Vec<&str> = "lion::tiger::leopard".rsplitn(2, "::").collect();
-assert_eq!(v, ["leopard", "lion::tiger"]);
-

A more complex pattern, using a closure:

- -
let v: Vec<&str> = "abc1defXghi".rsplitn(2, |c| c == '1' || c == 'X').collect();
-assert_eq!(v, ["ghi", "abc1def"]);
-
1.52.0

pub fn split_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)>where - P: Pattern<'a>,

Splits the string on the first occurrence of the specified delimiter and -returns prefix before delimiter and suffix after delimiter.

-
Examples
-
assert_eq!("cfg".split_once('='), None);
-assert_eq!("cfg=".split_once('='), Some(("cfg", "")));
-assert_eq!("cfg=foo".split_once('='), Some(("cfg", "foo")));
-assert_eq!("cfg=foo=bar".split_once('='), Some(("cfg", "foo=bar")));
-
1.52.0

pub fn rsplit_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Splits the string on the last occurrence of the specified delimiter and -returns prefix before delimiter and suffix after delimiter.

-
Examples
-
assert_eq!("cfg".rsplit_once('='), None);
-assert_eq!("cfg=foo".rsplit_once('='), Some(("cfg", "foo")));
-assert_eq!("cfg=foo=bar".rsplit_once('='), Some(("cfg=foo", "bar")));
-
1.2.0

pub fn matches<'a, P>(&'a self, pat: P) -> Matches<'a, P>where - P: Pattern<'a>,

An iterator over the disjoint matches of a pattern within the given string -slice.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator will be a [DoubleEndedIterator] if the pattern -allows a reverse search and forward/reverse search yields the same -elements. This is true for, e.g., char, but not for &str.

-

If the pattern allows a reverse search but its results might differ -from a forward search, the rmatches method can be used.

-
Examples
-
let v: Vec<&str> = "abcXXXabcYYYabc".matches("abc").collect();
-assert_eq!(v, ["abc", "abc", "abc"]);
-
-let v: Vec<&str> = "1abc2abc3".matches(char::is_numeric).collect();
-assert_eq!(v, ["1", "2", "3"]);
-
1.2.0

pub fn rmatches<'a, P>(&'a self, pat: P) -> RMatches<'a, P>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over the disjoint matches of a pattern within this string slice, -yielded in reverse order.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator requires that the pattern supports a reverse -search, and it will be a [DoubleEndedIterator] if a forward/reverse -search yields the same elements.

-

For iterating from the front, the matches method can be used.

-
Examples
-
let v: Vec<&str> = "abcXXXabcYYYabc".rmatches("abc").collect();
-assert_eq!(v, ["abc", "abc", "abc"]);
-
-let v: Vec<&str> = "1abc2abc3".rmatches(char::is_numeric).collect();
-assert_eq!(v, ["3", "2", "1"]);
-
1.5.0

pub fn match_indices<'a, P>(&'a self, pat: P) -> MatchIndices<'a, P>where - P: Pattern<'a>,

An iterator over the disjoint matches of a pattern within this string -slice as well as the index that the match starts at.

-

For matches of pat within self that overlap, only the indices -corresponding to the first match are returned.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator will be a [DoubleEndedIterator] if the pattern -allows a reverse search and forward/reverse search yields the same -elements. This is true for, e.g., char, but not for &str.

-

If the pattern allows a reverse search but its results might differ -from a forward search, the rmatch_indices method can be used.

-
Examples
-
let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect();
-assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]);
-
-let v: Vec<_> = "1abcabc2".match_indices("abc").collect();
-assert_eq!(v, [(1, "abc"), (4, "abc")]);
-
-let v: Vec<_> = "ababa".match_indices("aba").collect();
-assert_eq!(v, [(0, "aba")]); // only the first `aba`
-
1.5.0

pub fn rmatch_indices<'a, P>(&'a self, pat: P) -> RMatchIndices<'a, P>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over the disjoint matches of a pattern within self, -yielded in reverse order along with the index of the match.

-

For matches of pat within self that overlap, only the indices -corresponding to the last match are returned.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator requires that the pattern supports a reverse -search, and it will be a [DoubleEndedIterator] if a forward/reverse -search yields the same elements.

-

For iterating from the front, the match_indices method can be used.

-
Examples
-
let v: Vec<_> = "abcXXXabcYYYabc".rmatch_indices("abc").collect();
-assert_eq!(v, [(12, "abc"), (6, "abc"), (0, "abc")]);
-
-let v: Vec<_> = "1abcabc2".rmatch_indices("abc").collect();
-assert_eq!(v, [(4, "abc"), (1, "abc")]);
-
-let v: Vec<_> = "ababa".rmatch_indices("aba").collect();
-assert_eq!(v, [(2, "aba")]); // only the last `aba`
-
1.0.0

pub fn trim(&self) -> &str

Returns a string slice with leading and trailing whitespace removed.

-

‘Whitespace’ is defined according to the terms of the Unicode Derived -Core Property White_Space, which includes newlines.

-
Examples
-
let s = "\n Hello\tworld\t\n";
-
-assert_eq!("Hello\tworld", s.trim());
-
1.30.0

pub fn trim_start(&self) -> &str

Returns a string slice with leading whitespace removed.

-

‘Whitespace’ is defined according to the terms of the Unicode Derived -Core Property White_Space, which includes newlines.

-
Text directionality
-

A string is a sequence of bytes. start in this context means the first -position of that byte string; for a left-to-right language like English or -Russian, this will be left side, and for right-to-left languages like -Arabic or Hebrew, this will be the right side.

-
Examples
-

Basic usage:

- -
let s = "\n Hello\tworld\t\n";
-assert_eq!("Hello\tworld\t\n", s.trim_start());
-

Directionality:

- -
let s = "  English  ";
-assert!(Some('E') == s.trim_start().chars().next());
-
-let s = "  עברית  ";
-assert!(Some('ע') == s.trim_start().chars().next());
-
1.30.0

pub fn trim_end(&self) -> &str

Returns a string slice with trailing whitespace removed.

-

‘Whitespace’ is defined according to the terms of the Unicode Derived -Core Property White_Space, which includes newlines.

-
Text directionality
-

A string is a sequence of bytes. end in this context means the last -position of that byte string; for a left-to-right language like English or -Russian, this will be right side, and for right-to-left languages like -Arabic or Hebrew, this will be the left side.

-
Examples
-

Basic usage:

- -
let s = "\n Hello\tworld\t\n";
-assert_eq!("\n Hello\tworld", s.trim_end());
-

Directionality:

- -
let s = "  English  ";
-assert!(Some('h') == s.trim_end().chars().rev().next());
-
-let s = "  עברית  ";
-assert!(Some('ת') == s.trim_end().chars().rev().next());
-
1.0.0

pub fn trim_left(&self) -> &str

👎Deprecated since 1.33.0: superseded by trim_start

Returns a string slice with leading whitespace removed.

-

‘Whitespace’ is defined according to the terms of the Unicode Derived -Core Property White_Space.

-
Text directionality
-

A string is a sequence of bytes. ‘Left’ in this context means the first -position of that byte string; for a language like Arabic or Hebrew -which are ‘right to left’ rather than ‘left to right’, this will be -the right side, not the left.

-
Examples
-

Basic usage:

- -
let s = " Hello\tworld\t";
-
-assert_eq!("Hello\tworld\t", s.trim_left());
-

Directionality:

- -
let s = "  English";
-assert!(Some('E') == s.trim_left().chars().next());
-
-let s = "  עברית";
-assert!(Some('ע') == s.trim_left().chars().next());
-
1.0.0

pub fn trim_right(&self) -> &str

👎Deprecated since 1.33.0: superseded by trim_end

Returns a string slice with trailing whitespace removed.

-

‘Whitespace’ is defined according to the terms of the Unicode Derived -Core Property White_Space.

-
Text directionality
-

A string is a sequence of bytes. ‘Right’ in this context means the last -position of that byte string; for a language like Arabic or Hebrew -which are ‘right to left’ rather than ‘left to right’, this will be -the left side, not the right.

-
Examples
-

Basic usage:

- -
let s = " Hello\tworld\t";
-
-assert_eq!(" Hello\tworld", s.trim_right());
-

Directionality:

- -
let s = "English  ";
-assert!(Some('h') == s.trim_right().chars().rev().next());
-
-let s = "עברית  ";
-assert!(Some('ת') == s.trim_right().chars().rev().next());
-
1.0.0

pub fn trim_matches<'a, P>(&'a self, pat: P) -> &'a strwhere - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: DoubleEndedSearcher<'a>,

Returns a string slice with all prefixes and suffixes that match a -pattern repeatedly removed.

-

The pattern can be a char, a slice of chars, or a function -or closure that determines if a character matches.

-
Examples
-

Simple patterns:

- -
assert_eq!("11foo1bar11".trim_matches('1'), "foo1bar");
-assert_eq!("123foo1bar123".trim_matches(char::is_numeric), "foo1bar");
-
-let x: &[_] = &['1', '2'];
-assert_eq!("12foo1bar12".trim_matches(x), "foo1bar");
-

A more complex pattern, using a closure:

- -
assert_eq!("1foo1barXX".trim_matches(|c| c == '1' || c == 'X'), "foo1bar");
-
1.30.0

pub fn trim_start_matches<'a, P>(&'a self, pat: P) -> &'a strwhere - P: Pattern<'a>,

Returns a string slice with all prefixes that match a pattern -repeatedly removed.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Text directionality
-

A string is a sequence of bytes. start in this context means the first -position of that byte string; for a left-to-right language like English or -Russian, this will be left side, and for right-to-left languages like -Arabic or Hebrew, this will be the right side.

-
Examples
-
assert_eq!("11foo1bar11".trim_start_matches('1'), "foo1bar11");
-assert_eq!("123foo1bar123".trim_start_matches(char::is_numeric), "foo1bar123");
-
-let x: &[_] = &['1', '2'];
-assert_eq!("12foo1bar12".trim_start_matches(x), "foo1bar12");
-
1.45.0

pub fn strip_prefix<'a, P>(&'a self, prefix: P) -> Option<&'a str>where - P: Pattern<'a>,

Returns a string slice with the prefix removed.

-

If the string starts with the pattern prefix, returns substring after the prefix, wrapped -in Some. Unlike trim_start_matches, this method removes the prefix exactly once.

-

If the string does not start with prefix, returns None.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-
assert_eq!("foo:bar".strip_prefix("foo:"), Some("bar"));
-assert_eq!("foo:bar".strip_prefix("bar"), None);
-assert_eq!("foofoo".strip_prefix("foo"), Some("foo"));
-
1.45.0

pub fn strip_suffix<'a, P>(&'a self, suffix: P) -> Option<&'a str>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns a string slice with the suffix removed.

-

If the string ends with the pattern suffix, returns the substring before the suffix, -wrapped in Some. Unlike trim_end_matches, this method removes the suffix exactly once.

-

If the string does not end with suffix, returns None.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-
assert_eq!("bar:foo".strip_suffix(":foo"), Some("bar"));
-assert_eq!("bar:foo".strip_suffix("bar"), None);
-assert_eq!("foofoo".strip_suffix("foo"), Some("foo"));
-
1.30.0

pub fn trim_end_matches<'a, P>(&'a self, pat: P) -> &'a strwhere - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns a string slice with all suffixes that match a pattern -repeatedly removed.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Text directionality
-

A string is a sequence of bytes. end in this context means the last -position of that byte string; for a left-to-right language like English or -Russian, this will be right side, and for right-to-left languages like -Arabic or Hebrew, this will be the left side.

-
Examples
-

Simple patterns:

- -
assert_eq!("11foo1bar11".trim_end_matches('1'), "11foo1bar");
-assert_eq!("123foo1bar123".trim_end_matches(char::is_numeric), "123foo1bar");
-
-let x: &[_] = &['1', '2'];
-assert_eq!("12foo1bar12".trim_end_matches(x), "12foo1bar");
-

A more complex pattern, using a closure:

- -
assert_eq!("1fooX".trim_end_matches(|c| c == '1' || c == 'X'), "1foo");
-
1.0.0

pub fn trim_left_matches<'a, P>(&'a self, pat: P) -> &'a strwhere - P: Pattern<'a>,

👎Deprecated since 1.33.0: superseded by trim_start_matches

Returns a string slice with all prefixes that match a pattern -repeatedly removed.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Text directionality
-

A string is a sequence of bytes. ‘Left’ in this context means the first -position of that byte string; for a language like Arabic or Hebrew -which are ‘right to left’ rather than ‘left to right’, this will be -the right side, not the left.

-
Examples
-
assert_eq!("11foo1bar11".trim_left_matches('1'), "foo1bar11");
-assert_eq!("123foo1bar123".trim_left_matches(char::is_numeric), "foo1bar123");
-
-let x: &[_] = &['1', '2'];
-assert_eq!("12foo1bar12".trim_left_matches(x), "foo1bar12");
-
1.0.0

pub fn trim_right_matches<'a, P>(&'a self, pat: P) -> &'a strwhere - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

👎Deprecated since 1.33.0: superseded by trim_end_matches

Returns a string slice with all suffixes that match a pattern -repeatedly removed.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Text directionality
-

A string is a sequence of bytes. ‘Right’ in this context means the last -position of that byte string; for a language like Arabic or Hebrew -which are ‘right to left’ rather than ‘left to right’, this will be -the left side, not the right.

-
Examples
-

Simple patterns:

- -
assert_eq!("11foo1bar11".trim_right_matches('1'), "11foo1bar");
-assert_eq!("123foo1bar123".trim_right_matches(char::is_numeric), "123foo1bar");
-
-let x: &[_] = &['1', '2'];
-assert_eq!("12foo1bar12".trim_right_matches(x), "12foo1bar");
-

A more complex pattern, using a closure:

- -
assert_eq!("1fooX".trim_right_matches(|c| c == '1' || c == 'X'), "1foo");
-
1.0.0

pub fn parse<F>(&self) -> Result<F, <F as FromStr>::Err>where - F: FromStr,

Parses this string slice into another type.

-

Because parse is so general, it can cause problems with type -inference. As such, parse is one of the few times you’ll see -the syntax affectionately known as the ‘turbofish’: ::<>. This -helps the inference algorithm understand specifically which type -you’re trying to parse into.

-

parse can parse into any type that implements the [FromStr] trait.

-
Errors
-

Will return Err if it’s not possible to parse this string slice into -the desired type.

-
Examples
-

Basic usage

- -
let four: u32 = "4".parse().unwrap();
-
-assert_eq!(4, four);
-

Using the ‘turbofish’ instead of annotating four:

- -
let four = "4".parse::<u32>();
-
-assert_eq!(Ok(4), four);
-

Failing to parse:

- -
let nope = "j".parse::<u32>();
-
-assert!(nope.is_err());
-
1.23.0

pub fn is_ascii(&self) -> bool

Checks if all characters in this string are within the ASCII range.

-
Examples
-
let ascii = "hello!\n";
-let non_ascii = "Grüße, Jürgen ❤";
-
-assert!(ascii.is_ascii());
-assert!(!non_ascii.is_ascii());
-

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this string slice is_ascii, returns it as a slice -of ASCII characters, otherwise returns None.

-
1.23.0

pub fn eq_ignore_ascii_case(&self, other: &str) -> bool

Checks that two strings are an ASCII case-insensitive match.

-

Same as to_ascii_lowercase(a) == to_ascii_lowercase(b), -but without allocating and copying temporaries.

-
Examples
-
assert!("Ferris".eq_ignore_ascii_case("FERRIS"));
-assert!("Ferrös".eq_ignore_ascii_case("FERRöS"));
-assert!(!"Ferrös".eq_ignore_ascii_case("FERRÖS"));
-
1.23.0

pub fn make_ascii_uppercase(&mut self)

Converts this string to its ASCII upper case equivalent in-place.

-

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, -but non-ASCII letters are unchanged.

-

To return a new uppercased value without modifying the existing one, use -to_ascii_uppercase().

-
Examples
-
let mut s = String::from("Grüße, Jürgen ❤");
-
-s.make_ascii_uppercase();
-
-assert_eq!("GRüßE, JüRGEN ❤", s);
-
1.23.0

pub fn make_ascii_lowercase(&mut self)

Converts this string to its ASCII lower case equivalent in-place.

-

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, -but non-ASCII letters are unchanged.

-

To return a new lowercased value without modifying the existing one, use -to_ascii_lowercase().

-
Examples
-
let mut s = String::from("GRÜßE, JÜRGEN ❤");
-
-s.make_ascii_lowercase();
-
-assert_eq!("grÜße, jÜrgen ❤", s);
-
1.34.0

pub fn escape_debug(&self) -> EscapeDebug<'_>

Return an iterator that escapes each char in self with [char::escape_debug].

-

Note: only extended grapheme codepoints that begin the string will be -escaped.

-
Examples
-

As an iterator:

- -
for c in "❤\n!".escape_debug() {
-    print!("{c}");
-}
-println!();
-

Using println! directly:

- -
println!("{}", "❤\n!".escape_debug());
-

Both are equivalent to:

- -
println!("❤\\n!");
-

Using to_string:

- -
assert_eq!("❤\n!".escape_debug().to_string(), "❤\\n!");
-
1.34.0

pub fn escape_default(&self) -> EscapeDefault<'_>

Return an iterator that escapes each char in self with [char::escape_default].

-
Examples
-

As an iterator:

- -
for c in "❤\n!".escape_default() {
-    print!("{c}");
-}
-println!();
-

Using println! directly:

- -
println!("{}", "❤\n!".escape_default());
-

Both are equivalent to:

- -
println!("\\u{{2764}}\\n!");
-

Using to_string:

- -
assert_eq!("❤\n!".escape_default().to_string(), "\\u{2764}\\n!");
-
1.34.0

pub fn escape_unicode(&self) -> EscapeUnicode<'_>

Return an iterator that escapes each char in self with [char::escape_unicode].

-
Examples
-

As an iterator:

- -
for c in "❤\n!".escape_unicode() {
-    print!("{c}");
-}
-println!();
-

Using println! directly:

- -
println!("{}", "❤\n!".escape_unicode());
-

Both are equivalent to:

- -
println!("\\u{{2764}}\\u{{a}}\\u{{21}}");
-

Using to_string:

- -
assert_eq!("❤\n!".escape_unicode().to_string(), "\\u{2764}\\u{a}\\u{21}");
-

Trait Implementations§

source§

impl<const N: usize> AsRef<[u8]> for String<N>

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<const N: usize> AsRef<str> for String<N>

source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<const N: usize> Clone for String<N>

source§

fn clone(&self) -> String<N>

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<const N: usize> Debug for String<N>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<const N: usize> Default for String<N>

source§

fn default() -> String<N>

Returns the “default value” for a type. Read more
source§

impl<const N: usize> Deref for String<N>

§

type Target = str

The resulting type after dereferencing.
source§

fn deref(&self) -> &str

Dereferences the value.
source§

impl<const N: usize> DerefMut for String<N>

source§

fn deref_mut(&mut self) -> &mut str

Mutably dereferences the value.
source§

impl<const N: usize> Display for String<N>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'a, const N: usize> From<&'a str> for String<N>

source§

fn from(s: &'a str) -> String<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<i16> for String<N>

source§

fn from(s: i16) -> String<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<i32> for String<N>

source§

fn from(s: i32) -> String<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<i64> for String<N>

source§

fn from(s: i64) -> String<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<i8> for String<N>

source§

fn from(s: i8) -> String<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<u16> for String<N>

source§

fn from(s: u16) -> String<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<u32> for String<N>

source§

fn from(s: u32) -> String<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<u64> for String<N>

source§

fn from(s: u64) -> String<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<u8> for String<N>

source§

fn from(s: u8) -> String<N>

Converts to this type from the input type.
source§

impl<'a, const N: usize> FromIterator<&'a char> for String<N>

source§

fn from_iter<T>(iter: T) -> String<N>where - T: IntoIterator<Item = &'a char>,

Creates a value from an iterator. Read more
source§

impl<'a, const N: usize> FromIterator<&'a str> for String<N>

source§

fn from_iter<T>(iter: T) -> String<N>where - T: IntoIterator<Item = &'a str>,

Creates a value from an iterator. Read more
source§

impl<const N: usize> FromIterator<char> for String<N>

source§

fn from_iter<T>(iter: T) -> String<N>where - T: IntoIterator<Item = char>,

Creates a value from an iterator. Read more
source§

impl<const N: usize> FromStr for String<N>

§

type Err = ()

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<String<N>, <String<N> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
source§

impl<const N: usize> Hash for String<N>

source§

fn hash<H>(&self, hasher: &mut H)where - H: Hasher,

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl<const N: usize> Hash for String<N>

source§

fn hash<H>(&self, hasher: &mut H)where - H: Hasher,

Feeds this value into the given Hasher.
source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher.
source§

impl<const N: usize> Ord for String<N>

source§

fn cmp(&self, other: &String<N>) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<const N: usize> PartialEq<&str> for String<N>

source§

fn eq(&self, other: &&str) -> bool

This method tests for self and other values to be equal, and is used -by ==.
source§

fn ne(&self, other: &&str) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<const N: usize> PartialEq<String<N>> for &str

source§

fn eq(&self, other: &String<N>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
source§

fn ne(&self, other: &String<N>) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<const N: usize> PartialEq<String<N>> for str

source§

fn eq(&self, other: &String<N>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
source§

fn ne(&self, other: &String<N>) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<const N1: usize, const N2: usize> PartialEq<String<N2>> for String<N1>

source§

fn eq(&self, rhs: &String<N2>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
source§

fn ne(&self, rhs: &String<N2>) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<const N: usize> PartialEq<str> for String<N>

source§

fn eq(&self, other: &str) -> bool

This method tests for self and other values to be equal, and is used -by ==.
source§

fn ne(&self, other: &str) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<const N1: usize, const N2: usize> PartialOrd<String<N2>> for String<N1>

source§

fn partial_cmp(&self, other: &String<N2>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl<const N: usize> Printable for String<N>

§

type Parameters = ()

source§

fn print_2(self, _params: Self::Parameters)

source§

fn default_parameters() -> Self::Parameters

source§

fn print(self)

source§

impl<const N: usize> Serialprintable for String<N>

§

type Parameters = ()

source§

fn print_2(self, _params: Self::Parameters)

source§

fn default_parameters() -> Self::Parameters

source§

fn print(self)

source§

impl<const N: usize> Serialprintlnable for String<N>

§

type Parameters = ()

source§

fn println_2(self, _params: Self::Parameters)

source§

fn default_parameters() -> Self::Parameters

source§

fn println(self)

source§

impl<const N: usize> Write for String<N>

source§

fn write_str(&mut self, s: &str) -> Result<(), Error>

Writes a string slice into this writer, returning whether the write -succeeded. Read more
source§

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a [char] into this writer, returning whether the write succeeded. Read more
1.0.0§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the [write!] macro with implementors of this trait. Read more
source§

impl<const N: usize> Eq for String<N>

Auto Trait Implementations§

§

impl<const N: usize> RefUnwindSafe for String<N>

§

impl<const N: usize> Send for String<N>

§

impl<const N: usize> Sync for String<N>

§

impl<const N: usize> Unpin for String<N>

§

impl<const N: usize> UnwindSafe for String<N>

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/struct.VacantEntry.html b/docs/doc/arduboy_rust/heapless/struct.VacantEntry.html deleted file mode 100644 index c36127d..0000000 --- a/docs/doc/arduboy_rust/heapless/struct.VacantEntry.html +++ /dev/null @@ -1,24 +0,0 @@ -VacantEntry in arduboy_rust::heapless - Rust
pub struct VacantEntry<'a, K, V, const N: usize> { /* private fields */ }
Expand description

A view into an empty slot in the underlying map

-

Implementations§

source§

impl<'a, K, V, const N: usize> VacantEntry<'a, K, V, N>where - K: Eq + Hash,

source

pub fn key(&self) -> &K

Get the key associated with this entry

-
source

pub fn into_key(self) -> K

Consumes this entry to yield to key associated with it

-
source

pub fn insert(self, value: V) -> Result<&'a mut V, V>

Inserts this entry into to underlying map, yields a mutable reference to the inserted value. -If the map is at capacity the value is returned instead.

-

Auto Trait Implementations§

§

impl<'a, K, V, const N: usize> RefUnwindSafe for VacantEntry<'a, K, V, N>where - K: RefUnwindSafe, - V: RefUnwindSafe,

§

impl<'a, K, V, const N: usize> Send for VacantEntry<'a, K, V, N>where - K: Send, - V: Send,

§

impl<'a, K, V, const N: usize> Sync for VacantEntry<'a, K, V, N>where - K: Sync, - V: Sync,

§

impl<'a, K, V, const N: usize> Unpin for VacantEntry<'a, K, V, N>where - K: Unpin,

§

impl<'a, K, V, const N: usize> !UnwindSafe for VacantEntry<'a, K, V, N>

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/struct.Vec.html b/docs/doc/arduboy_rust/heapless/struct.Vec.html deleted file mode 100644 index 6e27294..0000000 --- a/docs/doc/arduboy_rust/heapless/struct.Vec.html +++ /dev/null @@ -1,2527 +0,0 @@ -Vec in arduboy_rust::heapless - Rust

Struct arduboy_rust::heapless::Vec

source ·
pub struct Vec<T, const N: usize> { /* private fields */ }
Expand description

A fixed capacity Vec

-

Examples

-
use heapless::Vec;
-
-
-// A vector with a fixed capacity of 8 elements allocated on the stack
-let mut vec = Vec::<_, 8>::new();
-vec.push(1);
-vec.push(2);
-
-assert_eq!(vec.len(), 2);
-assert_eq!(vec[0], 1);
-
-assert_eq!(vec.pop(), Some(2));
-assert_eq!(vec.len(), 1);
-
-vec[0] = 7;
-assert_eq!(vec[0], 7);
-
-vec.extend([1, 2, 3].iter().cloned());
-
-for x in &vec {
-    println!("{}", x);
-}
-assert_eq!(*vec, [7, 1, 2, 3]);
-

Implementations§

source§

impl<T, const N: usize> Vec<T, N>

source

pub const fn new() -> Vec<T, N>

Constructs a new, empty vector with a fixed capacity of N

-
Examples
-
use heapless::Vec;
-
-// allocate the vector on the stack
-let mut x: Vec<u8, 16> = Vec::new();
-
-// allocate the vector in a static variable
-static mut X: Vec<u8, 16> = Vec::new();
-

Vec const constructor; wrap the returned value in Vec

-
source

pub fn from_slice(other: &[T]) -> Result<Vec<T, N>, ()>where - T: Clone,

Constructs a new vector with a fixed capacity of N and fills it -with the provided slice.

-

This is equivalent to the following code:

- -
use heapless::Vec;
-
-let mut v: Vec<u8, 16> = Vec::new();
-v.extend_from_slice(&[1, 2, 3]).unwrap();
-
source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the vector’s buffer.

-
source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns a raw pointer to the vector’s buffer, which may be mutated through.

-
source

pub fn as_slice(&self) -> &[T]

Extracts a slice containing the entire vector.

-

Equivalent to &s[..].

-
Examples
-
use heapless::Vec;
-let buffer: Vec<u8, 5> = Vec::from_slice(&[1, 2, 3, 5, 8]).unwrap();
-assert_eq!(buffer.as_slice(), &[1, 2, 3, 5, 8]);
-
source

pub fn into_array<const M: usize>(self) -> Result<[T; M], Vec<T, N>>

Returns the contents of the vector as an array of length M if the length -of the vector is exactly M, otherwise returns Err(self).

-
Examples
-
use heapless::Vec;
-let buffer: Vec<u8, 42> = Vec::from_slice(&[1, 2, 3, 5, 8]).unwrap();
-let array: [u8; 5] = buffer.into_array().unwrap();
-assert_eq!(array, [1, 2, 3, 5, 8]);
-
source

pub const fn capacity(&self) -> usize

Returns the maximum number of elements the vector can hold.

-
source

pub fn clear(&mut self)

Clears the vector, removing all values.

-
source

pub fn extend<I>(&mut self, iter: I)where - I: IntoIterator<Item = T>,

Extends the vec from an iterator.

-
Panic
-

Panics if the vec cannot hold all elements of the iterator.

-
source

pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), ()>where - T: Clone,

Clones and appends all elements in a slice to the Vec.

-

Iterates over the slice other, clones each element, and then appends -it to this Vec. The other vector is traversed in-order.

-
Examples
-
use heapless::Vec;
-
-let mut vec = Vec::<u8, 8>::new();
-vec.push(1).unwrap();
-vec.extend_from_slice(&[2, 3, 4]).unwrap();
-assert_eq!(*vec, [1, 2, 3, 4]);
-
source

pub fn pop(&mut self) -> Option<T>

Removes the last element from a vector and returns it, or None if it’s empty

-
source

pub fn push(&mut self, item: T) -> Result<(), T>

Appends an item to the back of the collection

-

Returns back the item if the vector is full

-
source

pub unsafe fn pop_unchecked(&mut self) -> T

Removes the last element from a vector and returns it

-
Safety
-

This assumes the vec to have at least one element.

-
source

pub unsafe fn push_unchecked(&mut self, item: T)

Appends an item to the back of the collection

-
Safety
-

This assumes the vec is not full.

-
source

pub fn truncate(&mut self, len: usize)

Shortens the vector, keeping the first len elements and dropping the rest.

-
source

pub fn resize(&mut self, new_len: usize, value: T) -> Result<(), ()>where - T: Clone,

Resizes the Vec in-place so that len is equal to new_len.

-

If new_len is greater than len, the Vec is extended by the -difference, with each additional slot filled with value. If -new_len is less than len, the Vec is simply truncated.

-

See also resize_default.

-
source

pub fn resize_default(&mut self, new_len: usize) -> Result<(), ()>where - T: Clone + Default,

Resizes the Vec in-place so that len is equal to new_len.

-

If new_len is greater than len, the Vec is extended by the -difference, with each additional slot filled with Default::default(). -If new_len is less than len, the Vec is simply truncated.

-

See also resize.

-
source

pub unsafe fn set_len(&mut self, new_len: usize)

Forces the length of the vector to new_len.

-

This is a low-level operation that maintains none of the normal -invariants of the type. Normally changing the length of a vector -is done using one of the safe operations instead, such as -truncate, resize, extend, or clear.

-
Safety
-
    -
  • new_len must be less than or equal to capacity().
  • -
  • The elements at old_len..new_len must be initialized.
  • -
-
Examples
-

This method can be useful for situations in which the vector -is serving as a buffer for other code, particularly over FFI:

- -
use heapless::Vec;
-
-pub fn get_dictionary(&self) -> Option<Vec<u8, 32768>> {
-    // Per the FFI method's docs, "32768 bytes is always enough".
-    let mut dict = Vec::new();
-    let mut dict_length = 0;
-    // SAFETY: When `deflateGetDictionary` returns `Z_OK`, it holds that:
-    // 1. `dict_length` elements were initialized.
-    // 2. `dict_length` <= the capacity (32_768)
-    // which makes `set_len` safe to call.
-    unsafe {
-        // Make the FFI call...
-        let r = deflateGetDictionary(self.strm, dict.as_mut_ptr(), &mut dict_length);
-        if r == Z_OK {
-            // ...and update the length to what was initialized.
-            dict.set_len(dict_length);
-            Some(dict)
-        } else {
-            None
-        }
-    }
-}
-

While the following example is sound, there is a memory leak since -the inner vectors were not freed prior to the set_len call:

- -
use core::iter::FromIterator;
-use heapless::Vec;
-
-let mut vec = Vec::<Vec<u8, 3>, 3>::from_iter(
-    [
-        Vec::from_iter([1, 0, 0].iter().cloned()),
-        Vec::from_iter([0, 1, 0].iter().cloned()),
-        Vec::from_iter([0, 0, 1].iter().cloned()),
-    ]
-    .iter()
-    .cloned()
-);
-// SAFETY:
-// 1. `old_len..0` is empty so no elements need to be initialized.
-// 2. `0 <= capacity` always holds whatever `capacity` is.
-unsafe {
-    vec.set_len(0);
-}
-

Normally, here, one would use clear instead to correctly drop -the contents and thus not leak memory.

-
source

pub fn swap_remove(&mut self, index: usize) -> T

Removes an element from the vector and returns it.

-

The removed element is replaced by the last element of the vector.

-

This does not preserve ordering, but is O(1).

-
Panics
-

Panics if index is out of bounds.

-
Examples
-
use heapless::Vec;
-
-let mut v: Vec<_, 8> = Vec::new();
-v.push("foo").unwrap();
-v.push("bar").unwrap();
-v.push("baz").unwrap();
-v.push("qux").unwrap();
-
-assert_eq!(v.swap_remove(1), "bar");
-assert_eq!(&*v, ["foo", "qux", "baz"]);
-
-assert_eq!(v.swap_remove(0), "foo");
-assert_eq!(&*v, ["baz", "qux"]);
-
source

pub unsafe fn swap_remove_unchecked(&mut self, index: usize) -> T

Removes an element from the vector and returns it.

-

The removed element is replaced by the last element of the vector.

-

This does not preserve ordering, but is O(1).

-
Safety
-

Assumes index within bounds.

-
Examples
-
use heapless::Vec;
-
-let mut v: Vec<_, 8> = Vec::new();
-v.push("foo").unwrap();
-v.push("bar").unwrap();
-v.push("baz").unwrap();
-v.push("qux").unwrap();
-
-assert_eq!(unsafe { v.swap_remove_unchecked(1) }, "bar");
-assert_eq!(&*v, ["foo", "qux", "baz"]);
-
-assert_eq!(unsafe { v.swap_remove_unchecked(0) }, "foo");
-assert_eq!(&*v, ["baz", "qux"]);
-
source

pub fn is_full(&self) -> bool

Returns true if the vec is full

-
source

pub fn is_empty(&self) -> bool

Returns true if the vec is empty

-
source

pub fn starts_with(&self, needle: &[T]) -> boolwhere - T: PartialEq<T>,

Returns true if needle is a prefix of the Vec.

-

Always returns true if needle is an empty slice.

-
Examples
-
use heapless::Vec;
-
-let v: Vec<_, 8> = Vec::from_slice(b"abc").unwrap();
-assert_eq!(v.starts_with(b""), true);
-assert_eq!(v.starts_with(b"ab"), true);
-assert_eq!(v.starts_with(b"bc"), false);
-
source

pub fn ends_with(&self, needle: &[T]) -> boolwhere - T: PartialEq<T>,

Returns true if needle is a suffix of the Vec.

-

Always returns true if needle is an empty slice.

-
Examples
-
use heapless::Vec;
-
-let v: Vec<_, 8> = Vec::from_slice(b"abc").unwrap();
-assert_eq!(v.ends_with(b""), true);
-assert_eq!(v.ends_with(b"ab"), false);
-assert_eq!(v.ends_with(b"bc"), true);
-
source

pub fn insert(&mut self, index: usize, element: T) -> Result<(), T>

Inserts an element at position index within the vector, shifting all -elements after it to the right.

-

Returns back the element if the vector is full.

-
Panics
-

Panics if index > len.

-
Examples
-
use heapless::Vec;
-
-let mut vec: Vec<_, 8> = Vec::from_slice(&[1, 2, 3]).unwrap();
-vec.insert(1, 4);
-assert_eq!(vec, [1, 4, 2, 3]);
-vec.insert(4, 5);
-assert_eq!(vec, [1, 4, 2, 3, 5]);
-
source

pub fn remove(&mut self, index: usize) -> T

Removes and returns the element at position index within the vector, -shifting all elements after it to the left.

-

Note: Because this shifts over the remaining elements, it has a -worst-case performance of O(n). If you don’t need the order of -elements to be preserved, use swap_remove instead. If you’d like to -remove elements from the beginning of the Vec, consider using -Deque::pop_front instead.

-
Panics
-

Panics if index is out of bounds.

-
Examples
-
use heapless::Vec;
-
-let mut v: Vec<_, 8> = Vec::from_slice(&[1, 2, 3]).unwrap();
-assert_eq!(v.remove(1), 2);
-assert_eq!(v, [1, 3]);
-
source

pub fn retain<F>(&mut self, f: F)where - F: FnMut(&T) -> bool,

Retains only the elements specified by the predicate.

-

In other words, remove all elements e for which f(&e) returns false. -This method operates in place, visiting each element exactly once in the -original order, and preserves the order of the retained elements.

-
Examples
-
use heapless::Vec;
-
-let mut vec: Vec<_, 8> = Vec::from_slice(&[1, 2, 3, 4]).unwrap();
-vec.retain(|&x| x % 2 == 0);
-assert_eq!(vec, [2, 4]);
-

Because the elements are visited exactly once in the original order, -external state may be used to decide which elements to keep.

- -
use heapless::Vec;
-
-let mut vec: Vec<_, 8> = Vec::from_slice(&[1, 2, 3, 4, 5]).unwrap();
-let keep = [false, true, true, false, true];
-let mut iter = keep.iter();
-vec.retain(|_| *iter.next().unwrap());
-assert_eq!(vec, [2, 3, 5]);
-
source

pub fn retain_mut<F>(&mut self, f: F)where - F: FnMut(&mut T) -> bool,

Retains only the elements specified by the predicate, passing a mutable reference to it.

-

In other words, remove all elements e such that f(&mut e) returns false. -This method operates in place, visiting each element exactly once in the -original order, and preserves the order of the retained elements.

-
Examples
-
use heapless::Vec;
-
-let mut vec: Vec<_, 8> = Vec::from_slice(&[1, 2, 3, 4]).unwrap();
-vec.retain_mut(|x| if *x <= 3 {
-    *x += 1;
-    true
-} else {
-    false
-});
-assert_eq!(vec, [2, 3, 4]);
-

Methods from Deref<Target = [T]>§

pub fn flatten(&self) -> &[T]

🔬This is a nightly-only experimental API. (slice_flatten)

Takes a &[[T; N]], and flattens it to a &[T].

-
Panics
-

This panics if the length of the resulting slice would overflow a usize.

-

This is only possible when flattening a slice of arrays of zero-sized -types, and thus tends to be irrelevant in practice. If -size_of::<T>() > 0, this will never panic.

-
Examples
-
#![feature(slice_flatten)]
-
-assert_eq!([[1, 2, 3], [4, 5, 6]].flatten(), &[1, 2, 3, 4, 5, 6]);
-
-assert_eq!(
-    [[1, 2, 3], [4, 5, 6]].flatten(),
-    [[1, 2], [3, 4], [5, 6]].flatten(),
-);
-
-let slice_of_empty_arrays: &[[i32; 0]] = &[[], [], [], [], []];
-assert!(slice_of_empty_arrays.flatten().is_empty());
-
-let empty_slice_of_arrays: &[[u32; 10]] = &[];
-assert!(empty_slice_of_arrays.flatten().is_empty());
-

pub fn flatten_mut(&mut self) -> &mut [T]

🔬This is a nightly-only experimental API. (slice_flatten)

Takes a &mut [[T; N]], and flattens it to a &mut [T].

-
Panics
-

This panics if the length of the resulting slice would overflow a usize.

-

This is only possible when flattening a slice of arrays of zero-sized -types, and thus tends to be irrelevant in practice. If -size_of::<T>() > 0, this will never panic.

-
Examples
-
#![feature(slice_flatten)]
-
-fn add_5_to_all(slice: &mut [i32]) {
-    for i in slice {
-        *i += 5;
-    }
-}
-
-let mut array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
-add_5_to_all(array.flatten_mut());
-assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
-
1.23.0

pub fn is_ascii(&self) -> bool

Checks if all bytes in this slice are within the ASCII range.

-

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this slice is_ascii, returns it as a slice of -ASCII characters, otherwise returns None.

-

pub unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar]

🔬This is a nightly-only experimental API. (ascii_char)

Converts this slice of bytes into a slice of ASCII characters, -without checking whether they’re valid.

-
Safety
-

Every byte in the slice must be in 0..=127, or else this is UB.

-
1.23.0

pub fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool

Checks that two slices are an ASCII case-insensitive match.

-

Same as to_ascii_lowercase(a) == to_ascii_lowercase(b), -but without allocating and copying temporaries.

-
1.23.0

pub fn make_ascii_uppercase(&mut self)

Converts this slice to its ASCII upper case equivalent in-place.

-

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, -but non-ASCII letters are unchanged.

-

To return a new uppercased value without modifying the existing one, use -to_ascii_uppercase.

-
1.23.0

pub fn make_ascii_lowercase(&mut self)

Converts this slice to its ASCII lower case equivalent in-place.

-

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, -but non-ASCII letters are unchanged.

-

To return a new lowercased value without modifying the existing one, use -to_ascii_lowercase.

-
1.60.0

pub fn escape_ascii(&self) -> EscapeAscii<'_>

Returns an iterator that produces an escaped version of this slice, -treating it as an ASCII string.

-
Examples
-

-let s = b"0\t\r\n'\"\\\x9d";
-let escaped = s.escape_ascii().to_string();
-assert_eq!(escaped, "0\\t\\r\\n\\'\\\"\\\\\\x9d");
-

pub fn trim_ascii_start(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with leading ASCII whitespace bytes removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b" \t hello world\n".trim_ascii_start(), b"hello world\n");
-assert_eq!(b"  ".trim_ascii_start(), b"");
-assert_eq!(b"".trim_ascii_start(), b"");
-

pub fn trim_ascii_end(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with trailing ASCII whitespace bytes removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b"\r hello world\n ".trim_ascii_end(), b"\r hello world");
-assert_eq!(b"  ".trim_ascii_end(), b"");
-assert_eq!(b"".trim_ascii_end(), b"");
-

pub fn trim_ascii(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with leading and trailing ASCII whitespace bytes -removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b"\r hello world\n ".trim_ascii(), b"hello world");
-assert_eq!(b"  ".trim_ascii(), b"");
-assert_eq!(b"".trim_ascii(), b"");
-

pub fn as_str(&self) -> &str

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a UTF-8 str.

-

pub fn as_bytes(&self) -> &[u8]

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a slice of u8 bytes.

-
1.0.0

pub fn len(&self) -> usize

Returns the number of elements in the slice.

-
Examples
-
let a = [1, 2, 3];
-assert_eq!(a.len(), 3);
-
1.0.0

pub fn is_empty(&self) -> bool

Returns true if the slice has a length of 0.

-
Examples
-
let a = [1, 2, 3];
-assert!(!a.is_empty());
-
1.0.0

pub fn first(&self) -> Option<&T>

Returns the first element of the slice, or None if it is empty.

-
Examples
-
let v = [10, 40, 30];
-assert_eq!(Some(&10), v.first());
-
-let w: &[i32] = &[];
-assert_eq!(None, w.first());
-
1.0.0

pub fn first_mut(&mut self) -> Option<&mut T>

Returns a mutable pointer to the first element of the slice, or None if it is empty.

-
Examples
-
let x = &mut [0, 1, 2];
-
-if let Some(first) = x.first_mut() {
-    *first = 5;
-}
-assert_eq!(x, &[5, 1, 2]);
-
1.5.0

pub fn split_first(&self) -> Option<(&T, &[T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
let x = &[0, 1, 2];
-
-if let Some((first, elements)) = x.split_first() {
-    assert_eq!(first, &0);
-    assert_eq!(elements, &[1, 2]);
-}
-
1.5.0

pub fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
let x = &mut [0, 1, 2];
-
-if let Some((first, elements)) = x.split_first_mut() {
-    *first = 3;
-    elements[0] = 4;
-    elements[1] = 5;
-}
-assert_eq!(x, &[3, 4, 5]);
-
1.5.0

pub fn split_last(&self) -> Option<(&T, &[T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
let x = &[0, 1, 2];
-
-if let Some((last, elements)) = x.split_last() {
-    assert_eq!(last, &2);
-    assert_eq!(elements, &[0, 1]);
-}
-
1.5.0

pub fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
let x = &mut [0, 1, 2];
-
-if let Some((last, elements)) = x.split_last_mut() {
-    *last = 3;
-    elements[0] = 4;
-    elements[1] = 5;
-}
-assert_eq!(x, &[4, 5, 3]);
-
1.0.0

pub fn last(&self) -> Option<&T>

Returns the last element of the slice, or None if it is empty.

-
Examples
-
let v = [10, 40, 30];
-assert_eq!(Some(&30), v.last());
-
-let w: &[i32] = &[];
-assert_eq!(None, w.last());
-
1.0.0

pub fn last_mut(&mut self) -> Option<&mut T>

Returns a mutable pointer to the last item in the slice.

-
Examples
-
let x = &mut [0, 1, 2];
-
-if let Some(last) = x.last_mut() {
-    *last = 10;
-}
-assert_eq!(x, &[0, 1, 10]);
-

pub fn first_chunk<const N: usize>(&self) -> Option<&[T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the first N elements of the slice, or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let u = [10, 40, 30];
-assert_eq!(Some(&[10, 40]), u.first_chunk::<2>());
-
-let v: &[i32] = &[10];
-assert_eq!(None, v.first_chunk::<2>());
-
-let w: &[i32] = &[];
-assert_eq!(Some(&[]), w.first_chunk::<0>());
-

pub fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns a mutable reference to the first N elements of the slice, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &mut [0, 1, 2];
-
-if let Some(first) = x.first_chunk_mut::<2>() {
-    first[0] = 5;
-    first[1] = 4;
-}
-assert_eq!(x, &[5, 4, 2]);
-

pub fn split_first_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the first N elements of the slice and the remainder, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &[0, 1, 2];
-
-if let Some((first, elements)) = x.split_first_chunk::<2>() {
-    assert_eq!(first, &[0, 1]);
-    assert_eq!(elements, &[2]);
-}
-

pub fn split_first_chunk_mut<const N: usize>( - &mut self -) -> Option<(&mut [T; N], &mut [T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns a mutable reference to the first N elements of the slice and the remainder, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &mut [0, 1, 2];
-
-if let Some((first, elements)) = x.split_first_chunk_mut::<2>() {
-    first[0] = 3;
-    first[1] = 4;
-    elements[0] = 5;
-}
-assert_eq!(x, &[3, 4, 5]);
-

pub fn split_last_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the last N elements of the slice and the remainder, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &[0, 1, 2];
-
-if let Some((last, elements)) = x.split_last_chunk::<2>() {
-    assert_eq!(last, &[1, 2]);
-    assert_eq!(elements, &[0]);
-}
-

pub fn split_last_chunk_mut<const N: usize>( - &mut self -) -> Option<(&mut [T; N], &mut [T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the last and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &mut [0, 1, 2];
-
-if let Some((last, elements)) = x.split_last_chunk_mut::<2>() {
-    last[0] = 3;
-    last[1] = 4;
-    elements[0] = 5;
-}
-assert_eq!(x, &[5, 3, 4]);
-

pub fn last_chunk<const N: usize>(&self) -> Option<&[T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the last element of the slice, or None if it is empty.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let u = [10, 40, 30];
-assert_eq!(Some(&[40, 30]), u.last_chunk::<2>());
-
-let v: &[i32] = &[10];
-assert_eq!(None, v.last_chunk::<2>());
-
-let w: &[i32] = &[];
-assert_eq!(Some(&[]), w.last_chunk::<0>());
-

pub fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns a mutable pointer to the last item in the slice.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &mut [0, 1, 2];
-
-if let Some(last) = x.last_chunk_mut::<2>() {
-    last[0] = 10;
-    last[1] = 20;
-}
-assert_eq!(x, &[0, 10, 20]);
-
1.0.0

pub fn get<I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output>where - I: SliceIndex<[T]>,

Returns a reference to an element or subslice depending on the type of -index.

-
    -
  • If given a position, returns a reference to the element at that -position or None if out of bounds.
  • -
  • If given a range, returns the subslice corresponding to that range, -or None if out of bounds.
  • -
-
Examples
-
let v = [10, 40, 30];
-assert_eq!(Some(&40), v.get(1));
-assert_eq!(Some(&[10, 40][..]), v.get(0..2));
-assert_eq!(None, v.get(3));
-assert_eq!(None, v.get(0..4));
-
1.0.0

pub fn get_mut<I>( - &mut self, - index: I -) -> Option<&mut <I as SliceIndex<[T]>>::Output>where - I: SliceIndex<[T]>,

Returns a mutable reference to an element or subslice depending on the -type of index (see get) or None if the index is out of bounds.

-
Examples
-
let x = &mut [0, 1, 2];
-
-if let Some(elem) = x.get_mut(1) {
-    *elem = 42;
-}
-assert_eq!(x, &[0, 42, 2]);
-
1.0.0

pub unsafe fn get_unchecked<I>( - &self, - index: I -) -> &<I as SliceIndex<[T]>>::Outputwhere - I: SliceIndex<[T]>,

Returns a reference to an element or subslice, without doing bounds -checking.

-

For a safe alternative see get.

-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior -even if the resulting reference is not used.

-
Examples
-
let x = &[1, 2, 4];
-
-unsafe {
-    assert_eq!(x.get_unchecked(1), &2);
-}
-
1.0.0

pub unsafe fn get_unchecked_mut<I>( - &mut self, - index: I -) -> &mut <I as SliceIndex<[T]>>::Outputwhere - I: SliceIndex<[T]>,

Returns a mutable reference to an element or subslice, without doing -bounds checking.

-

For a safe alternative see get_mut.

-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior -even if the resulting reference is not used.

-
Examples
-
let x = &mut [1, 2, 4];
-
-unsafe {
-    let elem = x.get_unchecked_mut(1);
-    *elem = 13;
-}
-assert_eq!(x, &[1, 13, 4]);
-
1.0.0

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the slice’s buffer.

-

The caller must ensure that the slice outlives the pointer this -function returns, or else it will end up pointing to garbage.

-

The caller must also ensure that the memory the pointer (non-transitively) points to -is never written to (except inside an UnsafeCell) using this pointer or any pointer -derived from it. If you need to mutate the contents of the slice, use as_mut_ptr.

-

Modifying the container referenced by this slice may cause its buffer -to be reallocated, which would also make any pointers to it invalid.

-
Examples
-
let x = &[1, 2, 4];
-let x_ptr = x.as_ptr();
-
-unsafe {
-    for i in 0..x.len() {
-        assert_eq!(x.get_unchecked(i), &*x_ptr.add(i));
-    }
-}
-
1.0.0

pub fn as_mut_ptr(&mut self) -> *mut T

Returns an unsafe mutable pointer to the slice’s buffer.

-

The caller must ensure that the slice outlives the pointer this -function returns, or else it will end up pointing to garbage.

-

Modifying the container referenced by this slice may cause its buffer -to be reallocated, which would also make any pointers to it invalid.

-
Examples
-
let x = &mut [1, 2, 4];
-let x_ptr = x.as_mut_ptr();
-
-unsafe {
-    for i in 0..x.len() {
-        *x_ptr.add(i) += 2;
-    }
-}
-assert_eq!(x, &[3, 4, 6]);
-
1.48.0

pub fn as_ptr_range(&self) -> Range<*const T>

Returns the two raw pointers spanning the slice.

-

The returned range is half-open, which means that the end pointer -points one past the last element of the slice. This way, an empty -slice is represented by two equal pointers, and the difference between -the two pointers represents the size of the slice.

-

See as_ptr for warnings on using these pointers. The end pointer -requires extra caution, as it does not point to a valid element in the -slice.

-

This function is useful for interacting with foreign interfaces which -use two pointers to refer to a range of elements in memory, as is -common in C++.

-

It can also be useful to check if a pointer to an element refers to an -element of this slice:

- -
let a = [1, 2, 3];
-let x = &a[1] as *const _;
-let y = &5 as *const _;
-
-assert!(a.as_ptr_range().contains(&x));
-assert!(!a.as_ptr_range().contains(&y));
-
1.48.0

pub fn as_mut_ptr_range(&mut self) -> Range<*mut T>

Returns the two unsafe mutable pointers spanning the slice.

-

The returned range is half-open, which means that the end pointer -points one past the last element of the slice. This way, an empty -slice is represented by two equal pointers, and the difference between -the two pointers represents the size of the slice.

-

See as_mut_ptr for warnings on using these pointers. The end -pointer requires extra caution, as it does not point to a valid element -in the slice.

-

This function is useful for interacting with foreign interfaces which -use two pointers to refer to a range of elements in memory, as is -common in C++.

-
1.0.0

pub fn swap(&mut self, a: usize, b: usize)

Swaps two elements in the slice.

-

If a equals to b, it’s guaranteed that elements won’t change value.

-
Arguments
-
    -
  • a - The index of the first element
  • -
  • b - The index of the second element
  • -
-
Panics
-

Panics if a or b are out of bounds.

-
Examples
-
let mut v = ["a", "b", "c", "d", "e"];
-v.swap(2, 4);
-assert!(v == ["a", "b", "e", "d", "c"]);
-

pub unsafe fn swap_unchecked(&mut self, a: usize, b: usize)

🔬This is a nightly-only experimental API. (slice_swap_unchecked)

Swaps two elements in the slice, without doing bounds checking.

-

For a safe alternative see swap.

-
Arguments
-
    -
  • a - The index of the first element
  • -
  • b - The index of the second element
  • -
-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior. -The caller has to ensure that a < self.len() and b < self.len().

-
Examples
-
#![feature(slice_swap_unchecked)]
-
-let mut v = ["a", "b", "c", "d"];
-// SAFETY: we know that 1 and 3 are both indices of the slice
-unsafe { v.swap_unchecked(1, 3) };
-assert!(v == ["a", "d", "c", "b"]);
-
1.0.0

pub fn reverse(&mut self)

Reverses the order of elements in the slice, in place.

-
Examples
-
let mut v = [1, 2, 3];
-v.reverse();
-assert!(v == [3, 2, 1]);
-
1.0.0

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the slice.

-

The iterator yields all items from start to end.

-
Examples
-
let x = &[1, 2, 4];
-let mut iterator = x.iter();
-
-assert_eq!(iterator.next(), Some(&1));
-assert_eq!(iterator.next(), Some(&2));
-assert_eq!(iterator.next(), Some(&4));
-assert_eq!(iterator.next(), None);
-
1.0.0

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns an iterator that allows modifying each value.

-

The iterator yields all items from start to end.

-
Examples
-
let x = &mut [1, 2, 4];
-for elem in x.iter_mut() {
-    *elem += 2;
-}
-assert_eq!(x, &[3, 4, 6]);
-
1.0.0

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length -size. The windows overlap. If the slice is shorter than -size, the iterator returns no values.

-
Panics
-

Panics if size is 0.

-
Examples
-
let slice = ['r', 'u', 's', 't'];
-let mut iter = slice.windows(2);
-assert_eq!(iter.next().unwrap(), &['r', 'u']);
-assert_eq!(iter.next().unwrap(), &['u', 's']);
-assert_eq!(iter.next().unwrap(), &['s', 't']);
-assert!(iter.next().is_none());
-

If the slice is shorter than size:

- -
let slice = ['f', 'o', 'o'];
-let mut iter = slice.windows(4);
-assert!(iter.next().is_none());
-

There’s no windows_mut, as that existing would let safe code violate the -“only one &mut at a time to the same thing” rule. However, you can sometimes -use Cell::as_slice_of_cells in -conjunction with windows to accomplish something similar:

- -
use std::cell::Cell;
-
-let mut array = ['R', 'u', 's', 't', ' ', '2', '0', '1', '5'];
-let slice = &mut array[..];
-let slice_of_cells: &[Cell<char>] = Cell::from_mut(slice).as_slice_of_cells();
-for w in slice_of_cells.windows(3) {
-    Cell::swap(&w[0], &w[2]);
-}
-assert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
-
1.0.0

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last chunk will not have length chunk_size.

-

See chunks_exact for a variant of this iterator that returns chunks of always exactly -chunk_size elements, and rchunks for the same iterator but starting at the end of the -slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.chunks(2);
-assert_eq!(iter.next().unwrap(), &['l', 'o']);
-assert_eq!(iter.next().unwrap(), &['r', 'e']);
-assert_eq!(iter.next().unwrap(), &['m']);
-assert!(iter.next().is_none());
-
1.0.0

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the -length of the slice, then the last chunk will not have length chunk_size.

-

See chunks_exact_mut for a variant of this iterator that returns chunks of always -exactly chunk_size elements, and rchunks_mut for the same iterator but starting at -the end of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-for chunk in v.chunks_mut(2) {
-    for elem in chunk.iter_mut() {
-        *elem += count;
-    }
-    count += 1;
-}
-assert_eq!(v, &[1, 1, 2, 2, 3]);
-
1.31.0

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved -from the remainder function of the iterator.

-

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the -resulting code better than in the case of chunks.

-

See chunks for a variant of this iterator that also returns the remainder as a smaller -chunk, and rchunks_exact for the same iterator but starting at the end of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.chunks_exact(2);
-assert_eq!(iter.next().unwrap(), &['l', 'o']);
-assert_eq!(iter.next().unwrap(), &['r', 'e']);
-assert!(iter.next().is_none());
-assert_eq!(iter.remainder(), &['m']);
-
1.31.0

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the -length of the slice, then the last up to chunk_size-1 elements will be omitted and can be -retrieved from the into_remainder function of the iterator.

-

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the -resulting code better than in the case of chunks_mut.

-

See chunks_mut for a variant of this iterator that also returns the remainder as a -smaller chunk, and rchunks_exact_mut for the same iterator but starting at the end of -the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-for chunk in v.chunks_exact_mut(2) {
-    for elem in chunk.iter_mut() {
-        *elem += count;
-    }
-    count += 1;
-}
-assert_eq!(v, &[1, 1, 2, 2, 0]);
-

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -assuming that there’s no remainder.

-
Safety
-

This may only be called when

-
    -
  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • -
  • N != 0.
  • -
-
Examples
-
#![feature(slice_as_chunks)]
-let slice: &[char] = &['l', 'o', 'r', 'e', 'm', '!'];
-let chunks: &[[char; 1]] =
-    // SAFETY: 1-element chunks never have remainder
-    unsafe { slice.as_chunks_unchecked() };
-assert_eq!(chunks, &[['l'], ['o'], ['r'], ['e'], ['m'], ['!']]);
-let chunks: &[[char; 3]] =
-    // SAFETY: The slice length (6) is a multiple of 3
-    unsafe { slice.as_chunks_unchecked() };
-assert_eq!(chunks, &[['l', 'o', 'r'], ['e', 'm', '!']]);
-
-// These would be unsound:
-// let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5
-// let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed
-

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -starting at the beginning of the slice, -and a remainder slice with length strictly less than N.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(slice_as_chunks)]
-let slice = ['l', 'o', 'r', 'e', 'm'];
-let (chunks, remainder) = slice.as_chunks();
-assert_eq!(chunks, &[['l', 'o'], ['r', 'e']]);
-assert_eq!(remainder, &['m']);
-

If you expect the slice to be an exact multiple, you can combine -let-else with an empty slice pattern:

- -
#![feature(slice_as_chunks)]
-let slice = ['R', 'u', 's', 't'];
-let (chunks, []) = slice.as_chunks::<2>() else {
-    panic!("slice didn't have even length")
-};
-assert_eq!(chunks, &[['R', 'u'], ['s', 't']]);
-

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -starting at the end of the slice, -and a remainder slice with length strictly less than N.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(slice_as_chunks)]
-let slice = ['l', 'o', 'r', 'e', 'm'];
-let (remainder, chunks) = slice.as_rchunks();
-assert_eq!(remainder, &['l']);
-assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]);
-

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are array references and do not overlap. If N does not divide the -length of the slice, then the last up to N-1 elements will be omitted and can be -retrieved from the remainder function of the iterator.

-

This method is the const generic equivalent of chunks_exact.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(array_chunks)]
-let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.array_chunks();
-assert_eq!(iter.next().unwrap(), &['l', 'o']);
-assert_eq!(iter.next().unwrap(), &['r', 'e']);
-assert!(iter.next().is_none());
-assert_eq!(iter.remainder(), &['m']);
-

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( - &mut self -) -> &mut [[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -assuming that there’s no remainder.

-
Safety
-

This may only be called when

-
    -
  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • -
  • N != 0.
  • -
-
Examples
-
#![feature(slice_as_chunks)]
-let slice: &mut [char] = &mut ['l', 'o', 'r', 'e', 'm', '!'];
-let chunks: &mut [[char; 1]] =
-    // SAFETY: 1-element chunks never have remainder
-    unsafe { slice.as_chunks_unchecked_mut() };
-chunks[0] = ['L'];
-assert_eq!(chunks, &[['L'], ['o'], ['r'], ['e'], ['m'], ['!']]);
-let chunks: &mut [[char; 3]] =
-    // SAFETY: The slice length (6) is a multiple of 3
-    unsafe { slice.as_chunks_unchecked_mut() };
-chunks[1] = ['a', 'x', '?'];
-assert_eq!(slice, &['L', 'o', 'r', 'a', 'x', '?']);
-
-// These would be unsound:
-// let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut() // The slice length is not a multiple of 5
-// let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed
-

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -starting at the beginning of the slice, -and a remainder slice with length strictly less than N.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(slice_as_chunks)]
-let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-let (chunks, remainder) = v.as_chunks_mut();
-remainder[0] = 9;
-for chunk in chunks {
-    *chunk = [count; 2];
-    count += 1;
-}
-assert_eq!(v, &[1, 1, 2, 2, 9]);
-

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -starting at the end of the slice, -and a remainder slice with length strictly less than N.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(slice_as_chunks)]
-let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-let (remainder, chunks) = v.as_rchunks_mut();
-remainder[0] = 9;
-for chunk in chunks {
-    *chunk = [count; 2];
-    count += 1;
-}
-assert_eq!(v, &[9, 1, 1, 2, 2]);
-

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are mutable array references and do not overlap. If N does not divide -the length of the slice, then the last up to N-1 elements will be omitted and -can be retrieved from the into_remainder function of the iterator.

-

This method is the const generic equivalent of chunks_exact_mut.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(array_chunks)]
-let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-for chunk in v.array_chunks_mut() {
-    *chunk = [count; 2];
-    count += 1;
-}
-assert_eq!(v, &[1, 1, 2, 2, 0]);
-

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, -starting at the beginning of the slice.

-

This is the const generic equivalent of windows.

-

If N is greater than the size of the slice, it will return no windows.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(array_windows)]
-let slice = [0, 1, 2, 3];
-let mut iter = slice.array_windows();
-assert_eq!(iter.next().unwrap(), &[0, 1]);
-assert_eq!(iter.next().unwrap(), &[1, 2]);
-assert_eq!(iter.next().unwrap(), &[2, 3]);
-assert!(iter.next().is_none());
-
1.31.0

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end -of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last chunk will not have length chunk_size.

-

See rchunks_exact for a variant of this iterator that returns chunks of always exactly -chunk_size elements, and chunks for the same iterator but starting at the beginning -of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.rchunks(2);
-assert_eq!(iter.next().unwrap(), &['e', 'm']);
-assert_eq!(iter.next().unwrap(), &['o', 'r']);
-assert_eq!(iter.next().unwrap(), &['l']);
-assert!(iter.next().is_none());
-
1.31.0

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end -of the slice.

-

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the -length of the slice, then the last chunk will not have length chunk_size.

-

See rchunks_exact_mut for a variant of this iterator that returns chunks of always -exactly chunk_size elements, and chunks_mut for the same iterator but starting at the -beginning of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-for chunk in v.rchunks_mut(2) {
-    for elem in chunk.iter_mut() {
-        *elem += count;
-    }
-    count += 1;
-}
-assert_eq!(v, &[3, 2, 2, 1, 1]);
-
1.31.0

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -end of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved -from the remainder function of the iterator.

-

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the -resulting code better than in the case of rchunks.

-

See rchunks for a variant of this iterator that also returns the remainder as a smaller -chunk, and chunks_exact for the same iterator but starting at the beginning of the -slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.rchunks_exact(2);
-assert_eq!(iter.next().unwrap(), &['e', 'm']);
-assert_eq!(iter.next().unwrap(), &['o', 'r']);
-assert!(iter.next().is_none());
-assert_eq!(iter.remainder(), &['l']);
-
1.31.0

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end -of the slice.

-

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the -length of the slice, then the last up to chunk_size-1 elements will be omitted and can be -retrieved from the into_remainder function of the iterator.

-

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the -resulting code better than in the case of chunks_mut.

-

See rchunks_mut for a variant of this iterator that also returns the remainder as a -smaller chunk, and chunks_exact_mut for the same iterator but starting at the beginning -of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-for chunk in v.rchunks_exact_mut(2) {
-    for elem in chunk.iter_mut() {
-        *elem += count;
-    }
-    count += 1;
-}
-assert_eq!(v, &[0, 2, 2, 1, 1]);
-

pub fn group_by<F>(&self, pred: F) -> GroupBy<'_, T, F>where - F: FnMut(&T, &T) -> bool,

🔬This is a nightly-only experimental API. (slice_group_by)

Returns an iterator over the slice producing non-overlapping runs -of elements using the predicate to separate them.

-

The predicate is called on two elements following themselves, -it means the predicate is called on slice[0] and slice[1] -then on slice[1] and slice[2] and so on.

-
Examples
-
#![feature(slice_group_by)]
-
-let slice = &[1, 1, 1, 3, 3, 2, 2, 2];
-
-let mut iter = slice.group_by(|a, b| a == b);
-
-assert_eq!(iter.next(), Some(&[1, 1, 1][..]));
-assert_eq!(iter.next(), Some(&[3, 3][..]));
-assert_eq!(iter.next(), Some(&[2, 2, 2][..]));
-assert_eq!(iter.next(), None);
-

This method can be used to extract the sorted subslices:

- -
#![feature(slice_group_by)]
-
-let slice = &[1, 1, 2, 3, 2, 3, 2, 3, 4];
-
-let mut iter = slice.group_by(|a, b| a <= b);
-
-assert_eq!(iter.next(), Some(&[1, 1, 2, 3][..]));
-assert_eq!(iter.next(), Some(&[2, 3][..]));
-assert_eq!(iter.next(), Some(&[2, 3, 4][..]));
-assert_eq!(iter.next(), None);
-

pub fn group_by_mut<F>(&mut self, pred: F) -> GroupByMut<'_, T, F>where - F: FnMut(&T, &T) -> bool,

🔬This is a nightly-only experimental API. (slice_group_by)

Returns an iterator over the slice producing non-overlapping mutable -runs of elements using the predicate to separate them.

-

The predicate is called on two elements following themselves, -it means the predicate is called on slice[0] and slice[1] -then on slice[1] and slice[2] and so on.

-
Examples
-
#![feature(slice_group_by)]
-
-let slice = &mut [1, 1, 1, 3, 3, 2, 2, 2];
-
-let mut iter = slice.group_by_mut(|a, b| a == b);
-
-assert_eq!(iter.next(), Some(&mut [1, 1, 1][..]));
-assert_eq!(iter.next(), Some(&mut [3, 3][..]));
-assert_eq!(iter.next(), Some(&mut [2, 2, 2][..]));
-assert_eq!(iter.next(), None);
-

This method can be used to extract the sorted subslices:

- -
#![feature(slice_group_by)]
-
-let slice = &mut [1, 1, 2, 3, 2, 3, 2, 3, 4];
-
-let mut iter = slice.group_by_mut(|a, b| a <= b);
-
-assert_eq!(iter.next(), Some(&mut [1, 1, 2, 3][..]));
-assert_eq!(iter.next(), Some(&mut [2, 3][..]));
-assert_eq!(iter.next(), Some(&mut [2, 3, 4][..]));
-assert_eq!(iter.next(), None);
-
1.0.0

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

-

The first will contain all indices from [0, mid) (excluding -the index mid itself) and the second will contain all -indices from [mid, len) (excluding the index len itself).

-
Panics
-

Panics if mid > len.

-
Examples
-
let v = [1, 2, 3, 4, 5, 6];
-
-{
-   let (left, right) = v.split_at(0);
-   assert_eq!(left, []);
-   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_at(2);
-    assert_eq!(left, [1, 2]);
-    assert_eq!(right, [3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_at(6);
-    assert_eq!(left, [1, 2, 3, 4, 5, 6]);
-    assert_eq!(right, []);
-}
-
1.0.0

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

-

The first will contain all indices from [0, mid) (excluding -the index mid itself) and the second will contain all -indices from [mid, len) (excluding the index len itself).

-
Panics
-

Panics if mid > len.

-
Examples
-
let mut v = [1, 0, 3, 0, 5, 6];
-let (left, right) = v.split_at_mut(2);
-assert_eq!(left, [1, 0]);
-assert_eq!(right, [3, 0, 5, 6]);
-left[1] = 2;
-right[1] = 4;
-assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

🔬This is a nightly-only experimental API. (slice_split_at_unchecked)

Divides one slice into two at an index, without doing bounds checking.

-

The first will contain all indices from [0, mid) (excluding -the index mid itself) and the second will contain all -indices from [mid, len) (excluding the index len itself).

-

For a safe alternative see split_at.

-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior -even if the resulting reference is not used. The caller has to ensure that -0 <= mid <= self.len().

-
Examples
-
#![feature(slice_split_at_unchecked)]
-
-let v = [1, 2, 3, 4, 5, 6];
-
-unsafe {
-   let (left, right) = v.split_at_unchecked(0);
-   assert_eq!(left, []);
-   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
-}
-
-unsafe {
-    let (left, right) = v.split_at_unchecked(2);
-    assert_eq!(left, [1, 2]);
-    assert_eq!(right, [3, 4, 5, 6]);
-}
-
-unsafe {
-    let (left, right) = v.split_at_unchecked(6);
-    assert_eq!(left, [1, 2, 3, 4, 5, 6]);
-    assert_eq!(right, []);
-}
-

pub unsafe fn split_at_mut_unchecked( - &mut self, - mid: usize -) -> (&mut [T], &mut [T])

🔬This is a nightly-only experimental API. (slice_split_at_unchecked)

Divides one mutable slice into two at an index, without doing bounds checking.

-

The first will contain all indices from [0, mid) (excluding -the index mid itself) and the second will contain all -indices from [mid, len) (excluding the index len itself).

-

For a safe alternative see split_at_mut.

-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior -even if the resulting reference is not used. The caller has to ensure that -0 <= mid <= self.len().

-
Examples
-
#![feature(slice_split_at_unchecked)]
-
-let mut v = [1, 0, 3, 0, 5, 6];
-// scoped to restrict the lifetime of the borrows
-unsafe {
-    let (left, right) = v.split_at_mut_unchecked(2);
-    assert_eq!(left, [1, 0]);
-    assert_eq!(right, [3, 0, 5, 6]);
-    left[1] = 2;
-    right[1] = 4;
-}
-assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-

pub fn split_array_ref<const N: usize>(&self) -> (&[T; N], &[T])

🔬This is a nightly-only experimental API. (split_array)

Divides one slice into an array and a remainder slice at an index.

-

The array will contain all indices from [0, N) (excluding -the index N itself) and the slice will contain all -indices from [N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let v = &[1, 2, 3, 4, 5, 6][..];
-
-{
-   let (left, right) = v.split_array_ref::<0>();
-   assert_eq!(left, &[]);
-   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_array_ref::<2>();
-    assert_eq!(left, &[1, 2]);
-    assert_eq!(right, [3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_array_ref::<6>();
-    assert_eq!(left, &[1, 2, 3, 4, 5, 6]);
-    assert_eq!(right, []);
-}
-

pub fn split_array_mut<const N: usize>(&mut self) -> (&mut [T; N], &mut [T])

🔬This is a nightly-only experimental API. (split_array)

Divides one mutable slice into an array and a remainder slice at an index.

-

The array will contain all indices from [0, N) (excluding -the index N itself) and the slice will contain all -indices from [N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let mut v = &mut [1, 0, 3, 0, 5, 6][..];
-let (left, right) = v.split_array_mut::<2>();
-assert_eq!(left, &mut [1, 0]);
-assert_eq!(right, [3, 0, 5, 6]);
-left[1] = 2;
-right[1] = 4;
-assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-

pub fn rsplit_array_ref<const N: usize>(&self) -> (&[T], &[T; N])

🔬This is a nightly-only experimental API. (split_array)

Divides one slice into an array and a remainder slice at an index from -the end.

-

The slice will contain all indices from [0, len - N) (excluding -the index len - N itself) and the array will contain all -indices from [len - N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let v = &[1, 2, 3, 4, 5, 6][..];
-
-{
-   let (left, right) = v.rsplit_array_ref::<0>();
-   assert_eq!(left, [1, 2, 3, 4, 5, 6]);
-   assert_eq!(right, &[]);
-}
-
-{
-    let (left, right) = v.rsplit_array_ref::<2>();
-    assert_eq!(left, [1, 2, 3, 4]);
-    assert_eq!(right, &[5, 6]);
-}
-
-{
-    let (left, right) = v.rsplit_array_ref::<6>();
-    assert_eq!(left, []);
-    assert_eq!(right, &[1, 2, 3, 4, 5, 6]);
-}
-

pub fn rsplit_array_mut<const N: usize>(&mut self) -> (&mut [T], &mut [T; N])

🔬This is a nightly-only experimental API. (split_array)

Divides one mutable slice into an array and a remainder slice at an -index from the end.

-

The slice will contain all indices from [0, len - N) (excluding -the index N itself) and the array will contain all -indices from [len - N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let mut v = &mut [1, 0, 3, 0, 5, 6][..];
-let (left, right) = v.rsplit_array_mut::<4>();
-assert_eq!(left, [1, 0]);
-assert_eq!(right, &mut [3, 0, 5, 6]);
-left[1] = 2;
-right[1] = 4;
-assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
1.0.0

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred. The matched element is not contained in the subslices.

-
Examples
-
let slice = [10, 40, 33, 20];
-let mut iter = slice.split(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10, 40]);
-assert_eq!(iter.next().unwrap(), &[20]);
-assert!(iter.next().is_none());
-

If the first element is matched, an empty slice will be the first item -returned by the iterator. Similarly, if the last element in the slice -is matched, an empty slice will be the last item returned by the -iterator:

- -
let slice = [10, 40, 33];
-let mut iter = slice.split(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10, 40]);
-assert_eq!(iter.next().unwrap(), &[]);
-assert!(iter.next().is_none());
-

If two matched elements are directly adjacent, an empty slice will be -present between them:

- -
let slice = [10, 6, 33, 20];
-let mut iter = slice.split(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10]);
-assert_eq!(iter.next().unwrap(), &[]);
-assert_eq!(iter.next().unwrap(), &[20]);
-assert!(iter.next().is_none());
-
1.0.0

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that -match pred. The matched element is not contained in the subslices.

-
Examples
-
let mut v = [10, 40, 30, 20, 60, 50];
-
-for group in v.split_mut(|num| *num % 3 == 0) {
-    group[0] = 1;
-}
-assert_eq!(v, [1, 40, 30, 1, 60, 1]);
-
1.51.0

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred. The matched element is contained in the end of the previous -subslice as a terminator.

-
Examples
-
let slice = [10, 40, 33, 20];
-let mut iter = slice.split_inclusive(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10, 40, 33]);
-assert_eq!(iter.next().unwrap(), &[20]);
-assert!(iter.next().is_none());
-

If the last element of the slice is matched, -that element will be considered the terminator of the preceding slice. -That slice will be the last item returned by the iterator.

- -
let slice = [3, 10, 40, 33];
-let mut iter = slice.split_inclusive(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[3]);
-assert_eq!(iter.next().unwrap(), &[10, 40, 33]);
-assert!(iter.next().is_none());
-
1.51.0

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that -match pred. The matched element is contained in the previous -subslice as a terminator.

-
Examples
-
let mut v = [10, 40, 30, 20, 60, 50];
-
-for group in v.split_inclusive_mut(|num| *num % 3 == 0) {
-    let terminator_idx = group.len()-1;
-    group[terminator_idx] = 1;
-}
-assert_eq!(v, [10, 40, 1, 20, 1, 1]);
-
1.27.0

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred, starting at the end of the slice and working backwards. -The matched element is not contained in the subslices.

-
Examples
-
let slice = [11, 22, 33, 0, 44, 55];
-let mut iter = slice.rsplit(|num| *num == 0);
-
-assert_eq!(iter.next().unwrap(), &[44, 55]);
-assert_eq!(iter.next().unwrap(), &[11, 22, 33]);
-assert_eq!(iter.next(), None);
-

As with split(), if the first or last element is matched, an empty -slice will be the first (or last) item returned by the iterator.

- -
let v = &[0, 1, 1, 2, 3, 5, 8];
-let mut it = v.rsplit(|n| *n % 2 == 0);
-assert_eq!(it.next().unwrap(), &[]);
-assert_eq!(it.next().unwrap(), &[3, 5]);
-assert_eq!(it.next().unwrap(), &[1, 1]);
-assert_eq!(it.next().unwrap(), &[]);
-assert_eq!(it.next(), None);
-
1.27.0

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that -match pred, starting at the end of the slice and working -backwards. The matched element is not contained in the subslices.

-
Examples
-
let mut v = [100, 400, 300, 200, 600, 500];
-
-let mut count = 0;
-for group in v.rsplit_mut(|num| *num % 3 == 0) {
-    count += 1;
-    group[0] = count;
-}
-assert_eq!(v, [3, 400, 300, 2, 600, 1]);
-
1.0.0

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred, limited to returning at most n items. The matched element is -not contained in the subslices.

-

The last element returned, if any, will contain the remainder of the -slice.

-
Examples
-

Print the slice split once by numbers divisible by 3 (i.e., [10, 40], -[20, 60, 50]):

- -
let v = [10, 40, 30, 20, 60, 50];
-
-for group in v.splitn(2, |num| *num % 3 == 0) {
-    println!("{group:?}");
-}
-
1.0.0

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match -pred, limited to returning at most n items. The matched element is -not contained in the subslices.

-

The last element returned, if any, will contain the remainder of the -slice.

-
Examples
-
let mut v = [10, 40, 30, 20, 60, 50];
-
-for group in v.splitn_mut(2, |num| *num % 3 == 0) {
-    group[0] = 1;
-}
-assert_eq!(v, [1, 40, 30, 1, 60, 50]);
-
1.0.0

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred limited to returning at most n items. This starts at the end of -the slice and works backwards. The matched element is not contained in -the subslices.

-

The last element returned, if any, will contain the remainder of the -slice.

-
Examples
-

Print the slice split once, starting from the end, by numbers divisible -by 3 (i.e., [50], [10, 40, 30, 20]):

- -
let v = [10, 40, 30, 20, 60, 50];
-
-for group in v.rsplitn(2, |num| *num % 3 == 0) {
-    println!("{group:?}");
-}
-
1.0.0

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred limited to returning at most n items. This starts at the end of -the slice and works backwards. The matched element is not contained in -the subslices.

-

The last element returned, if any, will contain the remainder of the -slice.

-
Examples
-
let mut s = [10, 40, 30, 20, 60, 50];
-
-for group in s.rsplitn_mut(2, |num| *num % 3 == 0) {
-    group[0] = 1;
-}
-assert_eq!(s, [1, 40, 30, 20, 60, 1]);
-
1.0.0

pub fn contains(&self, x: &T) -> boolwhere - T: PartialEq<T>,

Returns true if the slice contains an element with the given value.

-

This operation is O(n).

-

Note that if you have a sorted slice, binary_search may be faster.

-
Examples
-
let v = [10, 40, 30];
-assert!(v.contains(&30));
-assert!(!v.contains(&50));
-

If you do not have a &T, but some other value that you can compare -with one (for example, String implements PartialEq<str>), you can -use iter().any:

- -
let v = [String::from("hello"), String::from("world")]; // slice of `String`
-assert!(v.iter().any(|e| e == "hello")); // search with `&str`
-assert!(!v.iter().any(|e| e == "hi"));
-
1.0.0

pub fn starts_with(&self, needle: &[T]) -> boolwhere - T: PartialEq<T>,

Returns true if needle is a prefix of the slice.

-
Examples
-
let v = [10, 40, 30];
-assert!(v.starts_with(&[10]));
-assert!(v.starts_with(&[10, 40]));
-assert!(!v.starts_with(&[50]));
-assert!(!v.starts_with(&[10, 50]));
-

Always returns true if needle is an empty slice:

- -
let v = &[10, 40, 30];
-assert!(v.starts_with(&[]));
-let v: &[u8] = &[];
-assert!(v.starts_with(&[]));
-
1.0.0

pub fn ends_with(&self, needle: &[T]) -> boolwhere - T: PartialEq<T>,

Returns true if needle is a suffix of the slice.

-
Examples
-
let v = [10, 40, 30];
-assert!(v.ends_with(&[30]));
-assert!(v.ends_with(&[40, 30]));
-assert!(!v.ends_with(&[50]));
-assert!(!v.ends_with(&[50, 30]));
-

Always returns true if needle is an empty slice:

- -
let v = &[10, 40, 30];
-assert!(v.ends_with(&[]));
-let v: &[u8] = &[];
-assert!(v.ends_with(&[]));
-
1.51.0

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>where - P: SlicePattern<Item = T> + ?Sized, - T: PartialEq<T>,

Returns a subslice with the prefix removed.

-

If the slice starts with prefix, returns the subslice after the prefix, wrapped in Some. -If prefix is empty, simply returns the original slice.

-

If the slice does not start with prefix, returns None.

-
Examples
-
let v = &[10, 40, 30];
-assert_eq!(v.strip_prefix(&[10]), Some(&[40, 30][..]));
-assert_eq!(v.strip_prefix(&[10, 40]), Some(&[30][..]));
-assert_eq!(v.strip_prefix(&[50]), None);
-assert_eq!(v.strip_prefix(&[10, 50]), None);
-
-let prefix : &str = "he";
-assert_eq!(b"hello".strip_prefix(prefix.as_bytes()),
-           Some(b"llo".as_ref()));
-
1.51.0

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>where - P: SlicePattern<Item = T> + ?Sized, - T: PartialEq<T>,

Returns a subslice with the suffix removed.

-

If the slice ends with suffix, returns the subslice before the suffix, wrapped in Some. -If suffix is empty, simply returns the original slice.

-

If the slice does not end with suffix, returns None.

-
Examples
-
let v = &[10, 40, 30];
-assert_eq!(v.strip_suffix(&[30]), Some(&[10, 40][..]));
-assert_eq!(v.strip_suffix(&[40, 30]), Some(&[10][..]));
-assert_eq!(v.strip_suffix(&[50]), None);
-assert_eq!(v.strip_suffix(&[50, 30]), None);
-

Binary searches this slice for a given element. -If the slice is not sorted, the returned result is unspecified and -meaningless.

-

If the value is found then [Result::Ok] is returned, containing the -index of the matching element. If there are multiple matches, then any -one of the matches could be returned. The index is chosen -deterministically, but is subject to change in future versions of Rust. -If the value is not found then [Result::Err] is returned, containing -the index where a matching element could be inserted while maintaining -sorted order.

-

See also binary_search_by, binary_search_by_key, and partition_point.

-
Examples
-

Looks up a series of four elements. The first is found, with a -uniquely determined position; the second and third are not -found; the fourth could match any position in [1, 4].

- -
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-
-assert_eq!(s.binary_search(&13),  Ok(9));
-assert_eq!(s.binary_search(&4),   Err(7));
-assert_eq!(s.binary_search(&100), Err(13));
-let r = s.binary_search(&1);
-assert!(match r { Ok(1..=4) => true, _ => false, });
-

If you want to find that whole range of matching items, rather than -an arbitrary matching one, that can be done using partition_point:

- -
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-
-let low = s.partition_point(|x| x < &1);
-assert_eq!(low, 1);
-let high = s.partition_point(|x| x <= &1);
-assert_eq!(high, 5);
-let r = s.binary_search(&1);
-assert!((low..high).contains(&r.unwrap()));
-
-assert!(s[..low].iter().all(|&x| x < 1));
-assert!(s[low..high].iter().all(|&x| x == 1));
-assert!(s[high..].iter().all(|&x| x > 1));
-
-// For something not found, the "range" of equal items is empty
-assert_eq!(s.partition_point(|x| x < &11), 9);
-assert_eq!(s.partition_point(|x| x <= &11), 9);
-assert_eq!(s.binary_search(&11), Err(9));
-

If you want to insert an item to a sorted vector, while maintaining -sort order, consider using partition_point:

- -
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-let num = 42;
-let idx = s.partition_point(|&x| x < num);
-// The above is equivalent to `let idx = s.binary_search(&num).unwrap_or_else(|x| x);`
-s.insert(idx, num);
-assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
1.0.0

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>where - F: FnMut(&'a T) -> Ordering,

Binary searches this slice with a comparator function.

-

The comparator function should return an order code that indicates -whether its argument is Less, Equal or Greater the desired -target. -If the slice is not sorted or if the comparator function does not -implement an order consistent with the sort order of the underlying -slice, the returned result is unspecified and meaningless.

-

If the value is found then [Result::Ok] is returned, containing the -index of the matching element. If there are multiple matches, then any -one of the matches could be returned. The index is chosen -deterministically, but is subject to change in future versions of Rust. -If the value is not found then [Result::Err] is returned, containing -the index where a matching element could be inserted while maintaining -sorted order.

-

See also binary_search, binary_search_by_key, and partition_point.

-
Examples
-

Looks up a series of four elements. The first is found, with a -uniquely determined position; the second and third are not -found; the fourth could match any position in [1, 4].

- -
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-
-let seek = 13;
-assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Ok(9));
-let seek = 4;
-assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(7));
-let seek = 100;
-assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(13));
-let seek = 1;
-let r = s.binary_search_by(|probe| probe.cmp(&seek));
-assert!(match r { Ok(1..=4) => true, _ => false, });
-
1.10.0

pub fn binary_search_by_key<'a, B, F>( - &'a self, - b: &B, - f: F -) -> Result<usize, usize>where - F: FnMut(&'a T) -> B, - B: Ord,

Binary searches this slice with a key extraction function.

-

Assumes that the slice is sorted by the key, for instance with -sort_by_key using the same key extraction function. -If the slice is not sorted by the key, the returned result is -unspecified and meaningless.

-

If the value is found then [Result::Ok] is returned, containing the -index of the matching element. If there are multiple matches, then any -one of the matches could be returned. The index is chosen -deterministically, but is subject to change in future versions of Rust. -If the value is not found then [Result::Err] is returned, containing -the index where a matching element could be inserted while maintaining -sorted order.

-

See also binary_search, binary_search_by, and partition_point.

-
Examples
-

Looks up a series of four elements in a slice of pairs sorted by -their second elements. The first is found, with a uniquely -determined position; the second and third are not found; the -fourth could match any position in [1, 4].

- -
let s = [(0, 0), (2, 1), (4, 1), (5, 1), (3, 1),
-         (1, 2), (2, 3), (4, 5), (5, 8), (3, 13),
-         (1, 21), (2, 34), (4, 55)];
-
-assert_eq!(s.binary_search_by_key(&13, |&(a, b)| b),  Ok(9));
-assert_eq!(s.binary_search_by_key(&4, |&(a, b)| b),   Err(7));
-assert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13));
-let r = s.binary_search_by_key(&1, |&(a, b)| b);
-assert!(match r { Ok(1..=4) => true, _ => false, });
-
1.20.0

pub fn sort_unstable(&mut self)where - T: Ord,

Sorts the slice, but might not preserve the order of equal elements.

-

This sort is unstable (i.e., may reorder equal elements), in-place -(i.e., does not allocate), and O(n * log(n)) worst-case.

-
Current implementation
-

The current algorithm is based on pattern-defeating quicksort by Orson Peters, -which combines the fast average case of randomized quicksort with the fast worst case of -heapsort, while achieving linear time on slices with certain patterns. It uses some -randomization to avoid degenerate cases, but with a fixed seed to always provide -deterministic behavior.

-

It is typically faster than stable sorting, except in a few special cases, e.g., when the -slice consists of several concatenated sorted sequences.

-
Examples
-
let mut v = [-5, 4, 1, -3, 2];
-
-v.sort_unstable();
-assert!(v == [-5, -3, 1, 2, 4]);
-
1.20.0

pub fn sort_unstable_by<F>(&mut self, compare: F)where - F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparator function, but might not preserve the order of equal -elements.

-

This sort is unstable (i.e., may reorder equal elements), in-place -(i.e., does not allocate), and O(n * log(n)) worst-case.

-

The comparator function must define a total ordering for the elements in the slice. If -the ordering is not total, the order of the elements is unspecified. An order is a -total order if it is (for all a, b and c):

-
    -
  • total and antisymmetric: exactly one of a < b, a == b or a > b is true, and
  • -
  • transitive, a < b and b < c implies a < c. The same must hold for both == and >.
  • -
-

For example, while [f64] doesn’t implement [Ord] because NaN != NaN, we can use -partial_cmp as our sort function when we know the slice doesn’t contain a NaN.

- -
let mut floats = [5f64, 4.0, 1.0, 3.0, 2.0];
-floats.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());
-assert_eq!(floats, [1.0, 2.0, 3.0, 4.0, 5.0]);
-
Current implementation
-

The current algorithm is based on pattern-defeating quicksort by Orson Peters, -which combines the fast average case of randomized quicksort with the fast worst case of -heapsort, while achieving linear time on slices with certain patterns. It uses some -randomization to avoid degenerate cases, but with a fixed seed to always provide -deterministic behavior.

-

It is typically faster than stable sorting, except in a few special cases, e.g., when the -slice consists of several concatenated sorted sequences.

-
Examples
-
let mut v = [5, 4, 1, 3, 2];
-v.sort_unstable_by(|a, b| a.cmp(b));
-assert!(v == [1, 2, 3, 4, 5]);
-
-// reverse sorting
-v.sort_unstable_by(|a, b| b.cmp(a));
-assert!(v == [5, 4, 3, 2, 1]);
-
1.20.0

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)where - F: FnMut(&T) -> K, - K: Ord,

Sorts the slice with a key extraction function, but might not preserve the order of equal -elements.

-

This sort is unstable (i.e., may reorder equal elements), in-place -(i.e., does not allocate), and O(m * n * log(n)) worst-case, where the key function is -O(m).

-
Current implementation
-

The current algorithm is based on pattern-defeating quicksort by Orson Peters, -which combines the fast average case of randomized quicksort with the fast worst case of -heapsort, while achieving linear time on slices with certain patterns. It uses some -randomization to avoid degenerate cases, but with a fixed seed to always provide -deterministic behavior.

-

Due to its key calling strategy, sort_unstable_by_key -is likely to be slower than sort_by_cached_key in -cases where the key function is expensive.

-
Examples
-
let mut v = [-5i32, 4, 1, -3, 2];
-
-v.sort_unstable_by_key(|k| k.abs());
-assert!(v == [1, 2, -3, 4, -5]);
-
1.49.0

pub fn select_nth_unstable( - &mut self, - index: usize -) -> (&mut [T], &mut T, &mut [T])where - T: Ord,

Reorder the slice such that the element at index is at its final sorted position.

-

This reordering has the additional property that any value at position i < index will be -less than or equal to any value at a position j > index. Additionally, this reordering is -unstable (i.e. any number of equal elements may end up at position index), in-place -(i.e. does not allocate), and runs in O(n) time. -This function is also known as “kth element” in other libraries.

-

It returns a triplet of the following from the reordered slice: -the subslice prior to index, the element at index, and the subslice after index; -accordingly, the values in those two subslices will respectively all be less-than-or-equal-to -and greater-than-or-equal-to the value of the element at index.

-
Current implementation
-

The current algorithm is an introselect implementation based on Pattern Defeating Quicksort, which is also -the basis for sort_unstable. The fallback algorithm is Median of Medians using Tukey’s Ninther for -pivot selection, which guarantees linear runtime for all inputs.

-
Panics
-

Panics when index >= len(), meaning it always panics on empty slices.

-
Examples
-
let mut v = [-5i32, 4, 1, -3, 2];
-
-// Find the median
-v.select_nth_unstable(2);
-
-// We are only guaranteed the slice will be one of the following, based on the way we sort
-// about the specified index.
-assert!(v == [-3, -5, 1, 2, 4] ||
-        v == [-5, -3, 1, 2, 4] ||
-        v == [-3, -5, 1, 4, 2] ||
-        v == [-5, -3, 1, 4, 2]);
-
1.49.0

pub fn select_nth_unstable_by<F>( - &mut self, - index: usize, - compare: F -) -> (&mut [T], &mut T, &mut [T])where - F: FnMut(&T, &T) -> Ordering,

Reorder the slice with a comparator function such that the element at index is at its -final sorted position.

-

This reordering has the additional property that any value at position i < index will be -less than or equal to any value at a position j > index using the comparator function. -Additionally, this reordering is unstable (i.e. any number of equal elements may end up at -position index), in-place (i.e. does not allocate), and runs in O(n) time. -This function is also known as “kth element” in other libraries.

-

It returns a triplet of the following from -the slice reordered according to the provided comparator function: the subslice prior to -index, the element at index, and the subslice after index; accordingly, the values in -those two subslices will respectively all be less-than-or-equal-to and greater-than-or-equal-to -the value of the element at index.

-
Current implementation
-

The current algorithm is an introselect implementation based on Pattern Defeating Quicksort, which is also -the basis for sort_unstable. The fallback algorithm is Median of Medians using Tukey’s Ninther for -pivot selection, which guarantees linear runtime for all inputs.

-
Panics
-

Panics when index >= len(), meaning it always panics on empty slices.

-
Examples
-
let mut v = [-5i32, 4, 1, -3, 2];
-
-// Find the median as if the slice were sorted in descending order.
-v.select_nth_unstable_by(2, |a, b| b.cmp(a));
-
-// We are only guaranteed the slice will be one of the following, based on the way we sort
-// about the specified index.
-assert!(v == [2, 4, 1, -5, -3] ||
-        v == [2, 4, 1, -3, -5] ||
-        v == [4, 2, 1, -5, -3] ||
-        v == [4, 2, 1, -3, -5]);
-
1.49.0

pub fn select_nth_unstable_by_key<K, F>( - &mut self, - index: usize, - f: F -) -> (&mut [T], &mut T, &mut [T])where - F: FnMut(&T) -> K, - K: Ord,

Reorder the slice with a key extraction function such that the element at index is at its -final sorted position.

-

This reordering has the additional property that any value at position i < index will be -less than or equal to any value at a position j > index using the key extraction function. -Additionally, this reordering is unstable (i.e. any number of equal elements may end up at -position index), in-place (i.e. does not allocate), and runs in O(n) time. -This function is also known as “kth element” in other libraries.

-

It returns a triplet of the following from -the slice reordered according to the provided key extraction function: the subslice prior to -index, the element at index, and the subslice after index; accordingly, the values in -those two subslices will respectively all be less-than-or-equal-to and greater-than-or-equal-to -the value of the element at index.

-
Current implementation
-

The current algorithm is an introselect implementation based on Pattern Defeating Quicksort, which is also -the basis for sort_unstable. The fallback algorithm is Median of Medians using Tukey’s Ninther for -pivot selection, which guarantees linear runtime for all inputs.

-
Panics
-

Panics when index >= len(), meaning it always panics on empty slices.

-
Examples
-
let mut v = [-5i32, 4, 1, -3, 2];
-
-// Return the median as if the array were sorted according to absolute value.
-v.select_nth_unstable_by_key(2, |a| a.abs());
-
-// We are only guaranteed the slice will be one of the following, based on the way we sort
-// about the specified index.
-assert!(v == [1, 2, -3, 4, -5] ||
-        v == [1, 2, -3, -5, 4] ||
-        v == [2, 1, -3, 4, -5] ||
-        v == [2, 1, -3, -5, 4]);
-

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])where - T: PartialEq<T>,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all consecutive repeated elements to the end of the slice according to the -[PartialEq] trait implementation.

-

Returns two slices. The first contains no consecutive repeated elements. -The second contains all the duplicates in no specified order.

-

If the slice is sorted, the first returned slice contains no duplicates.

-
Examples
-
#![feature(slice_partition_dedup)]
-
-let mut slice = [1, 2, 2, 3, 3, 2, 1, 1];
-
-let (dedup, duplicates) = slice.partition_dedup();
-
-assert_eq!(dedup, [1, 2, 3, 2, 1]);
-assert_eq!(duplicates, [2, 3, 1]);
-

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])where - F: FnMut(&mut T, &mut T) -> bool,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice satisfying -a given equality relation.

-

Returns two slices. The first contains no consecutive repeated elements. -The second contains all the duplicates in no specified order.

-

The same_bucket function is passed references to two elements from the slice and -must determine if the elements compare equal. The elements are passed in opposite order -from their order in the slice, so if same_bucket(a, b) returns true, a is moved -at the end of the slice.

-

If the slice is sorted, the first returned slice contains no duplicates.

-
Examples
-
#![feature(slice_partition_dedup)]
-
-let mut slice = ["foo", "Foo", "BAZ", "Bar", "bar", "baz", "BAZ"];
-
-let (dedup, duplicates) = slice.partition_dedup_by(|a, b| a.eq_ignore_ascii_case(b));
-
-assert_eq!(dedup, ["foo", "BAZ", "Bar", "baz"]);
-assert_eq!(duplicates, ["bar", "Foo", "BAZ"]);
-

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])where - F: FnMut(&mut T) -> K, - K: PartialEq<K>,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice that resolve -to the same key.

-

Returns two slices. The first contains no consecutive repeated elements. -The second contains all the duplicates in no specified order.

-

If the slice is sorted, the first returned slice contains no duplicates.

-
Examples
-
#![feature(slice_partition_dedup)]
-
-let mut slice = [10, 20, 21, 30, 30, 20, 11, 13];
-
-let (dedup, duplicates) = slice.partition_dedup_by_key(|i| *i / 10);
-
-assert_eq!(dedup, [10, 20, 30, 20, 11]);
-assert_eq!(duplicates, [21, 30, 13]);
-
1.26.0

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the -slice move to the end while the last self.len() - mid elements move to -the front. After calling rotate_left, the element previously at index -mid will become the first element in the slice.

-
Panics
-

This function will panic if mid is greater than the length of the -slice. Note that mid == self.len() does not panic and is a no-op -rotation.

-
Complexity
-

Takes linear (in self.len()) time.

-
Examples
-
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
-a.rotate_left(2);
-assert_eq!(a, ['c', 'd', 'e', 'f', 'a', 'b']);
-

Rotating a subslice:

- -
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
-a[1..5].rotate_left(1);
-assert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']);
-
1.26.0

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k -elements of the slice move to the end while the last k elements move -to the front. After calling rotate_right, the element previously at -index self.len() - k will become the first element in the slice.

-
Panics
-

This function will panic if k is greater than the length of the -slice. Note that k == self.len() does not panic and is a no-op -rotation.

-
Complexity
-

Takes linear (in self.len()) time.

-
Examples
-
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
-a.rotate_right(2);
-assert_eq!(a, ['e', 'f', 'a', 'b', 'c', 'd']);
-

Rotate a subslice:

- -
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
-a[1..5].rotate_right(1);
-assert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']);
-
1.50.0

pub fn fill(&mut self, value: T)where - T: Clone,

Fills self with elements by cloning value.

-
Examples
-
let mut buf = vec![0; 10];
-buf.fill(1);
-assert_eq!(buf, vec![1; 10]);
-
1.51.0

pub fn fill_with<F>(&mut self, f: F)where - F: FnMut() -> T,

Fills self with elements returned by calling a closure repeatedly.

-

This method uses a closure to create new values. If you’d rather -[Clone] a given value, use fill. If you want to use the [Default] -trait to generate values, you can pass [Default::default] as the -argument.

-
Examples
-
let mut buf = vec![1; 10];
-buf.fill_with(Default::default);
-assert_eq!(buf, vec![0; 10]);
-
1.7.0

pub fn clone_from_slice(&mut self, src: &[T])where - T: Clone,

Copies the elements from src into self.

-

The length of src must be the same as self.

-
Panics
-

This function will panic if the two slices have different lengths.

-
Examples
-

Cloning two elements from a slice into another:

- -
let src = [1, 2, 3, 4];
-let mut dst = [0, 0];
-
-// Because the slices have to be the same length,
-// we slice the source slice from four elements
-// to two. It will panic if we don't do this.
-dst.clone_from_slice(&src[2..]);
-
-assert_eq!(src, [1, 2, 3, 4]);
-assert_eq!(dst, [3, 4]);
-

Rust enforces that there can only be one mutable reference with no -immutable references to a particular piece of data in a particular -scope. Because of this, attempting to use clone_from_slice on a -single slice will result in a compile failure:

- -
let mut slice = [1, 2, 3, 4, 5];
-
-slice[..2].clone_from_slice(&slice[3..]); // compile fail!
-

To work around this, we can use split_at_mut to create two distinct -sub-slices from a slice:

- -
let mut slice = [1, 2, 3, 4, 5];
-
-{
-    let (left, right) = slice.split_at_mut(2);
-    left.clone_from_slice(&right[1..]);
-}
-
-assert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.9.0

pub fn copy_from_slice(&mut self, src: &[T])where - T: Copy,

Copies all elements from src into self, using a memcpy.

-

The length of src must be the same as self.

-

If T does not implement Copy, use clone_from_slice.

-
Panics
-

This function will panic if the two slices have different lengths.

-
Examples
-

Copying two elements from a slice into another:

- -
let src = [1, 2, 3, 4];
-let mut dst = [0, 0];
-
-// Because the slices have to be the same length,
-// we slice the source slice from four elements
-// to two. It will panic if we don't do this.
-dst.copy_from_slice(&src[2..]);
-
-assert_eq!(src, [1, 2, 3, 4]);
-assert_eq!(dst, [3, 4]);
-

Rust enforces that there can only be one mutable reference with no -immutable references to a particular piece of data in a particular -scope. Because of this, attempting to use copy_from_slice on a -single slice will result in a compile failure:

- -
let mut slice = [1, 2, 3, 4, 5];
-
-slice[..2].copy_from_slice(&slice[3..]); // compile fail!
-

To work around this, we can use split_at_mut to create two distinct -sub-slices from a slice:

- -
let mut slice = [1, 2, 3, 4, 5];
-
-{
-    let (left, right) = slice.split_at_mut(2);
-    left.copy_from_slice(&right[1..]);
-}
-
-assert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.37.0

pub fn copy_within<R>(&mut self, src: R, dest: usize)where - R: RangeBounds<usize>, - T: Copy,

Copies elements from one part of the slice to another part of itself, -using a memmove.

-

src is the range within self to copy from. dest is the starting -index of the range within self to copy to, which will have the same -length as src. The two ranges may overlap. The ends of the two ranges -must be less than or equal to self.len().

-
Panics
-

This function will panic if either range exceeds the end of the slice, -or if the end of src is before the start.

-
Examples
-

Copying four bytes within a slice:

- -
let mut bytes = *b"Hello, World!";
-
-bytes.copy_within(1..5, 8);
-
-assert_eq!(&bytes, b"Hello, Wello!");
-
1.27.0

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

-

The length of other must be the same as self.

-
Panics
-

This function will panic if the two slices have different lengths.

-
Example
-

Swapping two elements across slices:

- -
let mut slice1 = [0, 0];
-let mut slice2 = [1, 2, 3, 4];
-
-slice1.swap_with_slice(&mut slice2[2..]);
-
-assert_eq!(slice1, [3, 4]);
-assert_eq!(slice2, [1, 2, 0, 0]);
-

Rust enforces that there can only be one mutable reference to a -particular piece of data in a particular scope. Because of this, -attempting to use swap_with_slice on a single slice will result in -a compile failure:

- -
let mut slice = [1, 2, 3, 4, 5];
-slice[..2].swap_with_slice(&mut slice[3..]); // compile fail!
-

To work around this, we can use split_at_mut to create two distinct -mutable sub-slices from a slice:

- -
let mut slice = [1, 2, 3, 4, 5];
-
-{
-    let (left, right) = slice.split_at_mut(2);
-    left.swap_with_slice(&mut right[1..]);
-}
-
-assert_eq!(slice, [4, 5, 3, 1, 2]);
-
1.30.0

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmute the slice to a slice of another type, ensuring alignment of the types is -maintained.

-

This method splits the slice into three distinct slices: prefix, correctly aligned middle -slice of a new type, and the suffix slice. How exactly the slice is split up is not -specified; the middle part may be smaller than necessary. However, if this fails to return a -maximal middle part, that is because code is running in a context where performance does not -matter, such as a sanitizer attempting to find alignment bugs. Regular code running -in a default (debug or release) execution will return a maximal middle part.

-

This method has no purpose when either input element T or output element U are -zero-sized and will return the original slice without splitting anything.

-
Safety
-

This method is essentially a transmute with respect to the elements in the returned -middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

-
Examples
-

Basic usage:

- -
unsafe {
-    let bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];
-    let (prefix, shorts, suffix) = bytes.align_to::<u16>();
-    // less_efficient_algorithm_for_bytes(prefix);
-    // more_efficient_algorithm_for_aligned_shorts(shorts);
-    // less_efficient_algorithm_for_bytes(suffix);
-}
-
1.30.0

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmute the mutable slice to a mutable slice of another type, ensuring alignment of the -types is maintained.

-

This method splits the slice into three distinct slices: prefix, correctly aligned middle -slice of a new type, and the suffix slice. How exactly the slice is split up is not -specified; the middle part may be smaller than necessary. However, if this fails to return a -maximal middle part, that is because code is running in a context where performance does not -matter, such as a sanitizer attempting to find alignment bugs. Regular code running -in a default (debug or release) execution will return a maximal middle part.

-

This method has no purpose when either input element T or output element U are -zero-sized and will return the original slice without splitting anything.

-
Safety
-

This method is essentially a transmute with respect to the elements in the returned -middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

-
Examples
-

Basic usage:

- -
unsafe {
-    let mut bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];
-    let (prefix, shorts, suffix) = bytes.align_to_mut::<u16>();
-    // less_efficient_algorithm_for_bytes(prefix);
-    // more_efficient_algorithm_for_aligned_shorts(shorts);
-    // less_efficient_algorithm_for_bytes(suffix);
-}
-

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])where - Simd<T, LANES>: AsRef<[T; LANES]>, - T: SimdElement, - LaneCount<LANES>: SupportedLaneCount,

🔬This is a nightly-only experimental API. (portable_simd)

Split a slice into a prefix, a middle of aligned SIMD types, and a suffix.

-

This is a safe wrapper around [slice::align_to], so has the same weak -postconditions as that method. You’re only assured that -self.len() == prefix.len() + middle.len() * LANES + suffix.len().

-

Notably, all of the following are possible:

-
    -
  • prefix.len() >= LANES.
  • -
  • middle.is_empty() despite self.len() >= 3 * LANES.
  • -
  • suffix.len() >= LANES.
  • -
-

That said, this is a safe method, so if you’re only writing safe code, -then this can at most cause incorrect logic, not unsoundness.

-
Panics
-

This will panic if the size of the SIMD type is different from -LANES times that of the scalar.

-

At the time of writing, the trait restrictions on Simd<T, LANES> keeps -that from ever happening, as only power-of-two numbers of lanes are -supported. It’s possible that, in the future, those restrictions might -be lifted in a way that would make it possible to see panics from this -method for something like LANES == 3.

-
Examples
-
#![feature(portable_simd)]
-use core::simd::SimdFloat;
-
-let short = &[1, 2, 3];
-let (prefix, middle, suffix) = short.as_simd::<4>();
-assert_eq!(middle, []); // Not enough elements for anything in the middle
-
-// They might be split in any possible way between prefix and suffix
-let it = prefix.iter().chain(suffix).copied();
-assert_eq!(it.collect::<Vec<_>>(), vec![1, 2, 3]);
-
-fn basic_simd_sum(x: &[f32]) -> f32 {
-    use std::ops::Add;
-    use std::simd::f32x4;
-    let (prefix, middle, suffix) = x.as_simd();
-    let sums = f32x4::from_array([
-        prefix.iter().copied().sum(),
-        0.0,
-        0.0,
-        suffix.iter().copied().sum(),
-    ]);
-    let sums = middle.iter().copied().fold(sums, f32x4::add);
-    sums.reduce_sum()
-}
-
-let numbers: Vec<f32> = (1..101).map(|x| x as _).collect();
-assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0);
-

pub fn as_simd_mut<const LANES: usize>( - &mut self -) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T])where - Simd<T, LANES>: AsMut<[T; LANES]>, - T: SimdElement, - LaneCount<LANES>: SupportedLaneCount,

🔬This is a nightly-only experimental API. (portable_simd)

Split a mutable slice into a mutable prefix, a middle of aligned SIMD types, -and a mutable suffix.

-

This is a safe wrapper around [slice::align_to_mut], so has the same weak -postconditions as that method. You’re only assured that -self.len() == prefix.len() + middle.len() * LANES + suffix.len().

-

Notably, all of the following are possible:

-
    -
  • prefix.len() >= LANES.
  • -
  • middle.is_empty() despite self.len() >= 3 * LANES.
  • -
  • suffix.len() >= LANES.
  • -
-

That said, this is a safe method, so if you’re only writing safe code, -then this can at most cause incorrect logic, not unsoundness.

-

This is the mutable version of [slice::as_simd]; see that for examples.

-
Panics
-

This will panic if the size of the SIMD type is different from -LANES times that of the scalar.

-

At the time of writing, the trait restrictions on Simd<T, LANES> keeps -that from ever happening, as only power-of-two numbers of lanes are -supported. It’s possible that, in the future, those restrictions might -be lifted in a way that would make it possible to see panics from this -method for something like LANES == 3.

-

pub fn is_sorted(&self) -> boolwhere - T: PartialOrd<T>,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted.

-

That is, for each element a and its following element b, a <= b must hold. If the -slice yields exactly zero or one element, true is returned.

-

Note that if Self::Item is only PartialOrd, but not Ord, the above definition -implies that this function returns false if any two consecutive items are not -comparable.

-
Examples
-
#![feature(is_sorted)]
-let empty: [i32; 0] = [];
-
-assert!([1, 2, 2, 9].is_sorted());
-assert!(![1, 3, 2, 4].is_sorted());
-assert!([0].is_sorted());
-assert!(empty.is_sorted());
-assert!(![0.0, 1.0, f32::NAN].is_sorted());
-

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> boolwhere - F: FnMut(&'a T, &'a T) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given comparator function.

-

Instead of using PartialOrd::partial_cmp, this function uses the given compare -function to determine the ordering of two elements. Apart from that, it’s equivalent to -is_sorted; see its documentation for more information.

-

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> boolwhere - F: FnMut(&'a T) -> K, - K: PartialOrd<K>,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given key extraction function.

-

Instead of comparing the slice’s elements directly, this function compares the keys of the -elements, as determined by f. Apart from that, it’s equivalent to is_sorted; see its -documentation for more information.

-
Examples
-
#![feature(is_sorted)]
-
-assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
-assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
-
1.52.0

pub fn partition_point<P>(&self, pred: P) -> usizewhere - P: FnMut(&T) -> bool,

Returns the index of the partition point according to the given predicate -(the index of the first element of the second partition).

-

The slice is assumed to be partitioned according to the given predicate. -This means that all elements for which the predicate returns true are at the start of the slice -and all elements for which the predicate returns false are at the end. -For example, [7, 15, 3, 5, 4, 12, 6] is partitioned under the predicate x % 2 != 0 -(all odd numbers are at the start, all even at the end).

-

If this slice is not partitioned, the returned result is unspecified and meaningless, -as this method performs a kind of binary search.

-

See also binary_search, binary_search_by, and binary_search_by_key.

-
Examples
-
let v = [1, 2, 3, 3, 5, 6, 7];
-let i = v.partition_point(|&x| x < 5);
-
-assert_eq!(i, 4);
-assert!(v[..i].iter().all(|&x| x < 5));
-assert!(v[i..].iter().all(|&x| !(x < 5)));
-

If all elements of the slice match the predicate, including if the slice -is empty, then the length of the slice will be returned:

- -
let a = [2, 4, 8];
-assert_eq!(a.partition_point(|x| x < &100), a.len());
-let a: [i32; 0] = [];
-assert_eq!(a.partition_point(|x| x < &100), 0);
-

If you want to insert an item to a sorted vector, while maintaining -sort order:

- -
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-let num = 42;
-let idx = s.partition_point(|&x| x < num);
-s.insert(idx, num);
-assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-

pub fn take<R, 'a>(self: &mut &'a [T], range: R) -> Option<&'a [T]>where - R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range -and returns a reference to it.

-

Returns None and does not modify the slice if the given -range is out of bounds.

-

Note that this method only accepts one-sided ranges such as -2.. or ..6, but not 2..6.

-
Examples
-

Taking the first three elements of a slice:

- -
#![feature(slice_take)]
-
-let mut slice: &[_] = &['a', 'b', 'c', 'd'];
-let mut first_three = slice.take(..3).unwrap();
-
-assert_eq!(slice, &['d']);
-assert_eq!(first_three, &['a', 'b', 'c']);
-

Taking the last two elements of a slice:

- -
#![feature(slice_take)]
-
-let mut slice: &[_] = &['a', 'b', 'c', 'd'];
-let mut tail = slice.take(2..).unwrap();
-
-assert_eq!(slice, &['a', 'b']);
-assert_eq!(tail, &['c', 'd']);
-

Getting None when range is out of bounds:

- -
#![feature(slice_take)]
-
-let mut slice: &[_] = &['a', 'b', 'c', 'd'];
-
-assert_eq!(None, slice.take(5..));
-assert_eq!(None, slice.take(..5));
-assert_eq!(None, slice.take(..=4));
-let expected: &[char] = &['a', 'b', 'c', 'd'];
-assert_eq!(Some(expected), slice.take(..4));
-

pub fn take_mut<R, 'a>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>where - R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range -and returns a mutable reference to it.

-

Returns None and does not modify the slice if the given -range is out of bounds.

-

Note that this method only accepts one-sided ranges such as -2.. or ..6, but not 2..6.

-
Examples
-

Taking the first three elements of a slice:

- -
#![feature(slice_take)]
-
-let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
-let mut first_three = slice.take_mut(..3).unwrap();
-
-assert_eq!(slice, &mut ['d']);
-assert_eq!(first_three, &mut ['a', 'b', 'c']);
-

Taking the last two elements of a slice:

- -
#![feature(slice_take)]
-
-let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
-let mut tail = slice.take_mut(2..).unwrap();
-
-assert_eq!(slice, &mut ['a', 'b']);
-assert_eq!(tail, &mut ['c', 'd']);
-

Getting None when range is out of bounds:

- -
#![feature(slice_take)]
-
-let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
-
-assert_eq!(None, slice.take_mut(5..));
-assert_eq!(None, slice.take_mut(..5));
-assert_eq!(None, slice.take_mut(..=4));
-let expected: &mut [_] = &mut ['a', 'b', 'c', 'd'];
-assert_eq!(Some(expected), slice.take_mut(..4));
-

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference -to it.

-

Returns None if the slice is empty.

-
Examples
-
#![feature(slice_take)]
-
-let mut slice: &[_] = &['a', 'b', 'c'];
-let first = slice.take_first().unwrap();
-
-assert_eq!(slice, &['b', 'c']);
-assert_eq!(first, &'a');
-

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable -reference to it.

-

Returns None if the slice is empty.

-
Examples
-
#![feature(slice_take)]
-
-let mut slice: &mut [_] = &mut ['a', 'b', 'c'];
-let first = slice.take_first_mut().unwrap();
-*first = 'd';
-
-assert_eq!(slice, &['b', 'c']);
-assert_eq!(first, &'d');
-

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference -to it.

-

Returns None if the slice is empty.

-
Examples
-
#![feature(slice_take)]
-
-let mut slice: &[_] = &['a', 'b', 'c'];
-let last = slice.take_last().unwrap();
-
-assert_eq!(slice, &['a', 'b']);
-assert_eq!(last, &'c');
-

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable -reference to it.

-

Returns None if the slice is empty.

-
Examples
-
#![feature(slice_take)]
-
-let mut slice: &mut [_] = &mut ['a', 'b', 'c'];
-let last = slice.take_last_mut().unwrap();
-*last = 'd';
-
-assert_eq!(slice, &['a', 'b']);
-assert_eq!(last, &'d');
-

pub unsafe fn get_many_unchecked_mut<const N: usize>( - &mut self, - indices: [usize; N] -) -> [&mut T; N]

🔬This is a nightly-only experimental API. (get_many_mut)

Returns mutable references to many indices at once, without doing any checks.

-

For a safe alternative see get_many_mut.

-
Safety
-

Calling this method with overlapping or out-of-bounds indices is undefined behavior -even if the resulting references are not used.

-
Examples
-
#![feature(get_many_mut)]
-
-let x = &mut [1, 2, 4];
-
-unsafe {
-    let [a, b] = x.get_many_unchecked_mut([0, 2]);
-    *a *= 10;
-    *b *= 100;
-}
-assert_eq!(x, &[10, 2, 400]);
-

pub fn get_many_mut<const N: usize>( - &mut self, - indices: [usize; N] -) -> Result<[&mut T; N], GetManyMutError<N>>

🔬This is a nightly-only experimental API. (get_many_mut)

Returns mutable references to many indices at once.

-

Returns an error if any index is out-of-bounds, or if the same index was -passed more than once.

-
Examples
-
#![feature(get_many_mut)]
-
-let v = &mut [1, 2, 3];
-if let Ok([a, b]) = v.get_many_mut([0, 2]) {
-    *a = 413;
-    *b = 612;
-}
-assert_eq!(v, &[413, 2, 612]);
-

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

-

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses -the ordering defined by [f64::total_cmp].

-
Current implementation
-

This uses the same sorting algorithm as sort_unstable_by.

-
Examples
-
#![feature(sort_floats)]
-let mut v = [2.6, -5e-8, f64::NAN, 8.29, f64::INFINITY, -1.0, 0.0, -f64::INFINITY, -0.0];
-
-v.sort_floats();
-let sorted = [-f64::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f64::INFINITY, f64::NAN];
-assert_eq!(&v[..8], &sorted[..8]);
-assert!(v[8].is_nan());
-

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

-

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses -the ordering defined by [f32::total_cmp].

-
Current implementation
-

This uses the same sorting algorithm as sort_unstable_by.

-
Examples
-
#![feature(sort_floats)]
-let mut v = [2.6, -5e-8, f32::NAN, 8.29, f32::INFINITY, -1.0, 0.0, -f32::INFINITY, -0.0];
-
-v.sort_floats();
-let sorted = [-f32::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f32::INFINITY, f32::NAN];
-assert_eq!(&v[..8], &sorted[..8]);
-assert!(v[8].is_nan());
-

Trait Implementations§

source§

impl<T, const N: usize> AsMut<[T]> for Vec<T, N>

source§

fn as_mut(&mut self) -> &mut [T]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T, const N: usize> AsMut<Vec<T, N>> for Vec<T, N>

source§

fn as_mut(&mut self) -> &mut Vec<T, N>

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T, const N: usize> AsRef<[T]> for Vec<T, N>

source§

fn as_ref(&self) -> &[T]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T, const N: usize> AsRef<Vec<T, N>> for Vec<T, N>

source§

fn as_ref(&self) -> &Vec<T, N>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T, const N: usize> Clone for Vec<T, N>where - T: Clone,

source§

fn clone(&self) -> Vec<T, N>

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, const N: usize> Debug for Vec<T, N>where - T: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<T, const N: usize> Default for Vec<T, N>

source§

fn default() -> Vec<T, N>

Returns the “default value” for a type. Read more
source§

impl<T, const N: usize> Deref for Vec<T, N>

§

type Target = [T]

The resulting type after dereferencing.
source§

fn deref(&self) -> &[T]

Dereferences the value.
source§

impl<T, const N: usize> DerefMut for Vec<T, N>

source§

fn deref_mut(&mut self) -> &mut [T]

Mutably dereferences the value.
source§

impl<T, const N: usize> Drop for Vec<T, N>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'a, T, const N: usize> Extend<&'a T> for Vec<T, N>where - T: 'a + Copy,

source§

fn extend<I>(&mut self, iter: I)where - I: IntoIterator<Item = &'a T>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, const N: usize> Extend<T> for Vec<T, N>

source§

fn extend<I>(&mut self, iter: I)where - I: IntoIterator<Item = T>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, const N: usize> FromIterator<T> for Vec<T, N>

source§

fn from_iter<I>(iter: I) -> Vec<T, N>where - I: IntoIterator<Item = T>,

Creates a value from an iterator. Read more
source§

impl<T, const N: usize> Hash for Vec<T, N>where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl<T, const N: usize> Hash for Vec<T, N>where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

Feeds this value into the given Hasher.
source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher.
source§

impl<'a, T, const N: usize> IntoIterator for &'a Vec<T, N>

§

type Item = &'a T

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <&'a Vec<T, N> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, T, const N: usize> IntoIterator for &'a mut Vec<T, N>

§

type Item = &'a mut T

The type of the elements being iterated over.
§

type IntoIter = IterMut<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <&'a mut Vec<T, N> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, const N: usize> IntoIterator for Vec<T, N>

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T, N>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <Vec<T, N> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, const N: usize> Ord for Vec<T, N>where - T: Ord,

source§

fn cmp(&self, other: &Vec<T, N>) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<A, B, const N: usize> PartialEq<&[B]> for Vec<A, N>where - A: PartialEq<B>,

source§

fn eq(&self, other: &&[B]) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize, const M: usize> PartialEq<&[B; M]> for Vec<A, N>where - A: PartialEq<B>,

source§

fn eq(&self, other: &&[B; M]) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<&mut [B]> for Vec<A, N>where - A: PartialEq<B>,

source§

fn eq(&self, other: &&mut [B]) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<[B]> for Vec<A, N>where - A: PartialEq<B>,

source§

fn eq(&self, other: &[B]) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize, const M: usize> PartialEq<[B; M]> for Vec<A, N>where - A: PartialEq<B>,

source§

fn eq(&self, other: &[B; M]) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<Vec<A, N>> for &[B]where - A: PartialEq<B>,

source§

fn eq(&self, other: &Vec<A, N>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<Vec<A, N>> for &mut [B]where - A: PartialEq<B>,

source§

fn eq(&self, other: &Vec<A, N>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<Vec<A, N>> for [B]where - A: PartialEq<B>,

source§

fn eq(&self, other: &Vec<A, N>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N1: usize, const N2: usize> PartialEq<Vec<B, N2>> for Vec<A, N1>where - A: PartialEq<B>,

source§

fn eq(&self, other: &Vec<B, N2>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<T, const N1: usize, const N2: usize> PartialOrd<Vec<T, N2>> for Vec<T, N1>where - T: PartialOrd<T>,

source§

fn partial_cmp(&self, other: &Vec<T, N2>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl<'a, T, const N: usize> TryFrom<&'a [T]> for Vec<T, N>where - T: Clone,

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from( - slice: &'a [T] -) -> Result<Vec<T, N>, <Vec<T, N> as TryFrom<&'a [T]>>::Error>

Performs the conversion.
source§

impl<const N: usize> Write for Vec<u8, N>

source§

fn write_str(&mut self, s: &str) -> Result<(), Error>

Writes a string slice into this writer, returning whether the write -succeeded. Read more
1.1.0§

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a [char] into this writer, returning whether the write succeeded. Read more
1.0.0§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the [write!] macro with implementors of this trait. Read more
source§

impl<T, const N: usize> Eq for Vec<T, N>where - T: Eq,

Auto Trait Implementations§

§

impl<T, const N: usize> RefUnwindSafe for Vec<T, N>where - T: RefUnwindSafe,

§

impl<T, const N: usize> Send for Vec<T, N>where - T: Send,

§

impl<T, const N: usize> Sync for Vec<T, N>where - T: Sync,

§

impl<T, const N: usize> Unpin for Vec<T, N>where - T: Unpin,

§

impl<T, const N: usize> UnwindSafe for Vec<T, N>where - T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/type.FnvIndexMap.html b/docs/doc/arduboy_rust/heapless/type.FnvIndexMap.html deleted file mode 100644 index 1adab99..0000000 --- a/docs/doc/arduboy_rust/heapless/type.FnvIndexMap.html +++ /dev/null @@ -1,272 +0,0 @@ -FnvIndexMap in arduboy_rust::heapless - Rust
pub type FnvIndexMap<K, V, const N: usize> = IndexMap<K, V, BuildHasherDefault<Hasher>, N>;
Expand description

A heapless::IndexMap using the default FNV hasher

-

A list of all Methods and Traits available for FnvIndexMap can be found in -the heapless::IndexMap documentation.

-

Examples

-
use heapless::FnvIndexMap;
-
-// A hash map with a capacity of 16 key-value pairs allocated on the stack
-let mut book_reviews = FnvIndexMap::<_, _, 16>::new();
-
-// review some books.
-book_reviews.insert("Adventures of Huckleberry Finn",    "My favorite book.").unwrap();
-book_reviews.insert("Grimms' Fairy Tales",               "Masterpiece.").unwrap();
-book_reviews.insert("Pride and Prejudice",               "Very enjoyable.").unwrap();
-book_reviews.insert("The Adventures of Sherlock Holmes", "Eye lyked it alot.").unwrap();
-
-// check for a specific one.
-if !book_reviews.contains_key("Les Misérables") {
-    println!("We've got {} reviews, but Les Misérables ain't one.",
-             book_reviews.len());
-}
-
-// oops, this review has a lot of spelling mistakes, let's delete it.
-book_reviews.remove("The Adventures of Sherlock Holmes");
-
-// look up the values associated with some keys.
-let to_find = ["Pride and Prejudice", "Alice's Adventure in Wonderland"];
-for book in &to_find {
-    match book_reviews.get(book) {
-        Some(review) => println!("{}: {}", book, review),
-        None => println!("{} is unreviewed.", book)
-    }
-}
-
-// iterate over everything.
-for (book, review) in &book_reviews {
-    println!("{}: \"{}\"", book, review);
-}
-

Aliased Type§

struct FnvIndexMap<K, V, const N: usize> { /* private fields */ }

Implementations§

source§

impl<K, V, S, const N: usize> IndexMap<K, V, BuildHasherDefault<S>, N>

source

pub const fn new() -> IndexMap<K, V, BuildHasherDefault<S>, N>

Creates an empty IndexMap.

-
source§

impl<K, V, S, const N: usize> IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher,

source

pub fn capacity(&self) -> usize

Returns the number of elements the map can hold

-
source

pub fn keys(&self) -> impl Iterator<Item = &K>

Return an iterator over the keys of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for key in map.keys() {
-    println!("{}", key);
-}
-
source

pub fn values(&self) -> impl Iterator<Item = &V>

Return an iterator over the values of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for val in map.values() {
-    println!("{}", val);
-}
-
source

pub fn values_mut(&mut self) -> impl Iterator<Item = &mut V>

Return an iterator over mutable references to the the values of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for val in map.values_mut() {
-    *val += 10;
-}
-
-for val in map.values() {
-    println!("{}", val);
-}
-
source

pub fn iter(&self) -> Iter<'_, K, V>

Return an iterator over the key-value pairs of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for (key, val) in map.iter() {
-    println!("key: {} val: {}", key, val);
-}
-
source

pub fn iter_mut(&mut self) -> IterMut<'_, K, V>

Return an iterator over the key-value pairs of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for (_, val) in map.iter_mut() {
-    *val = 2;
-}
-
-for (key, val) in &map {
-    println!("key: {} val: {}", key, val);
-}
-
source

pub fn first(&self) -> Option<(&K, &V)>

Get the first key-value pair

-

Computes in O(1) time

-
source

pub fn first_mut(&mut self) -> Option<(&K, &mut V)>

Get the first key-value pair, with mutable access to the value

-

Computes in O(1) time

-
source

pub fn last(&self) -> Option<(&K, &V)>

Get the last key-value pair

-

Computes in O(1) time

-
source

pub fn last_mut(&mut self) -> Option<(&K, &mut V)>

Get the last key-value pair, with mutable access to the value

-

Computes in O(1) time

-
source

pub fn entry(&mut self, key: K) -> Entry<'_, K, V, N>

Returns an entry for the corresponding key

- -
use heapless::FnvIndexMap;
-use heapless::Entry;
-let mut map = FnvIndexMap::<_, _, 16>::new();
-if let Entry::Vacant(v) = map.entry("a") {
-    v.insert(1).unwrap();
-}
-if let Entry::Occupied(mut o) = map.entry("a") {
-    println!("found {}", *o.get()); // Prints 1
-    o.insert(2);
-}
-// Prints 2
-println!("val: {}", *map.get("a").unwrap());
-
source

pub fn len(&self) -> usize

Return the number of key-value pairs in the map.

-

Computes in O(1) time.

- -
use heapless::FnvIndexMap;
-
-let mut a = FnvIndexMap::<_, _, 16>::new();
-assert_eq!(a.len(), 0);
-a.insert(1, "a").unwrap();
-assert_eq!(a.len(), 1);
-
source

pub fn is_empty(&self) -> bool

Returns true if the map contains no elements.

-

Computes in O(1) time.

- -
use heapless::FnvIndexMap;
-
-let mut a = FnvIndexMap::<_, _, 16>::new();
-assert!(a.is_empty());
-a.insert(1, "a");
-assert!(!a.is_empty());
-
source

pub fn clear(&mut self)

Remove all key-value pairs in the map, while preserving its capacity.

-

Computes in O(n) time.

- -
use heapless::FnvIndexMap;
-
-let mut a = FnvIndexMap::<_, _, 16>::new();
-a.insert(1, "a");
-a.clear();
-assert!(a.is_empty());
-
source

pub fn get<Q>(&self, key: &Q) -> Option<&V>where - K: Borrow<Q>, - Q: Hash + Eq + ?Sized,

Returns a reference to the value corresponding to the key.

-

The key may be any borrowed form of the map’s key type, but Hash and Eq on the borrowed -form must match those for the key type.

-

Computes in O(1) time (average).

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.get(&1), Some(&"a"));
-assert_eq!(map.get(&2), None);
-
source

pub fn contains_key<Q>(&self, key: &Q) -> boolwhere - K: Borrow<Q>, - Q: Eq + Hash + ?Sized,

Returns true if the map contains a value for the specified key.

-

The key may be any borrowed form of the map’s key type, but Hash and Eq on the borrowed -form must match those for the key type.

-

Computes in O(1) time (average).

-
Examples
-
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 8>::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.contains_key(&1), true);
-assert_eq!(map.contains_key(&2), false);
-
source

pub fn get_mut<Q, 'v>(&'v mut self, key: &Q) -> Option<&'v mut V>where - K: Borrow<Q>, - Q: Hash + Eq + ?Sized,

Returns a mutable reference to the value corresponding to the key.

-

The key may be any borrowed form of the map’s key type, but Hash and Eq on the borrowed -form must match those for the key type.

-

Computes in O(1) time (average).

-
Examples
-
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 8>::new();
-map.insert(1, "a").unwrap();
-if let Some(x) = map.get_mut(&1) {
-    *x = "b";
-}
-assert_eq!(map[&1], "b");
-
source

pub fn insert(&mut self, key: K, value: V) -> Result<Option<V>, (K, V)>

Inserts a key-value pair into the map.

-

If an equivalent key already exists in the map: the key remains and retains in its place in -the order, its corresponding value is updated with value and the older value is returned -inside Some(_).

-

If no equivalent key existed in the map: the new key-value pair is inserted, last in order, -and None is returned.

-

Computes in O(1) time (average).

-

See also entry if you you want to insert or modify or if you need to get the index of the -corresponding key-value pair.

-
Examples
-
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 8>::new();
-assert_eq!(map.insert(37, "a"), Ok(None));
-assert_eq!(map.is_empty(), false);
-
-map.insert(37, "b");
-assert_eq!(map.insert(37, "c"), Ok(Some("b")));
-assert_eq!(map[&37], "c");
-
source

pub fn remove<Q>(&mut self, key: &Q) -> Option<V>where - K: Borrow<Q>, - Q: Hash + Eq + ?Sized,

Same as swap_remove

-

Computes in O(1) time (average).

-
Examples
-
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 8>::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.remove(&1), Some("a"));
-assert_eq!(map.remove(&1), None);
-
source

pub fn swap_remove<Q>(&mut self, key: &Q) -> Option<V>where - K: Borrow<Q>, - Q: Hash + Eq + ?Sized,

Remove the key-value pair equivalent to key and return its value.

-

Like Vec::swap_remove, the pair is removed by swapping it with the last element of the map -and popping it off. This perturbs the postion of what used to be the last element!

-

Return None if key is not in map.

-

Computes in O(1) time (average).

-

Trait Implementations§

source§

impl<K, V, S, const N: usize> Clone for IndexMap<K, V, S, N>where - K: Eq + Hash + Clone, - V: Clone, - S: Clone,

source§

fn clone(&self) -> IndexMap<K, V, S, N>

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<K, V, S, const N: usize> Debug for IndexMap<K, V, S, N>where - K: Eq + Hash + Debug, - V: Debug, - S: BuildHasher,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<K, V, S, const N: usize> Default for IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher + Default,

source§

fn default() -> IndexMap<K, V, S, N>

Returns the “default value” for a type. Read more
source§

impl<'a, K, V, S, const N: usize> Extend<(&'a K, &'a V)> for IndexMap<K, V, S, N>where - K: Eq + Hash + Copy, - V: Copy, - S: BuildHasher,

source§

fn extend<I>(&mut self, iterable: I)where - I: IntoIterator<Item = (&'a K, &'a V)>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<K, V, S, const N: usize> Extend<(K, V)> for IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher,

source§

fn extend<I>(&mut self, iterable: I)where - I: IntoIterator<Item = (K, V)>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<K, V, S, const N: usize> FromIterator<(K, V)> for IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher + Default,

source§

fn from_iter<I>(iterable: I) -> IndexMap<K, V, S, N>where - I: IntoIterator<Item = (K, V)>,

Creates a value from an iterator. Read more
source§

impl<'a, K, Q, V, S, const N: usize> Index<&'a Q> for IndexMap<K, V, S, N>where - K: Eq + Hash + Borrow<Q>, - Q: Eq + Hash + ?Sized, - S: BuildHasher,

§

type Output = V

The returned type after indexing.
source§

fn index(&self, key: &Q) -> &V

Performs the indexing (container[index]) operation. Read more
source§

impl<'a, K, Q, V, S, const N: usize> IndexMut<&'a Q> for IndexMap<K, V, S, N>where - K: Eq + Hash + Borrow<Q>, - Q: Eq + Hash + ?Sized, - S: BuildHasher,

source§

fn index_mut(&mut self, key: &Q) -> &mut V

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<K, V, S, const N: usize> IntoIterator for IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher,

§

type Item = (K, V)

The type of the elements being iterated over.
§

type IntoIter = IntoIter<K, V, N>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <IndexMap<K, V, S, N> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<K, V, S, S2, const N: usize, const N2: usize> PartialEq<IndexMap<K, V, S2, N2>> for IndexMap<K, V, S, N>where - K: Eq + Hash, - V: Eq, - S: BuildHasher, - S2: BuildHasher,

source§

fn eq(&self, other: &IndexMap<K, V, S2, N2>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<K, V, S, const N: usize> Eq for IndexMap<K, V, S, N>where - K: Eq + Hash, - V: Eq, - S: BuildHasher,

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/heapless/type.FnvIndexSet.html b/docs/doc/arduboy_rust/heapless/type.FnvIndexSet.html deleted file mode 100644 index 80f5d18..0000000 --- a/docs/doc/arduboy_rust/heapless/type.FnvIndexSet.html +++ /dev/null @@ -1,270 +0,0 @@ -FnvIndexSet in arduboy_rust::heapless - Rust
pub type FnvIndexSet<T, const N: usize> = IndexSet<T, BuildHasherDefault<Hasher>, N>;
Expand description

A heapless::IndexSet using the -default FNV hasher. -A list of all Methods and Traits available for FnvIndexSet can be found in -the heapless::IndexSet documentation.

-

Examples

-
use heapless::FnvIndexSet;
-
-// A hash set with a capacity of 16 elements allocated on the stack
-let mut books = FnvIndexSet::<_, 16>::new();
-
-// Add some books.
-books.insert("A Dance With Dragons").unwrap();
-books.insert("To Kill a Mockingbird").unwrap();
-books.insert("The Odyssey").unwrap();
-books.insert("The Great Gatsby").unwrap();
-
-// Check for a specific one.
-if !books.contains("The Winds of Winter") {
-    println!("We have {} books, but The Winds of Winter ain't one.",
-             books.len());
-}
-
-// Remove a book.
-books.remove("The Odyssey");
-
-// Iterate over everything.
-for book in &books {
-    println!("{}", book);
-}
-

Aliased Type§

struct FnvIndexSet<T, const N: usize> { /* private fields */ }

Implementations§

source§

impl<T, S, const N: usize> IndexSet<T, BuildHasherDefault<S>, N>

source

pub const fn new() -> IndexSet<T, BuildHasherDefault<S>, N>

Creates an empty IndexSet

-
source§

impl<T, S, const N: usize> IndexSet<T, S, N>where - T: Eq + Hash, - S: BuildHasher,

source

pub fn capacity(&self) -> usize

Returns the number of elements the set can hold

-
Examples
-
use heapless::FnvIndexSet;
-
-let set = FnvIndexSet::<i32, 16>::new();
-assert_eq!(set.capacity(), 16);
-
source

pub fn iter(&self) -> Iter<'_, T>

Return an iterator over the values of the set, in their order

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut set = FnvIndexSet::<_, 16>::new();
-set.insert("a").unwrap();
-set.insert("b").unwrap();
-
-// Will print in an arbitrary order.
-for x in set.iter() {
-    println!("{}", x);
-}
-
source

pub fn first(&self) -> Option<&T>

Get the first value

-

Computes in O(1) time

-
source

pub fn last(&self) -> Option<&T>

Get the last value

-

Computes in O(1) time

-
source

pub fn difference<S2, const N2: usize, 'a>( - &'a self, - other: &'a IndexSet<T, S2, N2> -) -> Difference<'a, T, S2, N2>where - S2: BuildHasher,

Visits the values representing the difference, i.e. the values that are in self but not in -other.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-
-// Can be seen as `a - b`.
-for x in a.difference(&b) {
-    println!("{}", x); // Print 1
-}
-
-let diff: FnvIndexSet<_, 16> = a.difference(&b).collect();
-assert_eq!(diff, [1].iter().collect::<FnvIndexSet<_, 16>>());
-
-// Note that difference is not symmetric,
-// and `b - a` means something else:
-let diff: FnvIndexSet<_, 16> = b.difference(&a).collect();
-assert_eq!(diff, [4].iter().collect::<FnvIndexSet<_, 16>>());
-
source

pub fn symmetric_difference<S2, const N2: usize, 'a>( - &'a self, - other: &'a IndexSet<T, S2, N2> -) -> impl Iterator<Item = &'a T>where - S2: BuildHasher,

Visits the values representing the symmetric difference, i.e. the values that are in self -or in other but not in both.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-
-// Print 1, 4 in that order order.
-for x in a.symmetric_difference(&b) {
-    println!("{}", x);
-}
-
-let diff1: FnvIndexSet<_, 16> = a.symmetric_difference(&b).collect();
-let diff2: FnvIndexSet<_, 16> = b.symmetric_difference(&a).collect();
-
-assert_eq!(diff1, diff2);
-assert_eq!(diff1, [1, 4].iter().collect::<FnvIndexSet<_, 16>>());
-
source

pub fn intersection<S2, const N2: usize, 'a>( - &'a self, - other: &'a IndexSet<T, S2, N2> -) -> Intersection<'a, T, S2, N2>where - S2: BuildHasher,

Visits the values representing the intersection, i.e. the values that are both in self and -other.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-
-// Print 2, 3 in that order.
-for x in a.intersection(&b) {
-    println!("{}", x);
-}
-
-let intersection: FnvIndexSet<_, 16> = a.intersection(&b).collect();
-assert_eq!(intersection, [2, 3].iter().collect::<FnvIndexSet<_, 16>>());
-
source

pub fn union<S2, const N2: usize, 'a>( - &'a self, - other: &'a IndexSet<T, S2, N2> -) -> impl Iterator<Item = &'a T>where - S2: BuildHasher,

Visits the values representing the union, i.e. all the values in self or other, without -duplicates.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-
-// Print 1, 2, 3, 4 in that order.
-for x in a.union(&b) {
-    println!("{}", x);
-}
-
-let union: FnvIndexSet<_, 16> = a.union(&b).collect();
-assert_eq!(union, [1, 2, 3, 4].iter().collect::<FnvIndexSet<_, 16>>());
-
source

pub fn len(&self) -> usize

Returns the number of elements in the set.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut v: FnvIndexSet<_, 16> = FnvIndexSet::new();
-assert_eq!(v.len(), 0);
-v.insert(1).unwrap();
-assert_eq!(v.len(), 1);
-
source

pub fn is_empty(&self) -> bool

Returns true if the set contains no elements.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut v: FnvIndexSet<_, 16> = FnvIndexSet::new();
-assert!(v.is_empty());
-v.insert(1).unwrap();
-assert!(!v.is_empty());
-
source

pub fn clear(&mut self)

Clears the set, removing all values.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut v: FnvIndexSet<_, 16> = FnvIndexSet::new();
-v.insert(1).unwrap();
-v.clear();
-assert!(v.is_empty());
-
source

pub fn contains<Q>(&self, value: &Q) -> boolwhere - T: Borrow<Q>, - Q: Eq + Hash + ?Sized,

Returns true if the set contains a value.

-

The value may be any borrowed form of the set’s value type, but Hash and Eq on the -borrowed form must match those for the value type.

-
Examples
-
use heapless::FnvIndexSet;
-
-let set: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-assert_eq!(set.contains(&1), true);
-assert_eq!(set.contains(&4), false);
-
source

pub fn is_disjoint<S2, const N2: usize>( - &self, - other: &IndexSet<T, S2, N2> -) -> boolwhere - S2: BuildHasher,

Returns true if self has no elements in common with other. This is equivalent to -checking for an empty intersection.

-
Examples
-
use heapless::FnvIndexSet;
-
-let a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b = FnvIndexSet::<_, 16>::new();
-
-assert_eq!(a.is_disjoint(&b), true);
-b.insert(4).unwrap();
-assert_eq!(a.is_disjoint(&b), true);
-b.insert(1).unwrap();
-assert_eq!(a.is_disjoint(&b), false);
-
source

pub fn is_subset<S2, const N2: usize>( - &self, - other: &IndexSet<T, S2, N2> -) -> boolwhere - S2: BuildHasher,

Returns true if the set is a subset of another, i.e. other contains at least all the -values in self.

-
Examples
-
use heapless::FnvIndexSet;
-
-let sup: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut set = FnvIndexSet::<_, 16>::new();
-
-assert_eq!(set.is_subset(&sup), true);
-set.insert(2).unwrap();
-assert_eq!(set.is_subset(&sup), true);
-set.insert(4).unwrap();
-assert_eq!(set.is_subset(&sup), false);
-
source

pub fn is_superset<S2, const N2: usize>( - &self, - other: &IndexSet<T, S2, N2> -) -> boolwhere - S2: BuildHasher,

Examples
-
use heapless::FnvIndexSet;
-
-let sub: FnvIndexSet<_, 16> = [1, 2].iter().cloned().collect();
-let mut set = FnvIndexSet::<_, 16>::new();
-
-assert_eq!(set.is_superset(&sub), false);
-
-set.insert(0).unwrap();
-set.insert(1).unwrap();
-assert_eq!(set.is_superset(&sub), false);
-
-set.insert(2).unwrap();
-assert_eq!(set.is_superset(&sub), true);
-
source

pub fn insert(&mut self, value: T) -> Result<bool, T>

Adds a value to the set.

-

If the set did not have this value present, true is returned.

-

If the set did have this value present, false is returned.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut set = FnvIndexSet::<_, 16>::new();
-
-assert_eq!(set.insert(2).unwrap(), true);
-assert_eq!(set.insert(2).unwrap(), false);
-assert_eq!(set.len(), 1);
-
source

pub fn remove<Q>(&mut self, value: &Q) -> boolwhere - T: Borrow<Q>, - Q: Eq + Hash + ?Sized,

Removes a value from the set. Returns true if the value was present in the set.

-

The value may be any borrowed form of the set’s value type, but Hash and Eq on the -borrowed form must match those for the value type.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut set = FnvIndexSet::<_, 16>::new();
-
-set.insert(2).unwrap();
-assert_eq!(set.remove(&2), true);
-assert_eq!(set.remove(&2), false);
-

Trait Implementations§

source§

impl<T, S, const N: usize> Clone for IndexSet<T, S, N>where - T: Eq + Hash + Clone, - S: Clone,

source§

fn clone(&self) -> IndexSet<T, S, N>

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, S, const N: usize> Debug for IndexSet<T, S, N>where - T: Eq + Hash + Debug, - S: BuildHasher,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<T, S, const N: usize> Default for IndexSet<T, S, N>where - T: Eq + Hash, - S: BuildHasher + Default,

source§

fn default() -> IndexSet<T, S, N>

Returns the “default value” for a type. Read more
source§

impl<'a, T, S, const N: usize> Extend<&'a T> for IndexSet<T, S, N>where - T: 'a + Eq + Hash + Copy, - S: BuildHasher,

source§

fn extend<I>(&mut self, iterable: I)where - I: IntoIterator<Item = &'a T>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, S, const N: usize> Extend<T> for IndexSet<T, S, N>where - T: Eq + Hash, - S: BuildHasher,

source§

fn extend<I>(&mut self, iterable: I)where - I: IntoIterator<Item = T>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, S, const N: usize> FromIterator<T> for IndexSet<T, S, N>where - T: Eq + Hash, - S: BuildHasher + Default,

source§

fn from_iter<I>(iter: I) -> IndexSet<T, S, N>where - I: IntoIterator<Item = T>,

Creates a value from an iterator. Read more
source§

impl<T, S1, S2, const N1: usize, const N2: usize> PartialEq<IndexSet<T, S2, N2>> for IndexSet<T, S1, N1>where - T: Eq + Hash, - S1: BuildHasher, - S2: BuildHasher,

source§

fn eq(&self, other: &IndexSet<T, S2, N2>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/index.html b/docs/doc/arduboy_rust/index.html deleted file mode 100644 index e9eb59f..0000000 --- a/docs/doc/arduboy_rust/index.html +++ /dev/null @@ -1,21 +0,0 @@ -arduboy_rust - Rust

Crate arduboy_rust

source ·
Expand description

This is the arduboy_rust crate -To get started import the prelude to your project.

-

Import the module:

- -
use arduboy_rust::prelude::*;
-

Disable C++ libraries

-

Inside the root directory is a file named import_config.h

-

You can disable C++ libraries in the import_config.h file. -Just comment the unused library definition out.

-

Be careful with disabling libraries because:

-
    -
  • The only error you get is something like this if you try to use a function that relies on the library you disabled.
  • -
-
game.90c69b91e57f285-cgu.0:(.text.loop+0x290): undefined reference to `sound_tone'
-
-
    -
  • the benefit of disabling will be important in the feature when I add support for the ArduboyG library etc.
  • -
-

To get an idea, the ArduboyTones Library needs additional 2-3% of the flash memory.

-

Here is the link to the GitHub Repo

-

Modules

  • This is the Module to interact in a save way with the Arduboy2 C++ library.
  • This is the Module to interact in a save way with the ArduboyTones C++ library.
  • This is the Module to interact in a save way with the Arduino C++ library.
  • This is the Module to interact in a save way with the ArdVoice C++ library.
  • Clib functions you can use on the Arduboy
  • This is the Module to interact in a save way with the Arduboy hardware.
  • static friendly data structures that don’t require dynamic memory allocation
  • This is the important one to use this library effective in your project
  • This is the Module to interact in a save way with the Arduino Serial C++ library.
  • This is the module to interact in a save way with the Sprites C++ library.

Macros

  • This is the way to go if you want print some random text
  • Create a const raw pointer to a ardvoice tone as u8, without creating an intermediate reference.
  • Create a const raw pointer to a sprite as u8, without creating an intermediate reference.
  • Create a const raw pointer to a [u8;_] that saves text, without creating an intermediate reference.
  • Create a const raw pointer to a tone sequenze as u16, without creating an intermediate reference.
  • Create a space for Progmem variable

Structs

  • This is the struct to interact in a save way with the ArdVoice C++ library.
  • This is the struct to interact in a save way with the Arduboy2 C++ library.
  • This is the struct to interact in a save way with the ArduboyTones C++ library.
  • This is the struct to store and read structs objects to/from eeprom memory.
  • Use this struct to store and read single bytes to/from eeprom memory.

Enums

  • This item is to chose between Black or White

Constants

  • The standard font size of the arduboy
  • The standard height of the arduboy
  • The standard width of the arduboy
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy2/constant.FONT_SIZE.html b/docs/doc/arduboy_rust/library/arduboy2/constant.FONT_SIZE.html deleted file mode 100644 index cc1a821..0000000 --- a/docs/doc/arduboy_rust/library/arduboy2/constant.FONT_SIZE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy2/constant.FONT_SIZE.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy2/constant.HEIGHT.html b/docs/doc/arduboy_rust/library/arduboy2/constant.HEIGHT.html deleted file mode 100644 index 41a007f..0000000 --- a/docs/doc/arduboy_rust/library/arduboy2/constant.HEIGHT.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy2/constant.HEIGHT.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy2/constant.WIDTH.html b/docs/doc/arduboy_rust/library/arduboy2/constant.WIDTH.html deleted file mode 100644 index e5369d7..0000000 --- a/docs/doc/arduboy_rust/library/arduboy2/constant.WIDTH.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy2/constant.WIDTH.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy2/enum.Color.html b/docs/doc/arduboy_rust/library/arduboy2/enum.Color.html deleted file mode 100644 index 688a806..0000000 --- a/docs/doc/arduboy_rust/library/arduboy2/enum.Color.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy2/enum.Color.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy2/index.html b/docs/doc/arduboy_rust/library/arduboy2/index.html deleted file mode 100644 index 3f44579..0000000 --- a/docs/doc/arduboy_rust/library/arduboy2/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy2/index.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy2/struct.Arduboy2.html b/docs/doc/arduboy_rust/library/arduboy2/struct.Arduboy2.html deleted file mode 100644 index 3acd358..0000000 --- a/docs/doc/arduboy_rust/library/arduboy2/struct.Arduboy2.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy2/struct.Arduboy2.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy2/struct.Point.html b/docs/doc/arduboy_rust/library/arduboy2/struct.Point.html deleted file mode 100644 index 2489584..0000000 --- a/docs/doc/arduboy_rust/library/arduboy2/struct.Point.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy2/struct.Point.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy2/struct.Rect.html b/docs/doc/arduboy_rust/library/arduboy2/struct.Rect.html deleted file mode 100644 index 5bd362b..0000000 --- a/docs/doc/arduboy_rust/library/arduboy2/struct.Rect.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy2/struct.Rect.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone/index.html b/docs/doc/arduboy_rust/library/arduboy_tone/index.html deleted file mode 100644 index 6ac54b1..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/index.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone/struct.ArduboyTones.html b/docs/doc/arduboy_rust/library/arduboy_tone/struct.ArduboyTones.html deleted file mode 100644 index 3341c3d..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone/struct.ArduboyTones.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/struct.ArduboyTones.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A0.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A0.html deleted file mode 100644 index 58468b3..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A0.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A0.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A0H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A0H.html deleted file mode 100644 index 13b5b36..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A0H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A0H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A1.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A1.html deleted file mode 100644 index 31bb85a..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A1.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A1.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A1H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A1H.html deleted file mode 100644 index 301e7ba..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A1H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A1H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A2.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A2.html deleted file mode 100644 index 367c89f..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A2.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A2.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A2H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A2H.html deleted file mode 100644 index ec30de7..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A2H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A2H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A3.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A3.html deleted file mode 100644 index 538393f..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A3.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A3.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A3H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A3H.html deleted file mode 100644 index b375f0c..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A3H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A3H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A4.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A4.html deleted file mode 100644 index 8bd72e6..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A4.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A4.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A4H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A4H.html deleted file mode 100644 index 60959f9..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A4H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A4H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A5.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A5.html deleted file mode 100644 index 54529e4..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A5.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A5.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A5H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A5H.html deleted file mode 100644 index 8255e28..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A5H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A5H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A6.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A6.html deleted file mode 100644 index 368c92a..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A6.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A6.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A6H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A6H.html deleted file mode 100644 index 67cc51a..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A6H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A6H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A7.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A7.html deleted file mode 100644 index c06a41a..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A7.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A7.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A7H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A7H.html deleted file mode 100644 index 8dda15a..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A7H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A7H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A8.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A8.html deleted file mode 100644 index 14ab652..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A8.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A8.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A8H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A8H.html deleted file mode 100644 index 22ecce2..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A8H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A8H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A9.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A9.html deleted file mode 100644 index aaac077..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A9.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A9.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A9H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A9H.html deleted file mode 100644 index 28e225c..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_A9H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A9H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS0.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS0.html deleted file mode 100644 index 7f1bf73..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS0.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS0.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS0H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS0H.html deleted file mode 100644 index 2934884..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS0H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS0H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS1.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS1.html deleted file mode 100644 index a60fa02..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS1.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS1.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS1H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS1H.html deleted file mode 100644 index 0391ce4..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS1H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS1H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS2.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS2.html deleted file mode 100644 index dacd882..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS2.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS2.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS2H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS2H.html deleted file mode 100644 index b68c47b..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS2H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS2H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS3.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS3.html deleted file mode 100644 index a60e5a6..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS3.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS3.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS3H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS3H.html deleted file mode 100644 index 66a7f56..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS3H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS3H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS4.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS4.html deleted file mode 100644 index e39bd3f..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS4.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS4.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS4H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS4H.html deleted file mode 100644 index 561da16..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS4H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS4H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS5.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS5.html deleted file mode 100644 index 834913f..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS5.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS5.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS5H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS5H.html deleted file mode 100644 index f20abbb..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS5H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS5H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS6.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS6.html deleted file mode 100644 index 56f9e9f..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS6.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS6.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS6H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS6H.html deleted file mode 100644 index 7263379..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS6H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS6H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS7.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS7.html deleted file mode 100644 index d0dfa2c..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS7.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS7.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS7H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS7H.html deleted file mode 100644 index eaada7c..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS7H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS7H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS8.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS8.html deleted file mode 100644 index a467a09..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS8.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS8.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS8H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS8H.html deleted file mode 100644 index 0b39cae..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS8H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS8H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS9.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS9.html deleted file mode 100644 index 6015656..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS9.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS9.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS9H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS9H.html deleted file mode 100644 index 4f61229..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_AS9H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS9H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B0.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B0.html deleted file mode 100644 index 4aa141b..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B0.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B0.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B0H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B0H.html deleted file mode 100644 index 535bde8..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B0H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B0H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B1.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B1.html deleted file mode 100644 index af6f4ba..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B1.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B1.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B1H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B1H.html deleted file mode 100644 index 7096006..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B1H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B1H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B2.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B2.html deleted file mode 100644 index 44e52fb..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B2.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B2.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B2H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B2H.html deleted file mode 100644 index a410bce..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B2H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B2H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B3.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B3.html deleted file mode 100644 index 27428fc..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B3.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B3.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B3H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B3H.html deleted file mode 100644 index ef31d01..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B3H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B3H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B4.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B4.html deleted file mode 100644 index 30b90d5..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B4.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B4.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B4H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B4H.html deleted file mode 100644 index be34196..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B4H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B4H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B5.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B5.html deleted file mode 100644 index 8313b20..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B5.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B5.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B5H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B5H.html deleted file mode 100644 index 43974ea..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B5H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B5H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B6.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B6.html deleted file mode 100644 index 7d27175..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B6.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B6.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B6H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B6H.html deleted file mode 100644 index 3dd99ce..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B6H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B6H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B7.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B7.html deleted file mode 100644 index 43751f1..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B7.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B7.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B7H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B7H.html deleted file mode 100644 index 5676ffc..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B7H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B7H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B8.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B8.html deleted file mode 100644 index b2914fb..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B8.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B8.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B8H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B8H.html deleted file mode 100644 index 26ea523..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B8H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B8H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B9.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B9.html deleted file mode 100644 index 993a34a..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B9.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B9.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B9H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B9H.html deleted file mode 100644 index e6f3177..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_B9H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B9H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C0.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C0.html deleted file mode 100644 index 664b4bc..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C0.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C0.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C0H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C0H.html deleted file mode 100644 index 6a3bff2..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C0H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C0H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C1.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C1.html deleted file mode 100644 index 0fab9ff..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C1.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C1.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C1H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C1H.html deleted file mode 100644 index bd35a25..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C1H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C1H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C2.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C2.html deleted file mode 100644 index fc50d1b..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C2.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C2.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C2H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C2H.html deleted file mode 100644 index 3436a23..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C2H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C2H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C3.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C3.html deleted file mode 100644 index f67e5df..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C3.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C3.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C3H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C3H.html deleted file mode 100644 index d7d5c1d..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C3H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C3H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C4.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C4.html deleted file mode 100644 index 3087016..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C4.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C4.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C4H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C4H.html deleted file mode 100644 index 037df13..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C4H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C4H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C5.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C5.html deleted file mode 100644 index 20ae9c4..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C5.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C5.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C5H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C5H.html deleted file mode 100644 index a3d8aae..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C5H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C5H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C6.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C6.html deleted file mode 100644 index 6d55a57..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C6.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C6.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C6H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C6H.html deleted file mode 100644 index a80bb7c..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C6H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C6H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C7.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C7.html deleted file mode 100644 index cd158e4..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C7.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C7.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C7H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C7H.html deleted file mode 100644 index f94f71a..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C7H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C7H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C8.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C8.html deleted file mode 100644 index 8568d7d..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C8.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C8.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C8H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C8H.html deleted file mode 100644 index f1d42dc..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C8H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C8H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C9.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C9.html deleted file mode 100644 index 354a382..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C9.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C9.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C9H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C9H.html deleted file mode 100644 index f8e516c..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_C9H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C9H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS0.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS0.html deleted file mode 100644 index 1b5b84f..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS0.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS0.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS0H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS0H.html deleted file mode 100644 index 681c204..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS0H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS0H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS1.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS1.html deleted file mode 100644 index 83b8ad9..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS1.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS1.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS1H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS1H.html deleted file mode 100644 index 0d91cc3..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS1H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS1H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS2.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS2.html deleted file mode 100644 index 7f2051f..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS2.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS2.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS2H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS2H.html deleted file mode 100644 index 0390c48..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS2H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS2H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS3.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS3.html deleted file mode 100644 index 1560b65..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS3.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS3.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS3H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS3H.html deleted file mode 100644 index f29e2bd..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS3H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS3H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS4.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS4.html deleted file mode 100644 index 8b43487..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS4.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS4.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS4H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS4H.html deleted file mode 100644 index 16db5ff..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS4H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS4H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS5.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS5.html deleted file mode 100644 index 00be3a7..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS5.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS5.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS5H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS5H.html deleted file mode 100644 index b8096d0..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS5H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS5H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS6.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS6.html deleted file mode 100644 index 422e184..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS6.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS6.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS6H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS6H.html deleted file mode 100644 index f291e15..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS6H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS6H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS7.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS7.html deleted file mode 100644 index 980accd..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS7.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS7.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS7H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS7H.html deleted file mode 100644 index fb45224..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS7H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS7H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS8.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS8.html deleted file mode 100644 index 02886f6..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS8.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS8.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS8H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS8H.html deleted file mode 100644 index b184c9c..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS8H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS8H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS9.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS9.html deleted file mode 100644 index 565b196..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS9.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS9.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS9H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS9H.html deleted file mode 100644 index 33ee29b..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_CS9H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS9H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D0.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D0.html deleted file mode 100644 index 2ce4145..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D0.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D0.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D0H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D0H.html deleted file mode 100644 index afbe39a..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D0H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D0H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D1.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D1.html deleted file mode 100644 index 04a3c37..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D1.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D1.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D1H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D1H.html deleted file mode 100644 index a65d3d8..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D1H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D1H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D2.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D2.html deleted file mode 100644 index 3311b4c..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D2.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D2.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D2H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D2H.html deleted file mode 100644 index 45a168c..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D2H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D2H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D3.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D3.html deleted file mode 100644 index d2fa57e..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D3.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D3.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D3H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D3H.html deleted file mode 100644 index 8f21e32..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D3H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D3H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D4.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D4.html deleted file mode 100644 index 80a3e9f..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D4.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D4.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D4H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D4H.html deleted file mode 100644 index 8ab0f58..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D4H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D4H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D5.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D5.html deleted file mode 100644 index 30dfa9a..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D5.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D5.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D5H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D5H.html deleted file mode 100644 index d75c6de..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D5H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D5H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D6.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D6.html deleted file mode 100644 index eab5421..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D6.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D6.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D6H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D6H.html deleted file mode 100644 index 3a3c772..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D6H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D6H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D7.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D7.html deleted file mode 100644 index b5045f0..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D7.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D7.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D7H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D7H.html deleted file mode 100644 index 1e7bbf0..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D7H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D7H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D8.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D8.html deleted file mode 100644 index 0f02295..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D8.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D8.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D8H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D8H.html deleted file mode 100644 index 0b3bbc3..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D8H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D8H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D9.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D9.html deleted file mode 100644 index a46b85e..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D9.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D9.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D9H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D9H.html deleted file mode 100644 index 4ef2443..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_D9H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D9H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS0.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS0.html deleted file mode 100644 index e977a30..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS0.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS0.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS0H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS0H.html deleted file mode 100644 index 2c78b74..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS0H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS0H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS1.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS1.html deleted file mode 100644 index 545eef9..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS1.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS1.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS1H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS1H.html deleted file mode 100644 index abb8815..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS1H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS1H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS2.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS2.html deleted file mode 100644 index 21cddfe..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS2.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS2.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS2H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS2H.html deleted file mode 100644 index 7770f42..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS2H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS2H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS3.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS3.html deleted file mode 100644 index 2814f57..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS3.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS3.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS3H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS3H.html deleted file mode 100644 index f22495d..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS3H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS3H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS4.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS4.html deleted file mode 100644 index 5968238..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS4.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS4.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS4H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS4H.html deleted file mode 100644 index 00cdb0e..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS4H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS4H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS5.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS5.html deleted file mode 100644 index f09968a..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS5.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS5.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS5H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS5H.html deleted file mode 100644 index 764d96d..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS5H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS5H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS6.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS6.html deleted file mode 100644 index 5cfc169..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS6.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS6.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS6H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS6H.html deleted file mode 100644 index 8a5ae87..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS6H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS6H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS7.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS7.html deleted file mode 100644 index cc7148e..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS7.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS7.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS7H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS7H.html deleted file mode 100644 index 0f1bf79..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS7H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS7H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS8.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS8.html deleted file mode 100644 index d4817cd..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS8.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS8.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS8H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS8H.html deleted file mode 100644 index 51a7fa8..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS8H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS8H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS9.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS9.html deleted file mode 100644 index 9aba00b..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS9.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS9.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS9H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS9H.html deleted file mode 100644 index 5488249..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_DS9H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS9H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E0.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E0.html deleted file mode 100644 index 0fbc6f3..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E0.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E0.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E0H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E0H.html deleted file mode 100644 index 285488b..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E0H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E0H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E1.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E1.html deleted file mode 100644 index 6621c03..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E1.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E1.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E1H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E1H.html deleted file mode 100644 index 92991ec..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E1H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E1H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E2.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E2.html deleted file mode 100644 index fa04689..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E2.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E2.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E2H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E2H.html deleted file mode 100644 index ea67f6e..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E2H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E2H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E3.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E3.html deleted file mode 100644 index 54bac49..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E3.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E3.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E3H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E3H.html deleted file mode 100644 index f9a867f..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E3H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E3H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E4.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E4.html deleted file mode 100644 index b31f8ec..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E4.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E4.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E4H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E4H.html deleted file mode 100644 index 3edcbcd..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E4H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E4H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E5.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E5.html deleted file mode 100644 index 5c8d105..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E5.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E5.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E5H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E5H.html deleted file mode 100644 index c21490c..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E5H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E5H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E6.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E6.html deleted file mode 100644 index 81f3358..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E6.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E6.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E6H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E6H.html deleted file mode 100644 index b5e392f..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E6H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E6H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E7.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E7.html deleted file mode 100644 index cc7d7e7..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E7.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E7.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E7H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E7H.html deleted file mode 100644 index c4696ba..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E7H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E7H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E8.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E8.html deleted file mode 100644 index 58ed2ad..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E8.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E8.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E8H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E8H.html deleted file mode 100644 index e4b1f17..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E8H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E8H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E9.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E9.html deleted file mode 100644 index 45c22d8..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E9.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E9.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E9H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E9H.html deleted file mode 100644 index fc38c2d..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_E9H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E9H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F0.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F0.html deleted file mode 100644 index 8d86e0a..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F0.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F0.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F0H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F0H.html deleted file mode 100644 index f0e93ba..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F0H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F0H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F1.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F1.html deleted file mode 100644 index ba27fb1..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F1.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F1.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F1H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F1H.html deleted file mode 100644 index 7e21cab..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F1H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F1H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F2.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F2.html deleted file mode 100644 index fef6f99..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F2.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F2.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F2H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F2H.html deleted file mode 100644 index 0aca775..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F2H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F2H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F3.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F3.html deleted file mode 100644 index 38cf6ed..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F3.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F3.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F3H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F3H.html deleted file mode 100644 index 234b0c2..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F3H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F3H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F4.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F4.html deleted file mode 100644 index dd7b6a2..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F4.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F4.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F4H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F4H.html deleted file mode 100644 index 400733f..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F4H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F4H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F5.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F5.html deleted file mode 100644 index 2db2476..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F5.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F5.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F5H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F5H.html deleted file mode 100644 index 46e4ffd..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F5H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F5H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F6.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F6.html deleted file mode 100644 index baa49e9..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F6.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F6.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F6H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F6H.html deleted file mode 100644 index 7b766cb..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F6H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F6H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F7.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F7.html deleted file mode 100644 index 4b75def..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F7.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F7.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F7H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F7H.html deleted file mode 100644 index 1430f18..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F7H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F7H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F8.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F8.html deleted file mode 100644 index 2ba1de0..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F8.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F8.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F8H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F8H.html deleted file mode 100644 index f5fcccd..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F8H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F8H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F9.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F9.html deleted file mode 100644 index 3c11754..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F9.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F9.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F9H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F9H.html deleted file mode 100644 index 0c44148..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_F9H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F9H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS0.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS0.html deleted file mode 100644 index 2728d23..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS0.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS0.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS0H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS0H.html deleted file mode 100644 index a763370..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS0H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS0H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS1.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS1.html deleted file mode 100644 index c781794..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS1.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS1.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS1H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS1H.html deleted file mode 100644 index f4425d9..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS1H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS1H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS2.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS2.html deleted file mode 100644 index c970f73..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS2.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS2.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS2H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS2H.html deleted file mode 100644 index ed1eb49..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS2H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS2H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS3.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS3.html deleted file mode 100644 index e4bd3dd..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS3.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS3.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS3H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS3H.html deleted file mode 100644 index 0f11dec..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS3H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS3H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS4.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS4.html deleted file mode 100644 index 6b37425..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS4.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS4.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS4H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS4H.html deleted file mode 100644 index 069afb8..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS4H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS4H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS5.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS5.html deleted file mode 100644 index 8558ff0..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS5.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS5.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS5H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS5H.html deleted file mode 100644 index f6f5d1b..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS5H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS5H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS6.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS6.html deleted file mode 100644 index bd54afc..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS6.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS6.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS6H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS6H.html deleted file mode 100644 index 7ff31b3..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS6H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS6H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS7.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS7.html deleted file mode 100644 index 8eb9255..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS7.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS7.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS7H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS7H.html deleted file mode 100644 index ca20c9c..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS7H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS7H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS8.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS8.html deleted file mode 100644 index f29712b..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS8.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS8.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS8H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS8H.html deleted file mode 100644 index aef12af..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS8H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS8H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS9.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS9.html deleted file mode 100644 index 5bf519e..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS9.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS9.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS9H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS9H.html deleted file mode 100644 index 9c5b097..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_FS9H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS9H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G0.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G0.html deleted file mode 100644 index 05aae27..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G0.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G0.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G0H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G0H.html deleted file mode 100644 index 90c4ac7..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G0H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G0H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G1.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G1.html deleted file mode 100644 index d87ef8a..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G1.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G1.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G1H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G1H.html deleted file mode 100644 index 5ad9dca..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G1H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G1H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G2.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G2.html deleted file mode 100644 index f8b3d0b..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G2.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G2.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G2H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G2H.html deleted file mode 100644 index 042ffc0..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G2H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G2H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G3.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G3.html deleted file mode 100644 index 7fdbf34..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G3.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G3.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G3H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G3H.html deleted file mode 100644 index efee1d8..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G3H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G3H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G4.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G4.html deleted file mode 100644 index ce16087..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G4.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G4.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G4H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G4H.html deleted file mode 100644 index 646d03d..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G4H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G4H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G5.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G5.html deleted file mode 100644 index fc40a3e..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G5.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G5.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G5H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G5H.html deleted file mode 100644 index ef21618..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G5H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G5H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G6.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G6.html deleted file mode 100644 index 1ab1077..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G6.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G6.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G6H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G6H.html deleted file mode 100644 index f671ca7..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G6H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G6H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G7.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G7.html deleted file mode 100644 index f30bfc9..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G7.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G7.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G7H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G7H.html deleted file mode 100644 index 142d3f9..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G7H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G7H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G8.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G8.html deleted file mode 100644 index 2efe8e9..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G8.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G8.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G8H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G8H.html deleted file mode 100644 index 0411f55..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G8H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G8H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G9.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G9.html deleted file mode 100644 index e4cf1f7..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G9.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G9.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G9H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G9H.html deleted file mode 100644 index c60c488..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_G9H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G9H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS0.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS0.html deleted file mode 100644 index 088ec34..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS0.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS0.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS0H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS0H.html deleted file mode 100644 index 2bfbc79..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS0H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS0H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS1.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS1.html deleted file mode 100644 index 8f4c4ce..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS1.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS1.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS1H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS1H.html deleted file mode 100644 index 2a87783..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS1H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS1H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS2.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS2.html deleted file mode 100644 index 13b7f21..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS2.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS2.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS2H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS2H.html deleted file mode 100644 index b62f211..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS2H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS2H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS3.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS3.html deleted file mode 100644 index 9e2ec16..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS3.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS3.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS3H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS3H.html deleted file mode 100644 index c37450f..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS3H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS3H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS4.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS4.html deleted file mode 100644 index 5c66841..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS4.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS4.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS4H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS4H.html deleted file mode 100644 index ec62d30..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS4H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS4H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS5.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS5.html deleted file mode 100644 index 0b864e8..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS5.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS5.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS5H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS5H.html deleted file mode 100644 index b7789c7..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS5H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS5H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS6.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS6.html deleted file mode 100644 index 788559a..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS6.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS6.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS6H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS6H.html deleted file mode 100644 index c463793..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS6H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS6H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS7.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS7.html deleted file mode 100644 index 7d7e19b..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS7.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS7.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS7H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS7H.html deleted file mode 100644 index 99bc270..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS7H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS7H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS8.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS8.html deleted file mode 100644 index c299f91..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS8.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS8.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS8H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS8H.html deleted file mode 100644 index 39118a6..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS8H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS8H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS9.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS9.html deleted file mode 100644 index 3eddbe2..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS9.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS9.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS9H.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS9H.html deleted file mode 100644 index f1c18d1..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_GS9H.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS9H.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_REST.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_REST.html deleted file mode 100644 index e183443..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.NOTE_REST.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_REST.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.TONES_END.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.TONES_END.html deleted file mode 100644 index 73c9bd4..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.TONES_END.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.TONES_END.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.TONES_REPEAT.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.TONES_REPEAT.html deleted file mode 100644 index 48dc454..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.TONES_REPEAT.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.TONES_REPEAT.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.TONE_HIGH_VOLUME.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.TONE_HIGH_VOLUME.html deleted file mode 100644 index b2b00f0..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.TONE_HIGH_VOLUME.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.TONE_HIGH_VOLUME.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.VOLUME_ALWAYS_HIGH.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.VOLUME_ALWAYS_HIGH.html deleted file mode 100644 index 0dbd2a4..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.VOLUME_ALWAYS_HIGH.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_ALWAYS_HIGH.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.VOLUME_ALWAYS_NORMAL.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.VOLUME_ALWAYS_NORMAL.html deleted file mode 100644 index 863d382..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.VOLUME_ALWAYS_NORMAL.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_ALWAYS_NORMAL.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.VOLUME_IN_TONE.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.VOLUME_IN_TONE.html deleted file mode 100644 index 79fee58..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/constant.VOLUME_IN_TONE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_IN_TONE.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/index.html b/docs/doc/arduboy_rust/library/arduboy_tone_pitch/index.html deleted file mode 100644 index c89963c..0000000 --- a/docs/doc/arduboy_rust/library/arduboy_tone_pitch/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/index.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduino/fn.delay.html b/docs/doc/arduboy_rust/library/arduino/fn.delay.html deleted file mode 100644 index e4326c0..0000000 --- a/docs/doc/arduboy_rust/library/arduino/fn.delay.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/fn.delay.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduino/fn.random_between.html b/docs/doc/arduboy_rust/library/arduino/fn.random_between.html deleted file mode 100644 index 800d031..0000000 --- a/docs/doc/arduboy_rust/library/arduino/fn.random_between.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/fn.random_between.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduino/fn.random_less_than.html b/docs/doc/arduboy_rust/library/arduino/fn.random_less_than.html deleted file mode 100644 index 06f2a63..0000000 --- a/docs/doc/arduboy_rust/library/arduino/fn.random_less_than.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/fn.random_less_than.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduino/index.html b/docs/doc/arduboy_rust/library/arduino/index.html deleted file mode 100644 index 072e293..0000000 --- a/docs/doc/arduboy_rust/library/arduino/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/arduino/index.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/ardvoice/index.html b/docs/doc/arduboy_rust/library/ardvoice/index.html deleted file mode 100644 index e16e3a6..0000000 --- a/docs/doc/arduboy_rust/library/ardvoice/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/ardvoice/index.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/ardvoice/struct.ArdVoice.html b/docs/doc/arduboy_rust/library/ardvoice/struct.ArdVoice.html deleted file mode 100644 index 7414620..0000000 --- a/docs/doc/arduboy_rust/library/ardvoice/struct.ArdVoice.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/ardvoice/struct.ArdVoice.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/c/fn.strlen.html b/docs/doc/arduboy_rust/library/c/fn.strlen.html deleted file mode 100644 index 60ac9e1..0000000 --- a/docs/doc/arduboy_rust/library/c/fn.strlen.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/fn.strlen.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/c/index.html b/docs/doc/arduboy_rust/library/c/index.html deleted file mode 100644 index 177c81f..0000000 --- a/docs/doc/arduboy_rust/library/c/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/c/index.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/eeprom/struct.EEPROM.html b/docs/doc/arduboy_rust/library/eeprom/struct.EEPROM.html deleted file mode 100644 index 9ad5e6e..0000000 --- a/docs/doc/arduboy_rust/library/eeprom/struct.EEPROM.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/struct.EEPROM.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/eeprom/struct.EEPROMBYTE.html b/docs/doc/arduboy_rust/library/eeprom/struct.EEPROMBYTE.html deleted file mode 100644 index cc7d84c..0000000 --- a/docs/doc/arduboy_rust/library/eeprom/struct.EEPROMBYTE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/struct.EEPROMBYTE.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/eeprom/struct.EEPROMBYTECHECKLESS.html b/docs/doc/arduboy_rust/library/eeprom/struct.EEPROMBYTECHECKLESS.html deleted file mode 100644 index e2e8413..0000000 --- a/docs/doc/arduboy_rust/library/eeprom/struct.EEPROMBYTECHECKLESS.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/struct.EEPROMBYTECHECKLESS.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/sprites/fn.draw_erase.html b/docs/doc/arduboy_rust/library/sprites/fn.draw_erase.html deleted file mode 100644 index ed6699c..0000000 --- a/docs/doc/arduboy_rust/library/sprites/fn.draw_erase.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/sprites/fn.draw_erase.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/sprites/fn.draw_external_mask.html b/docs/doc/arduboy_rust/library/sprites/fn.draw_external_mask.html deleted file mode 100644 index 637ad8f..0000000 --- a/docs/doc/arduboy_rust/library/sprites/fn.draw_external_mask.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/sprites/fn.draw_external_mask.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/sprites/fn.draw_override.html b/docs/doc/arduboy_rust/library/sprites/fn.draw_override.html deleted file mode 100644 index 078e5f1..0000000 --- a/docs/doc/arduboy_rust/library/sprites/fn.draw_override.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/sprites/fn.draw_override.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/sprites/fn.draw_plus_mask.html b/docs/doc/arduboy_rust/library/sprites/fn.draw_plus_mask.html deleted file mode 100644 index 2848e39..0000000 --- a/docs/doc/arduboy_rust/library/sprites/fn.draw_plus_mask.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/sprites/fn.draw_plus_mask.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/sprites/fn.draw_self_masked.html b/docs/doc/arduboy_rust/library/sprites/fn.draw_self_masked.html deleted file mode 100644 index a800ffc..0000000 --- a/docs/doc/arduboy_rust/library/sprites/fn.draw_self_masked.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/sprites/fn.draw_self_masked.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/sprites/index.html b/docs/doc/arduboy_rust/library/sprites/index.html deleted file mode 100644 index e2240c2..0000000 --- a/docs/doc/arduboy_rust/library/sprites/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../../arduboy_rust/prelude/sprites/index.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/macro.f!.html b/docs/doc/arduboy_rust/macro.f!.html deleted file mode 100644 index 0426db3..0000000 --- a/docs/doc/arduboy_rust/macro.f!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.f.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/macro.f.html b/docs/doc/arduboy_rust/macro.f.html deleted file mode 100644 index fc3f5c9..0000000 --- a/docs/doc/arduboy_rust/macro.f.html +++ /dev/null @@ -1,8 +0,0 @@ -f in arduboy_rust - Rust

Macro arduboy_rust::f

source ·
macro_rules! f {
-    ($string_literal:literal) => { ... };
-}
Expand description

This is the way to go if you want print some random text

-

This doesn’t waste the 2kb ram it saves to progmem (28kb) -This automatically saves the given text to the Progmem.

-

Example

-
arduboy.print(f!(b"Random text to print\0"))
-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/macro.get_ardvoice_tone_addr!.html b/docs/doc/arduboy_rust/macro.get_ardvoice_tone_addr!.html deleted file mode 100644 index dc78a40..0000000 --- a/docs/doc/arduboy_rust/macro.get_ardvoice_tone_addr!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.get_ardvoice_tone_addr.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/macro.get_ardvoice_tone_addr.html b/docs/doc/arduboy_rust/macro.get_ardvoice_tone_addr.html deleted file mode 100644 index 14064b5..0000000 --- a/docs/doc/arduboy_rust/macro.get_ardvoice_tone_addr.html +++ /dev/null @@ -1,4 +0,0 @@ -get_ardvoice_tone_addr in arduboy_rust - Rust
macro_rules! get_ardvoice_tone_addr {
-    ( $s:expr ) => { ... };
-}
Expand description

Create a const raw pointer to a ardvoice tone as u8, without creating an intermediate reference.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/macro.get_sprite_addr!.html b/docs/doc/arduboy_rust/macro.get_sprite_addr!.html deleted file mode 100644 index d167c9b..0000000 --- a/docs/doc/arduboy_rust/macro.get_sprite_addr!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.get_sprite_addr.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/macro.get_sprite_addr.html b/docs/doc/arduboy_rust/macro.get_sprite_addr.html deleted file mode 100644 index bb51325..0000000 --- a/docs/doc/arduboy_rust/macro.get_sprite_addr.html +++ /dev/null @@ -1,4 +0,0 @@ -get_sprite_addr in arduboy_rust - Rust
macro_rules! get_sprite_addr {
-    ( $s:expr ) => { ... };
-}
Expand description

Create a const raw pointer to a sprite as u8, without creating an intermediate reference.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/macro.get_string_addr!.html b/docs/doc/arduboy_rust/macro.get_string_addr!.html deleted file mode 100644 index 1e2e060..0000000 --- a/docs/doc/arduboy_rust/macro.get_string_addr!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.get_string_addr.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/macro.get_string_addr.html b/docs/doc/arduboy_rust/macro.get_string_addr.html deleted file mode 100644 index f0c4049..0000000 --- a/docs/doc/arduboy_rust/macro.get_string_addr.html +++ /dev/null @@ -1,4 +0,0 @@ -get_string_addr in arduboy_rust - Rust
macro_rules! get_string_addr {
-    ( $s:expr ) => { ... };
-}
Expand description

Create a const raw pointer to a [u8;_] that saves text, without creating an intermediate reference.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/macro.get_tones_addr!.html b/docs/doc/arduboy_rust/macro.get_tones_addr!.html deleted file mode 100644 index 59c26ea..0000000 --- a/docs/doc/arduboy_rust/macro.get_tones_addr!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.get_tones_addr.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/macro.get_tones_addr.html b/docs/doc/arduboy_rust/macro.get_tones_addr.html deleted file mode 100644 index 5682f9f..0000000 --- a/docs/doc/arduboy_rust/macro.get_tones_addr.html +++ /dev/null @@ -1,4 +0,0 @@ -get_tones_addr in arduboy_rust - Rust
macro_rules! get_tones_addr {
-    ( $s:expr ) => { ... };
-}
Expand description

Create a const raw pointer to a tone sequenze as u16, without creating an intermediate reference.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/macro.progmem!.html b/docs/doc/arduboy_rust/macro.progmem!.html deleted file mode 100644 index 7376712..0000000 --- a/docs/doc/arduboy_rust/macro.progmem!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.progmem.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/macro.progmem.html b/docs/doc/arduboy_rust/macro.progmem.html deleted file mode 100644 index f0a0506..0000000 --- a/docs/doc/arduboy_rust/macro.progmem.html +++ /dev/null @@ -1,44 +0,0 @@ -progmem in arduboy_rust - Rust

Macro arduboy_rust::progmem

source ·
macro_rules! progmem {
-    (
-        $( #[$attr:meta] )*
-        $v:vis $id:ident $name:ident: [$ty:ty; _] = $value:expr;
-        $($rest:tt)*
-    ) => { ... };
-    (
-        $( #[$attr:meta] )*
-        $v:vis $id:ident mut $name:ident: [$ty:ty; _] = $value:expr;
-        $($rest:tt)*
-    ) => { ... };
-    (
-        $( #[$attr:meta] )*
-        $v:vis $id:ident $name:ident: $ty:ty = $value:expr;
-        $($rest:tt)*
-    ) => { ... };
-    (
-        $( #[$attr:meta] )*
-        $v:vis $id:ident mut $name:ident: $ty:ty = $value:expr;
-        $($rest:tt)*
-    ) => { ... };
-    () => { ... };
-}
Expand description

Create a space for Progmem variable

-

Example

-
//for text
-progmem!(
-    static text: [u8; _] = *b"I'm a PROGMEM Text\0";
-);
-//for tone sequence
-progmem!(
-    static tone: [u16; _] = [
-        NOTE_E4, 400, NOTE_D4, 200, NOTE_C4, 400, NOTE_D4, 200, NOTE_C4, 300, NOTE_REST,
-    ];
-);
-//for for bitmap
-progmem!(
-    static image: [u8; _] = [8, 8, 0x81, 0x00, 0x12, 0x40, 0x04, 0x11, 0x00, 0x04];
-);
-
-// for a Vector
-progmem!(
-    static mut walls: Vec<Player, 100> = Vec::new();
-);
-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy2/constant.FONT_SIZE.html b/docs/doc/arduboy_rust/prelude/arduboy2/constant.FONT_SIZE.html deleted file mode 100644 index 20eb6ad..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy2/constant.FONT_SIZE.html +++ /dev/null @@ -1,3 +0,0 @@ -FONT_SIZE in arduboy_rust::prelude::arduboy2 - Rust
pub const FONT_SIZE: u8 = 6;
Expand description

The standard font size of the arduboy

-

this is to calculate with it.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy2/constant.HEIGHT.html b/docs/doc/arduboy_rust/prelude/arduboy2/constant.HEIGHT.html deleted file mode 100644 index 5bfff33..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy2/constant.HEIGHT.html +++ /dev/null @@ -1,3 +0,0 @@ -HEIGHT in arduboy_rust::prelude::arduboy2 - Rust
pub const HEIGHT: u8 = 64;
Expand description

The standard height of the arduboy

-

this is to calculate with it.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy2/constant.WIDTH.html b/docs/doc/arduboy_rust/prelude/arduboy2/constant.WIDTH.html deleted file mode 100644 index 69d3e97..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy2/constant.WIDTH.html +++ /dev/null @@ -1,3 +0,0 @@ -WIDTH in arduboy_rust::prelude::arduboy2 - Rust
pub const WIDTH: u8 = 128;
Expand description

The standard width of the arduboy

-

this is to calculate with it.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy2/enum.Color.html b/docs/doc/arduboy_rust/prelude/arduboy2/enum.Color.html deleted file mode 100644 index 7a4dc8a..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy2/enum.Color.html +++ /dev/null @@ -1,26 +0,0 @@ -Color in arduboy_rust::prelude::arduboy2 - Rust
#[repr(u8)]
pub enum Color { - Black, - White, -}
Expand description

This item is to chose between Black or White

-

Variants§

§

Black

Led is off

-
§

White

Led is on

-

Trait Implementations§

source§

impl Clone for Color

source§

fn clone(&self) -> Color

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Color

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for Color

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl Not for Color

§

type Output = Color

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl Ord for Color

source§

fn cmp(&self, other: &Color) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<Color> for Color

source§

fn eq(&self, other: &Color) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<Color> for Color

source§

fn partial_cmp(&self, other: &Color) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for Color

source§

impl Eq for Color

source§

impl StructuralEq for Color

source§

impl StructuralPartialEq for Color

Auto Trait Implementations§

§

impl RefUnwindSafe for Color

§

impl Send for Color

§

impl Sync for Color

§

impl Unpin for Color

§

impl UnwindSafe for Color

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy2/index.html b/docs/doc/arduboy_rust/prelude/arduboy2/index.html deleted file mode 100644 index 63c8e1f..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy2/index.html +++ /dev/null @@ -1,3 +0,0 @@ -arduboy_rust::prelude::arduboy2 - Rust
Expand description

This is the Module to interact in a save way with the Arduboy2 C++ library.

-

All of the functions are safe wrapped inside the Arduboy2 struct.

-

Structs

  • This is the struct to interact in a save way with the Arduboy2 C++ library.
  • This struct is used by a few Arduboy functions.
  • This struct is used by a few Arduboy functions.

Enums

  • This item is to chose between Black or White

Constants

  • The standard font size of the arduboy
  • The standard height of the arduboy
  • The standard width of the arduboy
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy2/sidebar-items.js b/docs/doc/arduboy_rust/prelude/arduboy2/sidebar-items.js deleted file mode 100644 index 5a2e74d..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy2/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["FONT_SIZE","HEIGHT","WIDTH"],"enum":["Color"],"struct":["Arduboy2","Point","Rect"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy2/struct.Arduboy2.html b/docs/doc/arduboy_rust/prelude/arduboy2/struct.Arduboy2.html deleted file mode 100644 index cd81627..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy2/struct.Arduboy2.html +++ /dev/null @@ -1,379 +0,0 @@ -Arduboy2 in arduboy_rust::prelude::arduboy2 - Rust
pub struct Arduboy2 {}
Expand description

This is the struct to interact in a save way with the Arduboy2 C++ library.

-

Implementations§

source§

impl Arduboy2

source

pub const fn new() -> Self

gives you a new instance of the Arduboy2

-
Example
-
const arduboy: Arduboy2 = Arduboy2::new();
-
source

pub fn begin(&self)

Initialize the hardware, display the boot logo, provide boot utilities, etc. -This function should be called once near the start of the sketch, usually in setup(), before using any other functions in this class. It initializes the display, displays the boot logo, provides “flashlight” and system control features and initializes audio control.

-
source

pub fn clear(&self)

Clear the display buffer and set the text cursor to location 0, 0.

-
source

pub fn display(&self)

Copy the contents of the display buffer to the display. -The contents of the display buffer in RAM are copied to the display and will appear on the screen.

-
source

pub fn display_and_clear_buffer(&self)

Copy the contents of the display buffer to the display. The display buffer will be cleared to zero.

-

Operation is the same as calling display() without parameters except additionally the display buffer will be cleared.

-
source

pub fn draw_fast_hline(&self, x: i16, y: i16, w: u8, color: Color)

Draw a horizontal line.

-
Parameters:
-
    -
  • x The X coordinate of the left start point.
  • -
  • y The Y coordinate of the left start point.
  • -
  • w The width of the line.
  • -
-

color The color of the line (optional; defaults to WHITE).

-
source

pub fn draw_fast_vline(&self, x: i16, y: i16, h: u8, color: Color)

Draw a vertical line.

-
Parameters:
-
    -
  • x The X coordinate of the left start point.
  • -
  • y The Y coordinate of the left start point.
  • -
  • h The height of the line.
  • -
-

color The color of the line (optional; defaults to WHITE).

-
source

pub fn draw_pixel(&self, x: i16, y: i16, color: Color)

Set a single pixel in the display buffer to the specified color.

-
Parameters
-
    -
  • x The X coordinate of the pixel.
  • -
  • y The Y coordinate of the pixel.
  • -
  • color The color of the pixel (optional; defaults to WHITE).
  • -
-

The single pixel specified location in the display buffer is set to the specified color. The values WHITE or BLACK can be used for the color. If the color parameter isn’t included, the pixel will be set to WHITE.

-
source

pub fn fill_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

Draw a filled-in rectangle of a specified width and height.

-
Parameters
-
    -
  • x The X coordinate of the upper left corner.
  • -
  • y The Y coordinate of the upper left corner.
  • -
  • w The width of the rectangle.
  • -
  • h The height of the rectangle.
  • -
-

color The color of the pixel (optional; defaults to WHITE).

-
source

pub fn draw_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

Draw a rectangle of a specified width and height.

-

Parameters

-
    -
  • x The X coordinate of the upper left corner.
  • -
  • y The Y coordinate of the upper left corner.
  • -
  • w The width of the rectangle.
  • -
  • h The height of the rectangle.
  • -
  • color The color of the pixel (optional; defaults to WHITE).
  • -
-
source

pub fn draw_circle(&self, x: i16, y: i16, r: u8, color: Color)

Draw a circle of a given radius.

-

Parameters

-
    -
  • x0 The X coordinate of the circle’s center.
  • -
  • y0 The Y coordinate of the circle’s center.
  • -
  • r The radius of the circle in pixels.
  • -
  • color The circle’s color (optional; defaults to WHITE).
  • -
-
source

pub fn fill_circle(&self, x: i16, y: i16, r: u8, color: Color)

Draw a filled-in circle of a given radius.

-
Parameters
-
    -
  • x The X coordinate of the circle’s center.
  • -
  • y The Y coordinate of the circle’s center.
  • -
  • r The radius of the circle in pixels.
  • -
-

color The circle’s color (optional; defaults to WHITE).

-
source

pub fn fill_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

Draw a filled-in rectangle with rounded corners.

-

Parameters

-
    -
  • x The X coordinate of the left edge.
  • -
  • y The Y coordinate of the top edge.
  • -
  • w The width of the rectangle.
  • -
  • h The height of the rectangle.
  • -
  • r The radius of the semicircles forming the corners.
  • -
  • color The color of the rectangle (optional; defaults to WHITE).
  • -
-
source

pub fn draw_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

Draw a rectangle with rounded corners.

-

Parameters

-
    -
  • x The X coordinate of the left edge.
  • -
  • y The Y coordinate of the top edge.
  • -
  • w The width of the rectangle.
  • -
  • h The height of the rectangle.
  • -
  • r The radius of the semicircles forming the corners.
  • -
  • color The color of the rectangle (optional; defaults to WHITE).
  • -
-
source

pub fn draw_triangle( - &self, - x0: i16, - y0: i16, - x1: i16, - y1: i16, - x2: i16, - y2: i16, - color: Color -)

Draw a triangle given the coordinates of each corner.

-

Parameters

-
    -
  • x0,x1,x2 The X coordinates of the corners.
  • -
  • y0,y1,y2 The Y coordinates of the corners.
  • -
  • color The triangle’s color (optional; defaults to WHITE).
  • -
-

A triangle is drawn by specifying each of the three corner locations. The corners can be at any position with respect to the others.

-
source

pub fn fill_triangle( - &self, - x0: i16, - y0: i16, - x1: i16, - y1: i16, - x2: i16, - y2: i16, - color: Color -)

Draw a filled-in triangle given the coordinates of each corner.

-

Parameters

-
    -
  • x0,x1,x2 The X coordinates of the corners.
  • -
  • y0,y1,y2 The Y coordinates of the corners.
  • -
  • color The triangle’s color (optional; defaults to WHITE).
  • -
-

A triangle is drawn by specifying each of the three corner locations. The corners can be at any position with respect to the others.

-
source

pub fn get_pixel(&self, x: u8, y: u8) -> Color

Returns the state of the given pixel in the screen buffer.

-
Parameters
-
    -
  • x The X coordinate of the pixel.
  • -
  • y The Y coordinate of the pixel.
  • -
-
Returns
-

WHITE if the pixel is on or BLACK if the pixel is off.

-
source

pub fn init_random_seed(&self)

Seed the random number generator with a random value.

-

The Arduino pseudorandom number generator is seeded with the random value returned from a call to generateRandomSeed().

-
source

pub fn just_pressed(&self, button: ButtonSet) -> bool

Check if a button has just been pressed.

-
Parameters
-
    -
  • button The button to test for. Only one button should be specified.
  • -
-
Returns
-

true if the specified button has just been pressed.

-

Return true if the given button was pressed between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.

-

There is no need to check for the release of the button since it must have been released for this function to return true when pressed again.

-

This function should only be used to test a single button.

-
source

pub fn just_released(&self, button: ButtonSet) -> bool

Check if a button has just been released.

-
Parameters
-
    -
  • button The button to test for. Only one button should be specified.
  • -
-
Returns
-

true if the specified button has just been released.

-

Return true if the given button was released between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.

-

There is no need to check for the released of the button since it must have been pressed for this function to return true when pressed again.

-

This function should only be used to test a single button.

-
source

pub fn not_pressed(&self, button: ButtonSet) -> bool

Test if the specified buttons are not pressed.

-
Parameters
-
    -
  • buttons A bit mask indicating which buttons to test. (Can be a single button)
  • -
-
Returns
-

True if all buttons in the provided mask are currently released.

-

Read the state of the buttons and return true if all the buttons in the specified mask are currently released.

-
source

pub fn next_frame(&self) -> bool

Indicate that it’s time to render the next frame.

-
Returns
-

true if it’s time for the next frame.

-

When this function returns true, the amount of time has elapsed to display the next frame, as specified by setFrameRate() or setFrameDuration().

-

This function will normally be called at the start of the rendering loop which would wait for true to be returned before rendering and displaying the next frame.

-
source

pub fn poll_buttons(&self)

Poll the buttons and track their state over time.

-

Read and save the current state of the buttons and also keep track of the button state when this function was previously called. These states are used by the justPressed() and justReleased() functions to determine if a button has changed state between now and the previous call to pollButtons().

-

This function should be called once at the start of each new frame.

-

The justPressed() and justReleased() functions rely on this function.

-
source

pub fn pressed(&self, button: ButtonSet) -> bool

Test if the all of the specified buttons are pressed.

-
Parameters
-
    -
  • buttons A bit mask indicating which buttons to test. (Can be a single button)
  • -
-
Returns
-

true if all buttons in the provided mask are currently pressed.

-

Read the state of the buttons and return true if all of the buttons in the specified mask are being pressed.

-
source

pub fn print(&self, x: impl Printable)

The Arduino Print class is available for writing text to the screen buffer.

-

For an Arduboy2 class object, functions provided by the Arduino Print class can be used to write text to the screen buffer, in the same manner as the Arduino Serial.print(), etc., functions.

-

Print will use the write() function to actually draw each character in the screen buffer, using the library’s font5x7 font. Two character values are handled specially:

-
    -
  • ASCII newline/line feed (\n, 0x0A, inverse white circle). This will move the text cursor position to the start of the next line, based on the current text size.
  • -
  • ASCII carriage return (\r, 0x0D, musical eighth note). This character will be ignored.
  • -
-

Example

- -
let value: i16 = 42;
-
-arduboy.print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the
-                                       // text cursor to the start of the next line
-arduboy.print(f!(b"Hello World\n")); // Prints "Hello World" but does not use the 2kb ram
-arduboy.print(value); // Prints "42"
-arduboy.print("\n\0"); // Sets the text cursor to the start of the next line
-arduboy.print("hello world") // Prints normal [&str]
-
source

pub fn set_cursor(&self, x: i16, y: i16)

Set the location of the text cursor.

-
Parameters
-
    -
  • -

    x The X (horizontal) coordinate, in pixels, for the new location of the text cursor.

    -
  • -
  • -

    y The Y (vertical) coordinate, in pixels, for the new location of the text cursor.

    -
  • -
-

The location of the text cursor is set the the specified coordinates. The coordinates are in pixels. Since the coordinates can specify any pixel location, the text does not have to be placed on specific rows. As with all drawing functions, location 0, 0 is the top left corner of the display. The cursor location represents the top left corner of the next character written.

-
source

pub fn set_frame_rate(&self, rate: u8)

Set the frame rate used by the frame control functions.

-
Parameters
-
    -
  • rate The desired frame rate in frames per second.
  • -
-

Normally, the frame rate would be set to the desired value once, at the start of the game, but it can be changed at any time to alter the frame update rate.

-
source

pub fn set_text_size(&self, size: u8)

Set the text character size.

-
Parameters
-
    -
  • s The text size multiplier. Must be 1 or higher.
  • -
-

Setting a text size of 1 will result in standard size characters with one pixel for each bit in the bitmap for a character. The value specified is a multiplier. A value of 2 will double the width and height. A value of 3 will triple the dimensions, etc.

-
source

pub fn audio_on(&self)

Turn sound on.

-

The system is configured to generate sound. This function sets the sound mode only until the unit is powered off.

-
source

pub fn audio_off(&self)

Turn sound off (mute).

-

The system is configured to not produce sound (mute). This function sets the sound mode only until the unit is powered off.

-
source

pub fn audio_save_on_off(&self)

Save the current sound state in EEPROM.

-

The current sound state, set by on() or off(), is saved to the reserved system area in EEPROM. This allows the state to carry over between power cycles and after uploading a different sketch.

-

Note -EEPROM is limited in the number of times it can be written to. Sketches should not continuously change and then save the state rapidly.

-
source

pub fn audio_toggle(&self)

Toggle the sound on/off state.

-

If the system is configured for sound on, it will be changed to sound off (mute). If sound is off, it will be changed to on. This function sets the sound mode only until the unit is powered off. To save the current mode use saveOnOff().

-
source

pub fn audio_on_and_save(&self)

Combines the use function of audio_on() and audio_save_on_off()

-
source

pub fn audio_enabled(&self) -> bool

Get the current sound state.

-
Returns
-

true if sound is currently enabled (not muted).

-

This function should be used by code that actually generates sound. If true is returned, sound can be produced. If false is returned, sound should be muted.

-
source

pub fn invert(&self, inverse: bool)

Invert the entire display or set it back to normal.

-
Parameters
-
    -
  • inverse true will invert the display. false will set the display to no-inverted.
  • -
-

Calling this function with a value of true will set the display to inverted mode. A pixel with a value of 0 will be on and a pixel set to 1 will be off.

-

Once in inverted mode, the display will remain this way until it is set back to non-inverted mode by calling this function with false.

-
source

pub fn collide_point(&self, point: Point, rect: Rect) -> bool

Test if a point falls within a rectangle.

-

Parameters

-
    -
  • point A structure describing the location of the point.
  • -
  • rect A structure describing the location and size of the rectangle.
  • -
-

Returns -true if the specified point is within the specified rectangle.

-

This function is intended to detemine if an object, whose boundaries are defined by the given rectangle, is in contact with the given point.

-
source

pub fn collide_rect(&self, rect1: Rect, rect2: Rect) -> bool

Test if a rectangle is intersecting with another rectangle.

-

Parameters

-
    -
  • rect1,rect2 Structures describing the size and locations of the rectangles.
  • -
-

Returns -true if the first rectangle is intersecting the second.

-

This function is intended to detemine if an object, whose boundaries are defined by the given rectangle, is in contact with another rectangular object.

-
source

pub fn digital_write_rgb_single(&self, color: u8, val: u8)

Set one of the RGB LEDs digitally, to either fully on or fully off.

-

Parameters

-
    -
  • color The name of the LED to set. The value given should be one of RED_LED, GREEN_LED or BLUE_LED.
  • -
  • val Indicates whether to turn the specified LED on or off. The value given should be RGB_ON or RGB_OFF.
  • -
-

This 2 parameter version of the function will set a single LED within the RGB LED either fully on or fully off. See the description of the 3 parameter version of this function for more details on the RGB LED.

-
source

pub fn digital_write_rgb(&self, red: u8, green: u8, blue: u8)

Set the RGB LEDs digitally, to either fully on or fully off.

-

Parameters

-
    -
  • red,green,blue Use value RGB_ON or RGB_OFF to set each LED.
  • -
-

The RGB LED is actually individual red, green and blue LEDs placed very close together in a single package. This 3 parameter version of the function will set each LED either on or off, to set the RGB LED to 7 different colors at their highest brightness or turn it off.

-
 The colors are as follows:
- RED LED    GREEN LED    BLUE LED    COLOR
- RGB_OFF    RGB_OFF      RGB_OFF     OFF
- RGB_OFF    RGB_OFF      RGB_ON      Blue
- RGB_OFF    RGB_ON       RGB_OFF     Green
- RGB_OFF    RGB_ON       RGB_ON      Cyan
- RGB_ON     RGB_OFF      RGB_OFF     Red
- RGB_ON     RGB_OFF      RGB_ON      Magenta
- RGB_ON     RGB_ON       RGB_OFF     Yellow
- RGB_ON     RGB_ON       RGB_ON      White
-
source

pub fn set_rgb_led_single(&self, color: u8, val: u8)

Set the brightness of one of the RGB LEDs without affecting the others.

-

Parameters

-
    -
  • color The name of the LED to set. The value given should be one of RED_LED, GREEN_LED or BLUE_LED.
  • -
  • val The brightness value for the LED, from 0 to 255.
  • -
-

Note

-
-

In order to use this function, the 3 parameter version must first be called at least once, in order to initialize the hardware.

-
-

This 2 parameter version of the function will set the brightness of a single LED within the RGB LED without affecting the current brightness of the other two. See the description of the 3 parameter version of this function for more details on the RGB LED.

-
source

pub fn set_rgb_led(&self, red: u8, green: u8, blue: u8)

Set the light output of the RGB LED.

-

Parameters

-
    -
  • red,green,blue The brightness value for each LED.
  • -
-

The RGB LED is actually individual red, green and blue LEDs placed very close together in a single package. By setting the brightness of each LED, the RGB LED can show various colors and intensities. The brightness of each LED can be set to a value from 0 (fully off) to 255 (fully on).

-

Note

-
-

Certain libraries that take control of the hardware timers may interfere with the ability of this function to properly control the RGB LED. ArduboyPlaytune is one such library known to do this. The digital_write_rgb() function will still work properly in this case.

-
-

Note

-
-

Many of the Kickstarter Arduboys were accidentally shipped with the RGB LED installed incorrectly. For these units, the green LED cannot be lit. As long as the green led is set to off, setting the red LED will actually control the blue LED and setting the blue LED will actually control the red LED. If the green LED is turned fully on, none of the LEDs will light.

-
-
source

pub fn every_x_frames(&self, frames: u8) -> bool

Indicate if the specified number of frames has elapsed.

-

Parameters

-
    -
  • frames The desired number of elapsed frames.
  • -
-

Returns -true if the specified number of frames has elapsed.

-

This function should be called with the same value each time for a given event. It will return true if the given number of frames has elapsed since the previous frame in which it returned true.

-
Example
-

If you wanted to fire a shot every 5 frames while the A button is being held down:

- -
if arduboy.everyXFrames(5) {
-    if arduboy.pressed(A_BUTTON) {
-        fireShot();
-    }
-}
-
source

pub fn flip_vertical(&self, flipped: bool)

Flip the display vertically or set it back to normal.

-

Parameters

-
    -
  • flipped true will set vertical flip mode. false will set normal vertical orientation.
  • -
-

Calling this function with a value of true will cause the Y coordinate to start at the bottom edge of the display instead of the top, effectively flipping the display vertically.

-

Once in vertical flip mode, it will remain this way until normal vertical mode is set by calling this function with a value of false.

-
source

pub fn flip_horizontal(&self, flipped: bool)

Flip the display horizontally or set it back to normal.

-

Parameters

-
    -
  • flipped true will set horizontal flip mode. false will set normal horizontal orientation.
  • -
-

Calling this function with a value of true will cause the X coordinate to start at the left edge of the display instead of the right, effectively flipping the display horizontally.

-

Once in horizontal flip mode, it will remain this way until normal horizontal mode is set by calling this function with a value of false.

-
source

pub fn set_text_color(&self, color: Color)

Set the text foreground color.

-

Parameters

-
    -
  • color The color to be used for following text. The values WHITE or BLACK should be used.
  • -
-
source

pub fn set_text_background_color(&self, color: Color)

Set the text background color.

-

Parameters

-
    -
  • color The background color to be used for following text. The values WHITE or BLACK should be used.
  • -
-

The background pixels of following characters will be set to the specified color.

-

However, if the background color is set to be the same as the text color, the background will be transparent. Only the foreground pixels will be drawn. The background pixels will remain as they were before the character was drawn.

-
source

pub fn set_cursor_x(&self, x: i16)

Set the X coordinate of the text cursor location.

-

Parameters

-
    -
  • x The X (horizontal) coordinate, in pixels, for the new location of the text cursor.
  • -
-

The X coordinate for the location of the text cursor is set to the specified value, leaving the Y coordinate unchanged. For more details about the text cursor, see the setCursor() function.

-
source

pub fn set_cursor_y(&self, y: i16)

Set the Y coordinate of the text cursor location.

-

Parameters

-
    -
  • y The Y (vertical) coordinate, in pixels, for the new location of the text cursor.
  • -
-

The Y coordinate for the location of the text cursor is set to the specified value, leaving the X coordinate unchanged. For more details about the text cursor, see the setCursor() function.

-
source

pub fn set_text_wrap(&self, w: bool)

Set or disable text wrap mode.

-

Parameters

-
    -
  • w true enables text wrap mode. false disables it.
  • -
-

Text wrap mode is enabled by specifying true. In wrap mode, if a character to be drawn would end up partially or fully past the right edge of the screen (based on the current text size), it will be placed at the start of the next line. The text cursor will be adjusted accordingly.

-

If wrap mode is disabled, characters will always be written at the current text cursor position. A character near the right edge of the screen may only be partially displayed and characters drawn at a position past the right edge of the screen will remain off screen.

-
source

pub fn idle(&self)

Idle the CPU to save power.

-

This puts the CPU in idle sleep mode. You should call this as often as you can for the best power savings. The timer 0 overflow interrupt will wake up the chip every 1ms, so even at 60 FPS a well written app should be able to sleep maybe half the time in between rendering it’s own frames.

-

Auto Trait Implementations§

§

impl RefUnwindSafe for Arduboy2

§

impl Send for Arduboy2

§

impl Sync for Arduboy2

§

impl Unpin for Arduboy2

§

impl UnwindSafe for Arduboy2

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy2/struct.Point.html b/docs/doc/arduboy_rust/prelude/arduboy2/struct.Point.html deleted file mode 100644 index b64a130..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy2/struct.Point.html +++ /dev/null @@ -1,17 +0,0 @@ -Point in arduboy_rust::prelude::arduboy2 - Rust
pub struct Point {
-    pub x: i16,
-    pub y: i16,
-}
Expand description

This struct is used by a few Arduboy functions.

-

Fields§

§x: i16

Position X

-
§y: i16

Position Y

-

Trait Implementations§

source§

impl Clone for Point

source§

fn clone(&self) -> Point

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Point

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for Point

Auto Trait Implementations§

§

impl RefUnwindSafe for Point

§

impl Send for Point

§

impl Sync for Point

§

impl Unpin for Point

§

impl UnwindSafe for Point

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy2/struct.Rect.html b/docs/doc/arduboy_rust/prelude/arduboy2/struct.Rect.html deleted file mode 100644 index 3d72755..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy2/struct.Rect.html +++ /dev/null @@ -1,21 +0,0 @@ -Rect in arduboy_rust::prelude::arduboy2 - Rust
pub struct Rect {
-    pub x: i16,
-    pub y: i16,
-    pub width: u8,
-    pub height: u8,
-}
Expand description

This struct is used by a few Arduboy functions.

-

Fields§

§x: i16

Position X

-
§y: i16

Position Y

-
§width: u8

Rect width

-
§height: u8

Rect height

-

Trait Implementations§

source§

impl Clone for Rect

source§

fn clone(&self) -> Rect

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Rect

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for Rect

Auto Trait Implementations§

§

impl RefUnwindSafe for Rect

§

impl Send for Rect

§

impl Sync for Rect

§

impl Unpin for Rect

§

impl UnwindSafe for Rect

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A0.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A0.html deleted file mode 100644 index 9bdbd21..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A0 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A0: u16 = 28;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A0H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A0H.html deleted file mode 100644 index 1b408be..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A0H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A0H: u16 = _; // 32_796u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A1.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A1.html deleted file mode 100644 index 18f7d05..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A1 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A1: u16 = 55;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A1H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A1H.html deleted file mode 100644 index 6bf017c..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A1H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A1H: u16 = _; // 32_823u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A2.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A2.html deleted file mode 100644 index d8eaf8b..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A2 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A2: u16 = 110;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A2H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A2H.html deleted file mode 100644 index 376f42c..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A2H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A2H: u16 = _; // 32_878u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A3.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A3.html deleted file mode 100644 index cc28195..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A3 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A3: u16 = 220;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A3H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A3H.html deleted file mode 100644 index 115aa0b..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A3H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A3H: u16 = _; // 32_988u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A4.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A4.html deleted file mode 100644 index 15c3ab4..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A4 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A4: u16 = 440;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A4H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A4H.html deleted file mode 100644 index 0a8d8fe..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A4H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A4H: u16 = _; // 33_208u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A5.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A5.html deleted file mode 100644 index 3642c22..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A5 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A5: u16 = 880;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A5H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A5H.html deleted file mode 100644 index 2b3cb61..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A5H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A5H: u16 = _; // 33_648u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A6.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A6.html deleted file mode 100644 index 3b3b0b7..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A6 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A6: u16 = 1760;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A6H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A6H.html deleted file mode 100644 index da8e7a4..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A6H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A6H: u16 = _; // 34_528u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A7.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A7.html deleted file mode 100644 index 08843d2..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A7 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A7: u16 = 3520;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A7H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A7H.html deleted file mode 100644 index f03dd45..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A7H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A7H: u16 = _; // 36_288u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A8.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A8.html deleted file mode 100644 index 29504e0..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A8 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A8: u16 = 7040;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A8H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A8H.html deleted file mode 100644 index 32bd925..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A8H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A8H: u16 = _; // 39_808u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A9.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A9.html deleted file mode 100644 index c85bde1..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A9 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A9: u16 = 14080;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A9H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A9H.html deleted file mode 100644 index 5cc3658..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_A9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_A9H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_A9H: u16 = _; // 46_848u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS0.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS0.html deleted file mode 100644 index b18ebe0..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS0 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS0: u16 = 29;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS0H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS0H.html deleted file mode 100644 index 24bc1ee..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS0H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS0H: u16 = _; // 32_797u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS1.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS1.html deleted file mode 100644 index 6b16447..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS1 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS1: u16 = 58;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS1H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS1H.html deleted file mode 100644 index 226eff9..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS1H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS1H: u16 = _; // 32_826u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS2.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS2.html deleted file mode 100644 index 47c1b28..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS2 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS2: u16 = 117;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS2H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS2H.html deleted file mode 100644 index 83a09f1..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS2H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS2H: u16 = _; // 32_885u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS3.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS3.html deleted file mode 100644 index 55e416e..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS3 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS3: u16 = 233;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS3H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS3H.html deleted file mode 100644 index ab5b80d..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS3H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS3H: u16 = _; // 33_001u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS4.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS4.html deleted file mode 100644 index 1dd3611..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS4 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS4: u16 = 466;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS4H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS4H.html deleted file mode 100644 index abd4d71..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS4H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS4H: u16 = _; // 33_234u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS5.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS5.html deleted file mode 100644 index e354497..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS5 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS5: u16 = 932;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS5H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS5H.html deleted file mode 100644 index 37d9da2..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS5H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS5H: u16 = _; // 33_700u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS6.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS6.html deleted file mode 100644 index 7a95134..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS6 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS6: u16 = 1865;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS6H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS6H.html deleted file mode 100644 index 64ffd22..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS6H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS6H: u16 = _; // 34_633u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS7.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS7.html deleted file mode 100644 index 52cc4f6..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS7 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS7: u16 = 3729;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS7H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS7H.html deleted file mode 100644 index 3ee3d16..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS7H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS7H: u16 = _; // 36_497u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS8.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS8.html deleted file mode 100644 index 21ce141..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS8 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS8: u16 = 7459;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS8H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS8H.html deleted file mode 100644 index 3716c38..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS8H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS8H: u16 = _; // 40_227u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS9.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS9.html deleted file mode 100644 index d1f1be5..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS9 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS9: u16 = 14917;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS9H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS9H.html deleted file mode 100644 index adab626..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_AS9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_AS9H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_AS9H: u16 = _; // 47_685u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B0.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B0.html deleted file mode 100644 index 6a8dd51..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B0 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B0: u16 = 31;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B0H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B0H.html deleted file mode 100644 index ff71a51..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B0H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B0H: u16 = _; // 32_799u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B1.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B1.html deleted file mode 100644 index 9e95dd7..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B1 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B1: u16 = 62;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B1H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B1H.html deleted file mode 100644 index ec046fa..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B1H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B1H: u16 = _; // 32_830u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B2.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B2.html deleted file mode 100644 index 3b5dd30..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B2 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B2: u16 = 123;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B2H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B2H.html deleted file mode 100644 index b6a1d2e..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B2H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B2H: u16 = _; // 32_891u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B3.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B3.html deleted file mode 100644 index 017878c..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B3 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B3: u16 = 247;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B3H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B3H.html deleted file mode 100644 index 51dec4f..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B3H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B3H: u16 = _; // 33_015u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B4.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B4.html deleted file mode 100644 index aad3629..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B4 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B4: u16 = 494;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B4H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B4H.html deleted file mode 100644 index ba811a9..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B4H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B4H: u16 = _; // 33_262u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B5.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B5.html deleted file mode 100644 index af0fd8a..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B5 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B5: u16 = 988;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B5H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B5H.html deleted file mode 100644 index 4e8d028..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B5H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B5H: u16 = _; // 33_756u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B6.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B6.html deleted file mode 100644 index 582e146..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B6 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B6: u16 = 1976;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B6H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B6H.html deleted file mode 100644 index e4c2277..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B6H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B6H: u16 = _; // 34_744u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B7.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B7.html deleted file mode 100644 index 374bfda..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B7 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B7: u16 = 3951;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B7H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B7H.html deleted file mode 100644 index 0e942bb..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B7H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B7H: u16 = _; // 36_719u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B8.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B8.html deleted file mode 100644 index 6312824..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B8 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B8: u16 = 7902;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B8H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B8H.html deleted file mode 100644 index d788912..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B8H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B8H: u16 = _; // 40_670u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B9.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B9.html deleted file mode 100644 index 1a53f02..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B9 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B9: u16 = 15804;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B9H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B9H.html deleted file mode 100644 index c9a908b..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_B9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_B9H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_B9H: u16 = _; // 48_572u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C0.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C0.html deleted file mode 100644 index 9a46bd7..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C0 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C0: u16 = 16;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C0H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C0H.html deleted file mode 100644 index b62c2c0..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C0H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C0H: u16 = _; // 32_784u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C1.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C1.html deleted file mode 100644 index 6f3741e..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C1 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C1: u16 = 33;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C1H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C1H.html deleted file mode 100644 index 6c81275..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C1H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C1H: u16 = _; // 32_801u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C2.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C2.html deleted file mode 100644 index 674bb64..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C2 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C2: u16 = 65;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C2H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C2H.html deleted file mode 100644 index 7c957f7..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C2H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C2H: u16 = _; // 32_833u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C3.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C3.html deleted file mode 100644 index a2af707..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C3 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C3: u16 = 131;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C3H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C3H.html deleted file mode 100644 index e4e05d6..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C3H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C3H: u16 = _; // 32_899u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C4.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C4.html deleted file mode 100644 index da2c99f..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C4 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C4: u16 = 262;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C4H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C4H.html deleted file mode 100644 index 954cf4d..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C4H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C4H: u16 = _; // 33_030u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C5.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C5.html deleted file mode 100644 index 45278c2..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C5 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C5: u16 = 523;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C5H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C5H.html deleted file mode 100644 index 1645ae2..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C5H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C5H: u16 = _; // 33_291u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C6.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C6.html deleted file mode 100644 index f9b9584..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C6 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C6: u16 = 1047;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C6H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C6H.html deleted file mode 100644 index fa7a942..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C6H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C6H: u16 = _; // 33_815u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C7.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C7.html deleted file mode 100644 index a14f006..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C7 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C7: u16 = 2093;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C7H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C7H.html deleted file mode 100644 index 2486fdb..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C7H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C7H: u16 = _; // 34_861u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C8.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C8.html deleted file mode 100644 index 5584c32..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C8 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C8: u16 = 4186;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C8H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C8H.html deleted file mode 100644 index 583a270..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C8H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C8H: u16 = _; // 36_954u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C9.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C9.html deleted file mode 100644 index 32fed90..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C9 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C9: u16 = 8372;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C9H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C9H.html deleted file mode 100644 index ea41078..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_C9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_C9H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_C9H: u16 = _; // 41_140u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS0.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS0.html deleted file mode 100644 index 2c8cde7..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS0 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS0: u16 = 17;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS0H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS0H.html deleted file mode 100644 index 92277d3..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS0H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS0H: u16 = _; // 32_785u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS1.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS1.html deleted file mode 100644 index 770ccc2..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS1 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS1: u16 = 35;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS1H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS1H.html deleted file mode 100644 index 5fc3a1a..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS1H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS1H: u16 = _; // 32_803u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS2.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS2.html deleted file mode 100644 index 06c3014..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS2 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS2: u16 = 69;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS2H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS2H.html deleted file mode 100644 index 076d5d9..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS2H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS2H: u16 = _; // 32_837u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS3.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS3.html deleted file mode 100644 index 64c3b65..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS3 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS3: u16 = 139;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS3H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS3H.html deleted file mode 100644 index 70ac56a..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS3H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS3H: u16 = _; // 32_907u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS4.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS4.html deleted file mode 100644 index e09c93b..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS4 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS4: u16 = 277;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS4H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS4H.html deleted file mode 100644 index 3809e65..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS4H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS4H: u16 = _; // 33_045u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS5.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS5.html deleted file mode 100644 index a4adfaf..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS5 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS5: u16 = 554;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS5H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS5H.html deleted file mode 100644 index 10407b4..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS5H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS5H: u16 = _; // 33_322u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS6.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS6.html deleted file mode 100644 index ea03ba6..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS6 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS6: u16 = 1109;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS6H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS6H.html deleted file mode 100644 index 85bb26f..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS6H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS6H: u16 = _; // 33_877u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS7.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS7.html deleted file mode 100644 index 9786f86..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS7 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS7: u16 = 2218;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS7H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS7H.html deleted file mode 100644 index 20a0e7b..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS7H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS7H: u16 = _; // 34_986u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS8.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS8.html deleted file mode 100644 index 040ec83..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS8 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS8: u16 = 4435;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS8H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS8H.html deleted file mode 100644 index 9c8e8f3..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS8H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS8H: u16 = _; // 37_203u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS9.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS9.html deleted file mode 100644 index f0a7d76..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS9 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS9: u16 = 8870;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS9H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS9H.html deleted file mode 100644 index 149bc6d..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_CS9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_CS9H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_CS9H: u16 = _; // 41_638u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D0.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D0.html deleted file mode 100644 index 3d5457d..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D0 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D0: u16 = 18;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D0H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D0H.html deleted file mode 100644 index 7af03bc..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D0H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D0H: u16 = _; // 32_786u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D1.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D1.html deleted file mode 100644 index 36595f2..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D1 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D1: u16 = 37;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D1H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D1H.html deleted file mode 100644 index c1ebf62..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D1H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D1H: u16 = _; // 32_805u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D2.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D2.html deleted file mode 100644 index 705e635..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D2 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D2: u16 = 73;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D2H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D2H.html deleted file mode 100644 index 36724c0..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D2H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D2H: u16 = _; // 32_841u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D3.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D3.html deleted file mode 100644 index e8707e9..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D3 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D3: u16 = 147;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D3H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D3H.html deleted file mode 100644 index 069a643..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D3H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D3H: u16 = _; // 32_915u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D4.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D4.html deleted file mode 100644 index 292bbd7..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D4 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D4: u16 = 294;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D4H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D4H.html deleted file mode 100644 index 07922df..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D4H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D4H: u16 = _; // 33_062u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D5.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D5.html deleted file mode 100644 index 4c92deb..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D5 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D5: u16 = 587;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D5H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D5H.html deleted file mode 100644 index b2485c0..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D5H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D5H: u16 = _; // 33_355u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D6.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D6.html deleted file mode 100644 index 60f0443..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D6 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D6: u16 = 1175;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D6H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D6H.html deleted file mode 100644 index 6f8216b..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D6H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D6H: u16 = _; // 33_943u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D7.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D7.html deleted file mode 100644 index 89aa97e..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D7 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D7: u16 = 2349;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D7H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D7H.html deleted file mode 100644 index c0b2c30..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D7H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D7H: u16 = _; // 35_117u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D8.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D8.html deleted file mode 100644 index 5f6b141..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D8 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D8: u16 = 4699;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D8H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D8H.html deleted file mode 100644 index bdf0d5c..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D8H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D8H: u16 = _; // 37_467u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D9.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D9.html deleted file mode 100644 index eed8e09..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D9 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D9: u16 = 9397;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D9H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D9H.html deleted file mode 100644 index 1c51730..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_D9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_D9H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_D9H: u16 = _; // 42_165u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS0.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS0.html deleted file mode 100644 index 0d2e049..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS0 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS0: u16 = 19;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS0H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS0H.html deleted file mode 100644 index 1d91aea..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS0H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS0H: u16 = _; // 32_787u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS1.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS1.html deleted file mode 100644 index 06daf8a..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS1 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS1: u16 = 39;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS1H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS1H.html deleted file mode 100644 index a7b50c3..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS1H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS1H: u16 = _; // 32_807u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS2.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS2.html deleted file mode 100644 index 09fa778..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS2 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS2: u16 = 78;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS2H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS2H.html deleted file mode 100644 index 5987c47..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS2H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS2H: u16 = _; // 32_846u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS3.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS3.html deleted file mode 100644 index b7be6ef..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS3 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS3: u16 = 156;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS3H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS3H.html deleted file mode 100644 index 95bc57f..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS3H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS3H: u16 = _; // 32_924u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS4.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS4.html deleted file mode 100644 index 7893df0..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS4 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS4: u16 = 311;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS4H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS4H.html deleted file mode 100644 index 62646fa..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS4H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS4H: u16 = _; // 33_079u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS5.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS5.html deleted file mode 100644 index 994d19d..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS5 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS5: u16 = 622;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS5H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS5H.html deleted file mode 100644 index 2b34459..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS5H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS5H: u16 = _; // 33_390u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS6.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS6.html deleted file mode 100644 index 9fa335c..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS6 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS6: u16 = 1245;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS6H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS6H.html deleted file mode 100644 index 261d3cb..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS6H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS6H: u16 = _; // 34_013u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS7.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS7.html deleted file mode 100644 index d6d587a..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS7 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS7: u16 = 2489;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS7H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS7H.html deleted file mode 100644 index c4e21c5..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS7H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS7H: u16 = _; // 35_257u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS8.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS8.html deleted file mode 100644 index 3f78c83..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS8 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS8: u16 = 4978;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS8H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS8H.html deleted file mode 100644 index 098ba39..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS8H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS8H: u16 = _; // 37_746u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS9.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS9.html deleted file mode 100644 index da15cda..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS9 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS9: u16 = 9956;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS9H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS9H.html deleted file mode 100644 index 2a1480b..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_DS9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_DS9H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_DS9H: u16 = _; // 42_724u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E0.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E0.html deleted file mode 100644 index ddda128..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E0 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E0: u16 = 21;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E0H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E0H.html deleted file mode 100644 index da3910b..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E0H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E0H: u16 = _; // 32_789u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E1.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E1.html deleted file mode 100644 index b14bd19..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E1 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E1: u16 = 41;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E1H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E1H.html deleted file mode 100644 index 36e7a72..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E1H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E1H: u16 = _; // 32_809u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E2.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E2.html deleted file mode 100644 index b235a14..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E2 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E2: u16 = 82;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E2H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E2H.html deleted file mode 100644 index ef9bb5d..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E2H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E2H: u16 = _; // 32_850u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E3.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E3.html deleted file mode 100644 index f27951d..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E3 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E3: u16 = 165;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E3H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E3H.html deleted file mode 100644 index 3998349..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E3H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E3H: u16 = _; // 32_933u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E4.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E4.html deleted file mode 100644 index 0147721..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E4 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E4: u16 = 330;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E4H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E4H.html deleted file mode 100644 index 322ba75..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E4H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E4H: u16 = _; // 33_098u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E5.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E5.html deleted file mode 100644 index 370611a..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E5 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E5: u16 = 659;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E5H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E5H.html deleted file mode 100644 index 946fa79..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E5H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E5H: u16 = _; // 33_427u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E6.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E6.html deleted file mode 100644 index ede6960..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E6 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E6: u16 = 1319;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E6H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E6H.html deleted file mode 100644 index e894c05..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E6H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E6H: u16 = _; // 34_087u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E7.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E7.html deleted file mode 100644 index 300760f..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E7 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E7: u16 = 2637;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E7H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E7H.html deleted file mode 100644 index 7ddf036..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E7H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E7H: u16 = _; // 35_405u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E8.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E8.html deleted file mode 100644 index 6f0ba7a..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E8 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E8: u16 = 5274;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E8H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E8H.html deleted file mode 100644 index 243f69a..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E8H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E8H: u16 = _; // 38_042u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E9.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E9.html deleted file mode 100644 index f119bec..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E9 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E9: u16 = 10548;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E9H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E9H.html deleted file mode 100644 index cd8461a..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_E9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_E9H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_E9H: u16 = _; // 43_316u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F0.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F0.html deleted file mode 100644 index fe36635..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F0 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F0: u16 = 22;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F0H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F0H.html deleted file mode 100644 index 7b27242..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F0H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F0H: u16 = _; // 32_790u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F1.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F1.html deleted file mode 100644 index a496a0b..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F1 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F1: u16 = 44;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F1H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F1H.html deleted file mode 100644 index 1fcda67..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F1H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F1H: u16 = _; // 32_812u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F2.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F2.html deleted file mode 100644 index a076d9a..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F2 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F2: u16 = 87;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F2H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F2H.html deleted file mode 100644 index f525828..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F2H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F2H: u16 = _; // 32_855u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F3.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F3.html deleted file mode 100644 index 5384a66..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F3 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F3: u16 = 175;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F3H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F3H.html deleted file mode 100644 index e9aec2c..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F3H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F3H: u16 = _; // 32_943u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F4.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F4.html deleted file mode 100644 index 57905de..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F4 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F4: u16 = 349;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F4H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F4H.html deleted file mode 100644 index 1114973..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F4H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F4H: u16 = _; // 33_117u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F5.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F5.html deleted file mode 100644 index ab8a333..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F5 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F5: u16 = 698;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F5H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F5H.html deleted file mode 100644 index 2841c0d..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F5H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F5H: u16 = _; // 33_466u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F6.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F6.html deleted file mode 100644 index c885c8c..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F6 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F6: u16 = 1397;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F6H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F6H.html deleted file mode 100644 index f49573a..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F6H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F6H: u16 = _; // 34_165u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F7.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F7.html deleted file mode 100644 index 987c0dc..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F7 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F7: u16 = 2794;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F7H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F7H.html deleted file mode 100644 index a740eba..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F7H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F7H: u16 = _; // 35_562u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F8.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F8.html deleted file mode 100644 index 449d6b3..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F8 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F8: u16 = 5588;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F8H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F8H.html deleted file mode 100644 index d40c677..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F8H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F8H: u16 = _; // 38_356u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F9.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F9.html deleted file mode 100644 index c6bcd10..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F9 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F9: u16 = 11175;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F9H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F9H.html deleted file mode 100644 index 5602bbf..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_F9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_F9H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_F9H: u16 = _; // 43_943u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS0.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS0.html deleted file mode 100644 index 454f5c8..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS0 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS0: u16 = 23;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS0H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS0H.html deleted file mode 100644 index 63903fd..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS0H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS0H: u16 = _; // 32_791u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS1.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS1.html deleted file mode 100644 index 1b47d8e..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS1 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS1: u16 = 46;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS1H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS1H.html deleted file mode 100644 index 7cc3530..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS1H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS1H: u16 = _; // 32_814u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS2.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS2.html deleted file mode 100644 index 1b2730f..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS2 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS2: u16 = 93;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS2H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS2H.html deleted file mode 100644 index ba71111..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS2H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS2H: u16 = _; // 32_861u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS3.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS3.html deleted file mode 100644 index 86b890c..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS3 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS3: u16 = 185;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS3H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS3H.html deleted file mode 100644 index 8e7b29e..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS3H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS3H: u16 = _; // 32_943u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS4.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS4.html deleted file mode 100644 index f24a97a..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS4 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS4: u16 = 370;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS4H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS4H.html deleted file mode 100644 index ae7383a..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS4H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS4H: u16 = _; // 33_138u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS5.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS5.html deleted file mode 100644 index 757690c..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS5 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS5: u16 = 740;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS5H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS5H.html deleted file mode 100644 index 3841818..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS5H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS5H: u16 = _; // 33_508u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS6.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS6.html deleted file mode 100644 index 6c40e31..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS6 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS6: u16 = 1480;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS6H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS6H.html deleted file mode 100644 index fa2b080..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS6H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS6H: u16 = _; // 34_248u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS7.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS7.html deleted file mode 100644 index 9b73b45..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS7 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS7: u16 = 2960;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS7H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS7H.html deleted file mode 100644 index fa4e729..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS7H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS7H: u16 = _; // 35_728u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS8.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS8.html deleted file mode 100644 index 403dc0c..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS8 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS8: u16 = 5920;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS8H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS8H.html deleted file mode 100644 index 2d0a0aa..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS8H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS8H: u16 = _; // 38_688u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS9.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS9.html deleted file mode 100644 index a52379d..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS9 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS9: u16 = 11840;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS9H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS9H.html deleted file mode 100644 index 77f245c..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_FS9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_FS9H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_FS9H: u16 = _; // 44_608u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G0.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G0.html deleted file mode 100644 index 6c2869e..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G0 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G0: u16 = 25;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G0H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G0H.html deleted file mode 100644 index 486dc33..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G0H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G0H: u16 = _; // 32_793u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G1.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G1.html deleted file mode 100644 index ee1eee6..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G1 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G1: u16 = 49;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G1H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G1H.html deleted file mode 100644 index e9f380b..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G1H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G1H: u16 = _; // 32_817u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G2.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G2.html deleted file mode 100644 index 5be9383..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G2 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G2: u16 = 98;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G2H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G2H.html deleted file mode 100644 index 5270828..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G2H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G2H: u16 = _; // 32_866u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G3.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G3.html deleted file mode 100644 index 6c5a9a2..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G3 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G3: u16 = 196;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G3H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G3H.html deleted file mode 100644 index ad48422..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G3H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G3H: u16 = _; // 32_964u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G4.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G4.html deleted file mode 100644 index 7242bdd..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G4 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G4: u16 = 392;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G4H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G4H.html deleted file mode 100644 index 527008f..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G4H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G4H: u16 = _; // 33_160u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G5.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G5.html deleted file mode 100644 index 97d1750..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G5 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G5: u16 = 784;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G5H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G5H.html deleted file mode 100644 index b41077f..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G5H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G5H: u16 = _; // 33_552u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G6.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G6.html deleted file mode 100644 index 246626e..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G6 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G6: u16 = 1568;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G6H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G6H.html deleted file mode 100644 index 5497ca0..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G6H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G6H: u16 = _; // 34_336u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G7.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G7.html deleted file mode 100644 index 8506334..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G7 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G7: u16 = 3136;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G7H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G7H.html deleted file mode 100644 index 5faa3c4..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G7H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G7H: u16 = _; // 35_904u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G8.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G8.html deleted file mode 100644 index e146c3f..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G8 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G8: u16 = 6272;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G8H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G8H.html deleted file mode 100644 index f346554..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G8H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G8H: u16 = _; // 39_040u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G9.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G9.html deleted file mode 100644 index 44629bf..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G9 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G9: u16 = 12544;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G9H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G9H.html deleted file mode 100644 index 706450a..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_G9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_G9H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_G9H: u16 = _; // 45_312u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS0.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS0.html deleted file mode 100644 index 69d0574..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS0.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS0 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS0: u16 = 26;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS0H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS0H.html deleted file mode 100644 index 6774bad..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS0H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS0H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS0H: u16 = _; // 32_794u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS1.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS1.html deleted file mode 100644 index 089088e..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS1.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS1 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS1: u16 = 52;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS1H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS1H.html deleted file mode 100644 index f15e97e..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS1H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS1H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS1H: u16 = _; // 32_820u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS2.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS2.html deleted file mode 100644 index 9fae9da..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS2.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS2 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS2: u16 = 104;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS2H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS2H.html deleted file mode 100644 index 2a44ee5..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS2H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS2H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS2H: u16 = _; // 32_872u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS3.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS3.html deleted file mode 100644 index 660df8a..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS3.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS3 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS3: u16 = 208;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS3H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS3H.html deleted file mode 100644 index ec19c9a..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS3H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS3H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS3H: u16 = _; // 32_976u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS4.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS4.html deleted file mode 100644 index f352416..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS4.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS4 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS4: u16 = 415;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS4H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS4H.html deleted file mode 100644 index e19a051..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS4H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS4H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS4H: u16 = _; // 33_183u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS5.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS5.html deleted file mode 100644 index 257be70..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS5.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS5 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS5: u16 = 831;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS5H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS5H.html deleted file mode 100644 index a120e1f..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS5H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS5H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS5H: u16 = _; // 33_599u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS6.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS6.html deleted file mode 100644 index 9263146..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS6.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS6 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS6: u16 = 1661;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS6H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS6H.html deleted file mode 100644 index 44810aa..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS6H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS6H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS6H: u16 = _; // 34_429u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS7.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS7.html deleted file mode 100644 index 2a7beca..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS7.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS7 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS7: u16 = 3322;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS7H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS7H.html deleted file mode 100644 index e260c77..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS7H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS7H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS7H: u16 = _; // 36_090u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS8.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS8.html deleted file mode 100644 index a0cbc7c..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS8.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS8 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS8: u16 = 6645;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS8H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS8H.html deleted file mode 100644 index 9c36639..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS8H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS8H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS8H: u16 = _; // 39_413u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS9.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS9.html deleted file mode 100644 index 479dbcc..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS9.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS9 in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS9: u16 = 13290;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS9H.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS9H.html deleted file mode 100644 index 2a214d1..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_GS9H.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_GS9H in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_GS9H: u16 = _; // 46_058u16
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_REST.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_REST.html deleted file mode 100644 index b0cdfd2..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.NOTE_REST.html +++ /dev/null @@ -1 +0,0 @@ -NOTE_REST in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const NOTE_REST: u16 = 0;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.TONES_END.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.TONES_END.html deleted file mode 100644 index a89afe7..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.TONES_END.html +++ /dev/null @@ -1 +0,0 @@ -TONES_END in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const TONES_END: u16 = 0x8000;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.TONES_REPEAT.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.TONES_REPEAT.html deleted file mode 100644 index 034c20b..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.TONES_REPEAT.html +++ /dev/null @@ -1 +0,0 @@ -TONES_REPEAT in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const TONES_REPEAT: u16 = 0x8001;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.TONE_HIGH_VOLUME.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.TONE_HIGH_VOLUME.html deleted file mode 100644 index c928101..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.TONE_HIGH_VOLUME.html +++ /dev/null @@ -1 +0,0 @@ -TONE_HIGH_VOLUME in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const TONE_HIGH_VOLUME: u16 = 0x8000;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_ALWAYS_HIGH.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_ALWAYS_HIGH.html deleted file mode 100644 index d1eddde..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_ALWAYS_HIGH.html +++ /dev/null @@ -1 +0,0 @@ -VOLUME_ALWAYS_HIGH in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const VOLUME_ALWAYS_HIGH: u8 = 2;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_ALWAYS_NORMAL.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_ALWAYS_NORMAL.html deleted file mode 100644 index 1346109..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_ALWAYS_NORMAL.html +++ /dev/null @@ -1 +0,0 @@ -VOLUME_ALWAYS_NORMAL in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const VOLUME_ALWAYS_NORMAL: u8 = 1;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_IN_TONE.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_IN_TONE.html deleted file mode 100644 index 5379b74..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/constant.VOLUME_IN_TONE.html +++ /dev/null @@ -1 +0,0 @@ -VOLUME_IN_TONE in arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
pub const VOLUME_IN_TONE: u8 = 0;
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/index.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/index.html deleted file mode 100644 index a91e5dc..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/index.html +++ /dev/null @@ -1,2 +0,0 @@ -arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch - Rust
Expand description

A list of all tones available and used by the Sounds library Arduboy2Tones

-

Constants

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/sidebar-items.js b/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/sidebar-items.js deleted file mode 100644 index e507b93..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/arduboy_tone_pitch/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["NOTE_A0","NOTE_A0H","NOTE_A1","NOTE_A1H","NOTE_A2","NOTE_A2H","NOTE_A3","NOTE_A3H","NOTE_A4","NOTE_A4H","NOTE_A5","NOTE_A5H","NOTE_A6","NOTE_A6H","NOTE_A7","NOTE_A7H","NOTE_A8","NOTE_A8H","NOTE_A9","NOTE_A9H","NOTE_AS0","NOTE_AS0H","NOTE_AS1","NOTE_AS1H","NOTE_AS2","NOTE_AS2H","NOTE_AS3","NOTE_AS3H","NOTE_AS4","NOTE_AS4H","NOTE_AS5","NOTE_AS5H","NOTE_AS6","NOTE_AS6H","NOTE_AS7","NOTE_AS7H","NOTE_AS8","NOTE_AS8H","NOTE_AS9","NOTE_AS9H","NOTE_B0","NOTE_B0H","NOTE_B1","NOTE_B1H","NOTE_B2","NOTE_B2H","NOTE_B3","NOTE_B3H","NOTE_B4","NOTE_B4H","NOTE_B5","NOTE_B5H","NOTE_B6","NOTE_B6H","NOTE_B7","NOTE_B7H","NOTE_B8","NOTE_B8H","NOTE_B9","NOTE_B9H","NOTE_C0","NOTE_C0H","NOTE_C1","NOTE_C1H","NOTE_C2","NOTE_C2H","NOTE_C3","NOTE_C3H","NOTE_C4","NOTE_C4H","NOTE_C5","NOTE_C5H","NOTE_C6","NOTE_C6H","NOTE_C7","NOTE_C7H","NOTE_C8","NOTE_C8H","NOTE_C9","NOTE_C9H","NOTE_CS0","NOTE_CS0H","NOTE_CS1","NOTE_CS1H","NOTE_CS2","NOTE_CS2H","NOTE_CS3","NOTE_CS3H","NOTE_CS4","NOTE_CS4H","NOTE_CS5","NOTE_CS5H","NOTE_CS6","NOTE_CS6H","NOTE_CS7","NOTE_CS7H","NOTE_CS8","NOTE_CS8H","NOTE_CS9","NOTE_CS9H","NOTE_D0","NOTE_D0H","NOTE_D1","NOTE_D1H","NOTE_D2","NOTE_D2H","NOTE_D3","NOTE_D3H","NOTE_D4","NOTE_D4H","NOTE_D5","NOTE_D5H","NOTE_D6","NOTE_D6H","NOTE_D7","NOTE_D7H","NOTE_D8","NOTE_D8H","NOTE_D9","NOTE_D9H","NOTE_DS0","NOTE_DS0H","NOTE_DS1","NOTE_DS1H","NOTE_DS2","NOTE_DS2H","NOTE_DS3","NOTE_DS3H","NOTE_DS4","NOTE_DS4H","NOTE_DS5","NOTE_DS5H","NOTE_DS6","NOTE_DS6H","NOTE_DS7","NOTE_DS7H","NOTE_DS8","NOTE_DS8H","NOTE_DS9","NOTE_DS9H","NOTE_E0","NOTE_E0H","NOTE_E1","NOTE_E1H","NOTE_E2","NOTE_E2H","NOTE_E3","NOTE_E3H","NOTE_E4","NOTE_E4H","NOTE_E5","NOTE_E5H","NOTE_E6","NOTE_E6H","NOTE_E7","NOTE_E7H","NOTE_E8","NOTE_E8H","NOTE_E9","NOTE_E9H","NOTE_F0","NOTE_F0H","NOTE_F1","NOTE_F1H","NOTE_F2","NOTE_F2H","NOTE_F3","NOTE_F3H","NOTE_F4","NOTE_F4H","NOTE_F5","NOTE_F5H","NOTE_F6","NOTE_F6H","NOTE_F7","NOTE_F7H","NOTE_F8","NOTE_F8H","NOTE_F9","NOTE_F9H","NOTE_FS0","NOTE_FS0H","NOTE_FS1","NOTE_FS1H","NOTE_FS2","NOTE_FS2H","NOTE_FS3","NOTE_FS3H","NOTE_FS4","NOTE_FS4H","NOTE_FS5","NOTE_FS5H","NOTE_FS6","NOTE_FS6H","NOTE_FS7","NOTE_FS7H","NOTE_FS8","NOTE_FS8H","NOTE_FS9","NOTE_FS9H","NOTE_G0","NOTE_G0H","NOTE_G1","NOTE_G1H","NOTE_G2","NOTE_G2H","NOTE_G3","NOTE_G3H","NOTE_G4","NOTE_G4H","NOTE_G5","NOTE_G5H","NOTE_G6","NOTE_G6H","NOTE_G7","NOTE_G7H","NOTE_G8","NOTE_G8H","NOTE_G9","NOTE_G9H","NOTE_GS0","NOTE_GS0H","NOTE_GS1","NOTE_GS1H","NOTE_GS2","NOTE_GS2H","NOTE_GS3","NOTE_GS3H","NOTE_GS4","NOTE_GS4H","NOTE_GS5","NOTE_GS5H","NOTE_GS6","NOTE_GS6H","NOTE_GS7","NOTE_GS7H","NOTE_GS8","NOTE_GS8H","NOTE_GS9","NOTE_GS9H","NOTE_REST","TONES_END","TONES_REPEAT","TONE_HIGH_VOLUME","VOLUME_ALWAYS_HIGH","VOLUME_ALWAYS_NORMAL","VOLUME_IN_TONE"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/index.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/index.html deleted file mode 100644 index b6b4661..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/index.html +++ /dev/null @@ -1,3 +0,0 @@ -arduboy_rust::prelude::arduboy_tone - Rust
Expand description

This is the Module to interact in a save way with the ArduboyTones C++ library.

-

You will need to uncomment the ArduboyTones_Library in the import_config.h file.

-

Modules

  • A list of all tones available and used by the Sounds library Arduboy2Tones

Structs

  • This is the struct to interact in a save way with the ArduboyTones C++ library.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/sidebar-items.js b/docs/doc/arduboy_rust/prelude/arduboy_tone/sidebar-items.js deleted file mode 100644 index 883d8cc..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"mod":["arduboy_tone_pitch"],"struct":["ArduboyTones"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/struct.ArduboyTones.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/struct.ArduboyTones.html deleted file mode 100644 index 78cadfb..0000000 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/struct.ArduboyTones.html +++ /dev/null @@ -1,94 +0,0 @@ -ArduboyTones in arduboy_rust::prelude::arduboy_tone - Rust
pub struct ArduboyTones {}
Expand description

This is the struct to interact in a save way with the ArduboyTones C++ library.

-

You will need to uncomment the ArduboyTones_Library in the import_config.h file.

-

Implementations§

source§

impl ArduboyTones

source

pub const fn new() -> ArduboyTones

Get a new instance of ArduboyTones

-
Example
-
const sound: ArduboyTones = ArduboyTones::new();
-
source

pub fn tone(&self, frequency: u16, duration: u32)

Play a single tone.

-
    -
  • freq The frequency of the tone, in hertz.
  • -
  • dur The duration to play the tone for, in 1024ths of a -second (very close to milliseconds). A duration of 0, or if not provided, -means play forever, or until noTone() is called or a new tone or -sequence is started.
  • -
-
source

pub fn tone2( - &self, - frequency1: u16, - duration1: u32, - frequency2: u16, - duration2: u32 -)

Play two tones in sequence.

-
    -
  • freq1,freq2 The frequency of the tone in hertz.
  • -
  • dur1,dur2 The duration to play the tone for, in 1024ths of a -second (very close to milliseconds).
  • -
-
source

pub fn tone3( - &self, - frequency1: u16, - duration1: u32, - frequency2: u16, - duration2: u32, - frequency3: u16, - duration3: u32 -)

Play three tones in sequence.

-
    -
  • freq1,freq2,freq3 The frequency of the tone, in hertz.
  • -
  • dur1,dur2,dur3 The duration to play the tone for, in 1024ths of a -second (very close to milliseconds).
  • -
-
source

pub fn tones(&self, tones: *const u16)

Play a tone sequence from frequency/duration pairs in a PROGMEM array.

-
    -
  • tones A pointer to an array of frequency/duration pairs.
  • -
-

The array must be placed in code space using PROGMEM.

-

See the tone() function for details on the frequency and duration values. -A frequency of 0 for any tone means silence (a musical rest).

-

The last element of the array must be TONES_END or TONES_REPEAT.

-

Example:

- -
progmem!(
-    static sound1:[u8;_]=[220,1000, 0,250, 440,500, 880,2000,TONES_END]
-);
-
-tones(get_tones_addr!(sound1));
-
source

pub fn no_tone(&self)

Stop playing the tone or sequence.

-

If a tone or sequence is playing, it will stop. If nothing -is playing, this function will do nothing.

-
source

pub fn playing(&self) -> bool

Check if a tone or tone sequence is playing.

-
    -
  • return boolean true if playing (even if sound is muted).
  • -
-
source

pub fn tones_in_ram(&self, tones: *mut u32)

Play a tone sequence from frequency/duration pairs in an array in RAM.

-
    -
  • tones A pointer to an array of frequency/duration pairs.
  • -
-

The array must be located in RAM.

-

See the tone() function for details on the frequency and duration values. -A frequency of 0 for any tone means silence (a musical rest).

-

The last element of the array must be TONES_END or TONES_REPEAT.

-

Example:

- -
let sound2: [u16; 9] = [220, 1000, 0, 250, 440, 500, 880, 2000, TONES_END];
-

Using tones(), with the data in PROGMEM, is normally a better -choice. The only reason to use tonesInRAM() would be if dynamically -altering the contents of the array is required.

-
source

pub fn volume_mode(&self, mode: u8)

Set the volume to always normal, always high, or tone controlled.

-

One of the following values should be used:

-
    -
  • VOLUME_IN_TONE The volume of each tone will be specified in the tone -itself.
  • -
  • VOLUME_ALWAYS_NORMAL All tones will play at the normal volume level.
  • -
  • VOLUME_ALWAYS_HIGH All tones will play at the high volume level.
  • -
-

Auto Trait Implementations§

§

impl RefUnwindSafe for ArduboyTones

§

impl Send for ArduboyTones

§

impl Sync for ArduboyTones

§

impl Unpin for ArduboyTones

§

impl UnwindSafe for ArduboyTones

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/ardvoice/index.html b/docs/doc/arduboy_rust/prelude/ardvoice/index.html deleted file mode 100644 index 755f261..0000000 --- a/docs/doc/arduboy_rust/prelude/ardvoice/index.html +++ /dev/null @@ -1,3 +0,0 @@ -arduboy_rust::prelude::ardvoice - Rust
Expand description

This is the Module to interact in a save way with the ArdVoice C++ library.

-

You will need to uncomment the ArdVoice_Library in the import_config.h file.

-

Structs

  • This is the struct to interact in a save way with the ArdVoice C++ library.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/ardvoice/sidebar-items.js b/docs/doc/arduboy_rust/prelude/ardvoice/sidebar-items.js deleted file mode 100644 index 00bdff2..0000000 --- a/docs/doc/arduboy_rust/prelude/ardvoice/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"struct":["ArdVoice"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/ardvoice/struct.ArdVoice.html b/docs/doc/arduboy_rust/prelude/ardvoice/struct.ArdVoice.html deleted file mode 100644 index 2575d3c..0000000 --- a/docs/doc/arduboy_rust/prelude/ardvoice/struct.ArdVoice.html +++ /dev/null @@ -1,19 +0,0 @@ -ArdVoice in arduboy_rust::prelude::ardvoice - Rust
pub struct ArdVoice {}
Expand description

This is the struct to interact in a save way with the ArdVoice C++ library.

-

You will need to uncomment the ArdVoice_Library in the import_config.h file.

-

Implementations§

source§

impl ArdVoice

source

pub const fn new() -> Self

source

pub fn play_voice(&self, audio: *const u8)

source

pub fn play_voice_complex( - &self, - audio: *const u8, - start_time: u32, - end_time: u32, - speed: f32 -)

source

pub fn stop_voice(&self)

source

pub fn is_voice_playing(&self) -> bool

Auto Trait Implementations§

§

impl RefUnwindSafe for ArdVoice

§

impl Send for ArdVoice

§

impl Sync for ArdVoice

§

impl Unpin for ArdVoice

§

impl UnwindSafe for ArdVoice

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/buttons/constant.A.html b/docs/doc/arduboy_rust/prelude/buttons/constant.A.html deleted file mode 100644 index 04b17d6..0000000 --- a/docs/doc/arduboy_rust/prelude/buttons/constant.A.html +++ /dev/null @@ -1,2 +0,0 @@ -A in arduboy_rust::prelude::buttons - Rust

Constant arduboy_rust::prelude::buttons::A

source ·
pub const A: ButtonSet;
Expand description

Just a const for the A button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/buttons/constant.A_BUTTON.html b/docs/doc/arduboy_rust/prelude/buttons/constant.A_BUTTON.html deleted file mode 100644 index c8e010d..0000000 --- a/docs/doc/arduboy_rust/prelude/buttons/constant.A_BUTTON.html +++ /dev/null @@ -1,2 +0,0 @@ -A_BUTTON in arduboy_rust::prelude::buttons - Rust
pub const A_BUTTON: ButtonSet;
Expand description

Just a const for the A button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/buttons/constant.B.html b/docs/doc/arduboy_rust/prelude/buttons/constant.B.html deleted file mode 100644 index e64a708..0000000 --- a/docs/doc/arduboy_rust/prelude/buttons/constant.B.html +++ /dev/null @@ -1,2 +0,0 @@ -B in arduboy_rust::prelude::buttons - Rust

Constant arduboy_rust::prelude::buttons::B

source ·
pub const B: ButtonSet;
Expand description

Just a const for the B button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/buttons/constant.B_BUTTON.html b/docs/doc/arduboy_rust/prelude/buttons/constant.B_BUTTON.html deleted file mode 100644 index 4ca8ed2..0000000 --- a/docs/doc/arduboy_rust/prelude/buttons/constant.B_BUTTON.html +++ /dev/null @@ -1,2 +0,0 @@ -B_BUTTON in arduboy_rust::prelude::buttons - Rust
pub const B_BUTTON: ButtonSet;
Expand description

Just a const for the B button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/buttons/constant.DOWN.html b/docs/doc/arduboy_rust/prelude/buttons/constant.DOWN.html deleted file mode 100644 index c78d1af..0000000 --- a/docs/doc/arduboy_rust/prelude/buttons/constant.DOWN.html +++ /dev/null @@ -1,2 +0,0 @@ -DOWN in arduboy_rust::prelude::buttons - Rust

Constant arduboy_rust::prelude::buttons::DOWN

source ·
pub const DOWN: ButtonSet;
Expand description

Just a const for the DOWN button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/buttons/constant.DOWN_BUTTON.html b/docs/doc/arduboy_rust/prelude/buttons/constant.DOWN_BUTTON.html deleted file mode 100644 index 5aa2694..0000000 --- a/docs/doc/arduboy_rust/prelude/buttons/constant.DOWN_BUTTON.html +++ /dev/null @@ -1,2 +0,0 @@ -DOWN_BUTTON in arduboy_rust::prelude::buttons - Rust
pub const DOWN_BUTTON: ButtonSet;
Expand description

Just a const for the DOWN button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/buttons/constant.LEFT.html b/docs/doc/arduboy_rust/prelude/buttons/constant.LEFT.html deleted file mode 100644 index 9d4de90..0000000 --- a/docs/doc/arduboy_rust/prelude/buttons/constant.LEFT.html +++ /dev/null @@ -1,2 +0,0 @@ -LEFT in arduboy_rust::prelude::buttons - Rust

Constant arduboy_rust::prelude::buttons::LEFT

source ·
pub const LEFT: ButtonSet;
Expand description

Just a const for the LEFT button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/buttons/constant.LEFT_BUTTON.html b/docs/doc/arduboy_rust/prelude/buttons/constant.LEFT_BUTTON.html deleted file mode 100644 index 95256d3..0000000 --- a/docs/doc/arduboy_rust/prelude/buttons/constant.LEFT_BUTTON.html +++ /dev/null @@ -1,2 +0,0 @@ -LEFT_BUTTON in arduboy_rust::prelude::buttons - Rust
pub const LEFT_BUTTON: ButtonSet;
Expand description

Just a const for the LEFT button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/buttons/constant.RIGHT.html b/docs/doc/arduboy_rust/prelude/buttons/constant.RIGHT.html deleted file mode 100644 index 4d0a26a..0000000 --- a/docs/doc/arduboy_rust/prelude/buttons/constant.RIGHT.html +++ /dev/null @@ -1,2 +0,0 @@ -RIGHT in arduboy_rust::prelude::buttons - Rust
pub const RIGHT: ButtonSet;
Expand description

Just a const for the RIGHT button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/buttons/constant.RIGHT_BUTTON.html b/docs/doc/arduboy_rust/prelude/buttons/constant.RIGHT_BUTTON.html deleted file mode 100644 index d7aeae9..0000000 --- a/docs/doc/arduboy_rust/prelude/buttons/constant.RIGHT_BUTTON.html +++ /dev/null @@ -1,2 +0,0 @@ -RIGHT_BUTTON in arduboy_rust::prelude::buttons - Rust
pub const RIGHT_BUTTON: ButtonSet;
Expand description

Just a const for the RIGHT button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/buttons/constant.UP.html b/docs/doc/arduboy_rust/prelude/buttons/constant.UP.html deleted file mode 100644 index 10bccc9..0000000 --- a/docs/doc/arduboy_rust/prelude/buttons/constant.UP.html +++ /dev/null @@ -1,2 +0,0 @@ -UP in arduboy_rust::prelude::buttons - Rust

Constant arduboy_rust::prelude::buttons::UP

source ·
pub const UP: ButtonSet;
Expand description

Just a const for the UP button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/buttons/constant.UP_BUTTON.html b/docs/doc/arduboy_rust/prelude/buttons/constant.UP_BUTTON.html deleted file mode 100644 index 5f23ed9..0000000 --- a/docs/doc/arduboy_rust/prelude/buttons/constant.UP_BUTTON.html +++ /dev/null @@ -1,2 +0,0 @@ -UP_BUTTON in arduboy_rust::prelude::buttons - Rust
pub const UP_BUTTON: ButtonSet;
Expand description

Just a const for the UP button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/buttons/index.html b/docs/doc/arduboy_rust/prelude/buttons/index.html deleted file mode 100644 index 3789ea0..0000000 --- a/docs/doc/arduboy_rust/prelude/buttons/index.html +++ /dev/null @@ -1,2 +0,0 @@ -arduboy_rust::prelude::buttons - Rust
Expand description

A list of all six buttons available on the Arduboy

-

Structs

  • This struct gives the library a understanding what Buttons on the Arduboy are.

Constants

  • Just a const for the A button
  • Just a const for the A button
  • Just a const for the B button
  • Just a const for the B button
  • Just a const for the DOWN button
  • Just a const for the DOWN button
  • Just a const for the LEFT button
  • Just a const for the LEFT button
  • Just a const for the RIGHT button
  • Just a const for the RIGHT button
  • Just a const for the UP button
  • Just a const for the UP button
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/buttons/sidebar-items.js b/docs/doc/arduboy_rust/prelude/buttons/sidebar-items.js deleted file mode 100644 index 0e791b6..0000000 --- a/docs/doc/arduboy_rust/prelude/buttons/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["A","A_BUTTON","B","B_BUTTON","DOWN","DOWN_BUTTON","LEFT","LEFT_BUTTON","RIGHT","RIGHT_BUTTON","UP","UP_BUTTON"],"struct":["ButtonSet"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/buttons/struct.ButtonSet.html b/docs/doc/arduboy_rust/prelude/buttons/struct.ButtonSet.html deleted file mode 100644 index 07c54ac..0000000 --- a/docs/doc/arduboy_rust/prelude/buttons/struct.ButtonSet.html +++ /dev/null @@ -1,23 +0,0 @@ -ButtonSet in arduboy_rust::prelude::buttons - Rust
pub struct ButtonSet {
-    pub flag_set: u8,
-}
Expand description

This struct gives the library a understanding what Buttons on the Arduboy are.

-

Fields§

§flag_set: u8

Implementations§

source§

impl ButtonSet

source

pub unsafe fn pressed(&self) -> bool

source

pub unsafe fn just_pressed(&self) -> bool

source

pub unsafe fn just_released(&self) -> bool

source

pub unsafe fn not_pressed(&self) -> bool

Trait Implementations§

source§

impl BitOr<ButtonSet> for ButtonSet

§

type Output = ButtonSet

The resulting type after applying the | operator.
source§

fn bitor(self, other: Self) -> Self

Performs the | operation. Read more
source§

impl Clone for ButtonSet

source§

fn clone(&self) -> ButtonSet

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ButtonSet

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for ButtonSet

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl Ord for ButtonSet

source§

fn cmp(&self, other: &ButtonSet) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<ButtonSet> for ButtonSet

source§

fn eq(&self, other: &ButtonSet) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<ButtonSet> for ButtonSet

source§

fn partial_cmp(&self, other: &ButtonSet) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for ButtonSet

source§

impl Eq for ButtonSet

source§

impl StructuralEq for ButtonSet

source§

impl StructuralPartialEq for ButtonSet

Auto Trait Implementations§

§

impl RefUnwindSafe for ButtonSet

§

impl Send for ButtonSet

§

impl Sync for ButtonSet

§

impl Unpin for ButtonSet

§

impl UnwindSafe for ButtonSet

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.A.html b/docs/doc/arduboy_rust/prelude/constant.A.html deleted file mode 100644 index 2725a9c..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.A.html +++ /dev/null @@ -1,2 +0,0 @@ -A in arduboy_rust::prelude - Rust

Constant arduboy_rust::prelude::A

source ·
pub const A: ButtonSet;
Expand description

Just a const for the A button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.A_BUTTON.html b/docs/doc/arduboy_rust/prelude/constant.A_BUTTON.html deleted file mode 100644 index 6a78dcb..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.A_BUTTON.html +++ /dev/null @@ -1,2 +0,0 @@ -A_BUTTON in arduboy_rust::prelude - Rust

Constant arduboy_rust::prelude::A_BUTTON

source ·
pub const A_BUTTON: ButtonSet;
Expand description

Just a const for the A button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.B.html b/docs/doc/arduboy_rust/prelude/constant.B.html deleted file mode 100644 index 3426026..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.B.html +++ /dev/null @@ -1,2 +0,0 @@ -B in arduboy_rust::prelude - Rust

Constant arduboy_rust::prelude::B

source ·
pub const B: ButtonSet;
Expand description

Just a const for the B button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.BLUE_LED.html b/docs/doc/arduboy_rust/prelude/constant.BLUE_LED.html deleted file mode 100644 index 9e3725b..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.BLUE_LED.html +++ /dev/null @@ -1,2 +0,0 @@ -BLUE_LED in arduboy_rust::prelude - Rust

Constant arduboy_rust::prelude::BLUE_LED

source ·
pub const BLUE_LED: u8 = 9;
Expand description

Just a const for the blue led

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.B_BUTTON.html b/docs/doc/arduboy_rust/prelude/constant.B_BUTTON.html deleted file mode 100644 index 5a1bdb8..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.B_BUTTON.html +++ /dev/null @@ -1,2 +0,0 @@ -B_BUTTON in arduboy_rust::prelude - Rust

Constant arduboy_rust::prelude::B_BUTTON

source ·
pub const B_BUTTON: ButtonSet;
Expand description

Just a const for the B button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.DOWN.html b/docs/doc/arduboy_rust/prelude/constant.DOWN.html deleted file mode 100644 index 4d0e1ac..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.DOWN.html +++ /dev/null @@ -1,2 +0,0 @@ -DOWN in arduboy_rust::prelude - Rust

Constant arduboy_rust::prelude::DOWN

source ·
pub const DOWN: ButtonSet;
Expand description

Just a const for the DOWN button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.DOWN_BUTTON.html b/docs/doc/arduboy_rust/prelude/constant.DOWN_BUTTON.html deleted file mode 100644 index ce77452..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.DOWN_BUTTON.html +++ /dev/null @@ -1,2 +0,0 @@ -DOWN_BUTTON in arduboy_rust::prelude - Rust
pub const DOWN_BUTTON: ButtonSet;
Expand description

Just a const for the DOWN button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.FONT_SIZE.html b/docs/doc/arduboy_rust/prelude/constant.FONT_SIZE.html deleted file mode 100644 index 6fec0b1..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.FONT_SIZE.html +++ /dev/null @@ -1,3 +0,0 @@ -FONT_SIZE in arduboy_rust::prelude - Rust
pub const FONT_SIZE: u8 = 6;
Expand description

The standard font size of the arduboy

-

this is to calculate with it.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.GREEN_LED.html b/docs/doc/arduboy_rust/prelude/constant.GREEN_LED.html deleted file mode 100644 index dd892a1..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.GREEN_LED.html +++ /dev/null @@ -1,2 +0,0 @@ -GREEN_LED in arduboy_rust::prelude - Rust
pub const GREEN_LED: u8 = 11;
Expand description

Just a const for the green led

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.HEIGHT.html b/docs/doc/arduboy_rust/prelude/constant.HEIGHT.html deleted file mode 100644 index 8b011a7..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.HEIGHT.html +++ /dev/null @@ -1,3 +0,0 @@ -HEIGHT in arduboy_rust::prelude - Rust

Constant arduboy_rust::prelude::HEIGHT

source ·
pub const HEIGHT: u8 = 64;
Expand description

The standard height of the arduboy

-

this is to calculate with it.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.LEFT.html b/docs/doc/arduboy_rust/prelude/constant.LEFT.html deleted file mode 100644 index 507ea73..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.LEFT.html +++ /dev/null @@ -1,2 +0,0 @@ -LEFT in arduboy_rust::prelude - Rust

Constant arduboy_rust::prelude::LEFT

source ·
pub const LEFT: ButtonSet;
Expand description

Just a const for the LEFT button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.LEFT_BUTTON.html b/docs/doc/arduboy_rust/prelude/constant.LEFT_BUTTON.html deleted file mode 100644 index 7511601..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.LEFT_BUTTON.html +++ /dev/null @@ -1,2 +0,0 @@ -LEFT_BUTTON in arduboy_rust::prelude - Rust
pub const LEFT_BUTTON: ButtonSet;
Expand description

Just a const for the LEFT button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.RED_LED.html b/docs/doc/arduboy_rust/prelude/constant.RED_LED.html deleted file mode 100644 index 63f2708..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.RED_LED.html +++ /dev/null @@ -1,2 +0,0 @@ -RED_LED in arduboy_rust::prelude - Rust

Constant arduboy_rust::prelude::RED_LED

source ·
pub const RED_LED: u8 = 10;
Expand description

Just a const for the red led

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.RGB_OFF.html b/docs/doc/arduboy_rust/prelude/constant.RGB_OFF.html deleted file mode 100644 index b278ecd..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.RGB_OFF.html +++ /dev/null @@ -1,2 +0,0 @@ -RGB_OFF in arduboy_rust::prelude - Rust

Constant arduboy_rust::prelude::RGB_OFF

source ·
pub const RGB_OFF: u8 = 0;
Expand description

Just a const for led off

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.RGB_ON.html b/docs/doc/arduboy_rust/prelude/constant.RGB_ON.html deleted file mode 100644 index 130ab54..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.RGB_ON.html +++ /dev/null @@ -1,2 +0,0 @@ -RGB_ON in arduboy_rust::prelude - Rust

Constant arduboy_rust::prelude::RGB_ON

source ·
pub const RGB_ON: u8 = 1;
Expand description

Just a const for led on

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.RIGHT.html b/docs/doc/arduboy_rust/prelude/constant.RIGHT.html deleted file mode 100644 index a233a59..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.RIGHT.html +++ /dev/null @@ -1,2 +0,0 @@ -RIGHT in arduboy_rust::prelude - Rust

Constant arduboy_rust::prelude::RIGHT

source ·
pub const RIGHT: ButtonSet;
Expand description

Just a const for the RIGHT button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.RIGHT_BUTTON.html b/docs/doc/arduboy_rust/prelude/constant.RIGHT_BUTTON.html deleted file mode 100644 index 4de9213..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.RIGHT_BUTTON.html +++ /dev/null @@ -1,2 +0,0 @@ -RIGHT_BUTTON in arduboy_rust::prelude - Rust
pub const RIGHT_BUTTON: ButtonSet;
Expand description

Just a const for the RIGHT button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.UP.html b/docs/doc/arduboy_rust/prelude/constant.UP.html deleted file mode 100644 index bb22cb8..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.UP.html +++ /dev/null @@ -1,2 +0,0 @@ -UP in arduboy_rust::prelude - Rust

Constant arduboy_rust::prelude::UP

source ·
pub const UP: ButtonSet;
Expand description

Just a const for the UP button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.UP_BUTTON.html b/docs/doc/arduboy_rust/prelude/constant.UP_BUTTON.html deleted file mode 100644 index 97dfb23..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.UP_BUTTON.html +++ /dev/null @@ -1,2 +0,0 @@ -UP_BUTTON in arduboy_rust::prelude - Rust
pub const UP_BUTTON: ButtonSet;
Expand description

Just a const for the UP button

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/constant.WIDTH.html b/docs/doc/arduboy_rust/prelude/constant.WIDTH.html deleted file mode 100644 index b5b0d6d..0000000 --- a/docs/doc/arduboy_rust/prelude/constant.WIDTH.html +++ /dev/null @@ -1,3 +0,0 @@ -WIDTH in arduboy_rust::prelude - Rust

Constant arduboy_rust::prelude::WIDTH

source ·
pub const WIDTH: u8 = 128;
Expand description

The standard width of the arduboy

-

this is to calculate with it.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/enum.Base.html b/docs/doc/arduboy_rust/prelude/enum.Base.html deleted file mode 100644 index 96c9541..0000000 --- a/docs/doc/arduboy_rust/prelude/enum.Base.html +++ /dev/null @@ -1,25 +0,0 @@ -Base in arduboy_rust::prelude - Rust
pub enum Base {
-    Bin,
-    Oct,
-    Dec,
-    Hex,
-}

Variants§

§

Bin

§

Oct

§

Dec

§

Hex

Trait Implementations§

source§

impl Clone for Base

source§

fn clone(&self) -> Base

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Base

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for Base

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl Ord for Base

source§

fn cmp(&self, other: &Base) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<Base> for Base

source§

fn eq(&self, other: &Base) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<Base> for Base

source§

fn partial_cmp(&self, other: &Base) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for Base

source§

impl Eq for Base

source§

impl StructuralEq for Base

source§

impl StructuralPartialEq for Base

Auto Trait Implementations§

§

impl RefUnwindSafe for Base

§

impl Send for Base

§

impl Sync for Base

§

impl Unpin for Base

§

impl UnwindSafe for Base

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/enum.Color.html b/docs/doc/arduboy_rust/prelude/enum.Color.html deleted file mode 100644 index eff810f..0000000 --- a/docs/doc/arduboy_rust/prelude/enum.Color.html +++ /dev/null @@ -1,26 +0,0 @@ -Color in arduboy_rust::prelude - Rust
#[repr(u8)]
pub enum Color { - Black, - White, -}
Expand description

This item is to chose between Black or White

-

Variants§

§

Black

Led is off

-
§

White

Led is on

-

Trait Implementations§

source§

impl Clone for Color

source§

fn clone(&self) -> Color

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Color

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for Color

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl Not for Color

§

type Output = Color

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl Ord for Color

source§

fn cmp(&self, other: &Color) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<Color> for Color

source§

fn eq(&self, other: &Color) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<Color> for Color

source§

fn partial_cmp(&self, other: &Color) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for Color

source§

impl Eq for Color

source§

impl StructuralEq for Color

source§

impl StructuralPartialEq for Color

Auto Trait Implementations§

§

impl RefUnwindSafe for Color

§

impl Send for Color

§

impl Sync for Color

§

impl Unpin for Color

§

impl UnwindSafe for Color

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/fn.constrain.html b/docs/doc/arduboy_rust/prelude/fn.constrain.html deleted file mode 100644 index 7bd3f9c..0000000 --- a/docs/doc/arduboy_rust/prelude/fn.constrain.html +++ /dev/null @@ -1 +0,0 @@ -constrain in arduboy_rust::prelude - Rust
pub fn constrain<T: Ord>(x: T, a: T, b: T) -> T
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/fn.delay.html b/docs/doc/arduboy_rust/prelude/fn.delay.html deleted file mode 100644 index 522a881..0000000 --- a/docs/doc/arduboy_rust/prelude/fn.delay.html +++ /dev/null @@ -1,2 +0,0 @@ -delay in arduboy_rust::prelude - Rust

Function arduboy_rust::prelude::delay

source ·
pub fn delay(ms: u32)
Expand description

A Arduino function to pause the cpu circles for a given amount of ms

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/fn.random_between.html b/docs/doc/arduboy_rust/prelude/fn.random_between.html deleted file mode 100644 index 743d9da..0000000 --- a/docs/doc/arduboy_rust/prelude/fn.random_between.html +++ /dev/null @@ -1,3 +0,0 @@ -random_between in arduboy_rust::prelude - Rust
pub fn random_between(min: i32, max: i32) -> i32
Expand description

A Arduino function to get a random number between 2 numbers -seed based

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/fn.random_less_than.html b/docs/doc/arduboy_rust/prelude/fn.random_less_than.html deleted file mode 100644 index 0c9c81f..0000000 --- a/docs/doc/arduboy_rust/prelude/fn.random_less_than.html +++ /dev/null @@ -1,3 +0,0 @@ -random_less_than in arduboy_rust::prelude - Rust
pub fn random_less_than(max: i32) -> i32
Expand description

A Arduino function to get a random number smaller than the number given -seed based

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/fn.strlen.html b/docs/doc/arduboy_rust/prelude/fn.strlen.html deleted file mode 100644 index c9f83f4..0000000 --- a/docs/doc/arduboy_rust/prelude/fn.strlen.html +++ /dev/null @@ -1,2 +0,0 @@ -strlen in arduboy_rust::prelude - Rust

Function arduboy_rust::prelude::strlen

source ·
pub fn strlen(cstr: *const i8) -> usize
Expand description

A C function to get the length of a string

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/index.html b/docs/doc/arduboy_rust/prelude/index.html deleted file mode 100644 index eeeb684..0000000 --- a/docs/doc/arduboy_rust/prelude/index.html +++ /dev/null @@ -1,8 +0,0 @@ -arduboy_rust::prelude - Rust

Module arduboy_rust::prelude

source ·
Expand description

This is the important one to use this library effective in your project

-

Import the module:

- -
use arduboy_rust::prelude::*;
-

Re-exports

Modules

  • This is the Module to interact in a save way with the Arduboy2 C++ library.
  • This is the Module to interact in a save way with the ArduboyTones C++ library.
  • This is the Module to interact in a save way with the ArdVoice C++ library.
  • A list of all six buttons available on the Arduboy
  • A list of all LED variables available
  • This is the module to interact in a save way with the Sprites C++ library.

Macros

  • This is the way to go if you want print some random text
  • Create a const raw pointer to a ardvoice tone as u8, without creating an intermediate reference.
  • Create a const raw pointer to a sprite as u8, without creating an intermediate reference.
  • Create a const raw pointer to a [u8;_] that saves text, without creating an intermediate reference.
  • Create a const raw pointer to a tone sequenze as u16, without creating an intermediate reference.
  • Create a space for Progmem variable

Structs

  • This is the struct to interact in a save way with the ArdVoice C++ library.
  • This is the struct to interact in a save way with the Arduboy2 C++ library.
  • This is the struct to interact in a save way with the ArduboyTones C++ library.
  • This struct gives the library a understanding what Buttons on the Arduboy are.
  • This is the struct to store and read structs objects to/from eeprom memory.
  • Use this struct to store and read single bytes to/from eeprom memory.
  • Use this struct to store and read single bytes to/from eeprom memory without using a check digit. -Unlike the other eeprom structs, this does not need to be initialised.
  • A fixed capacity map / dictionary that performs lookups via linear search
  • This struct is used by a few Arduboy functions.
  • This struct is used by a few Arduboy functions.
  • A fixed capacity String
  • A fixed capacity Vec

Enums

  • This item is to chose between Black or White

Constants

  • Just a const for the A button
  • Just a const for the A button
  • Just a const for the B button
  • Just a const for the blue led
  • Just a const for the B button
  • Just a const for the DOWN button
  • Just a const for the DOWN button
  • The standard font size of the arduboy
  • Just a const for the green led
  • The standard height of the arduboy
  • Just a const for the LEFT button
  • Just a const for the LEFT button
  • Just a const for the red led
  • Just a const for led off
  • Just a const for led on
  • Just a const for the RIGHT button
  • Just a const for the RIGHT button
  • Just a const for the UP button
  • Just a const for the UP button
  • The standard width of the arduboy

Traits

Functions

  • A Arduino function to pause the cpu circles for a given amount of ms
  • A Arduino function to get a random number between 2 numbers -seed based
  • A Arduino function to get a random number smaller than the number given -seed based
  • A C function to get the length of a string

Type Aliases

  • c_size_tExperimental
    Equivalent to C’s size_t type, from stddef.h (or cstddef for C++).
  • Equivalent to C’s char type.
  • Equivalent to C’s double type.
  • Equivalent to C’s float type.
  • Equivalent to C’s signed int (int) type.
  • Equivalent to C’s signed long (long) type.
  • Equivalent to C’s signed long long (long long) type.
  • Equivalent to C’s unsigned char type.
  • Equivalent to C’s unsigned int type.
  • Equivalent to C’s unsigned long type.
  • Equivalent to C’s unsigned long long type.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/led/constant.BLUE_LED.html b/docs/doc/arduboy_rust/prelude/led/constant.BLUE_LED.html deleted file mode 100644 index b979345..0000000 --- a/docs/doc/arduboy_rust/prelude/led/constant.BLUE_LED.html +++ /dev/null @@ -1,2 +0,0 @@ -BLUE_LED in arduboy_rust::prelude::led - Rust

Constant arduboy_rust::prelude::led::BLUE_LED

source ·
pub const BLUE_LED: u8 = 9;
Expand description

Just a const for the blue led

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/led/constant.GREEN_LED.html b/docs/doc/arduboy_rust/prelude/led/constant.GREEN_LED.html deleted file mode 100644 index 8022830..0000000 --- a/docs/doc/arduboy_rust/prelude/led/constant.GREEN_LED.html +++ /dev/null @@ -1,2 +0,0 @@ -GREEN_LED in arduboy_rust::prelude::led - Rust
pub const GREEN_LED: u8 = 11;
Expand description

Just a const for the green led

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/led/constant.RED_LED.html b/docs/doc/arduboy_rust/prelude/led/constant.RED_LED.html deleted file mode 100644 index 19b9cd8..0000000 --- a/docs/doc/arduboy_rust/prelude/led/constant.RED_LED.html +++ /dev/null @@ -1,2 +0,0 @@ -RED_LED in arduboy_rust::prelude::led - Rust

Constant arduboy_rust::prelude::led::RED_LED

source ·
pub const RED_LED: u8 = 10;
Expand description

Just a const for the red led

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/led/constant.RGB_OFF.html b/docs/doc/arduboy_rust/prelude/led/constant.RGB_OFF.html deleted file mode 100644 index 6af012c..0000000 --- a/docs/doc/arduboy_rust/prelude/led/constant.RGB_OFF.html +++ /dev/null @@ -1,2 +0,0 @@ -RGB_OFF in arduboy_rust::prelude::led - Rust

Constant arduboy_rust::prelude::led::RGB_OFF

source ·
pub const RGB_OFF: u8 = 0;
Expand description

Just a const for led off

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/led/constant.RGB_ON.html b/docs/doc/arduboy_rust/prelude/led/constant.RGB_ON.html deleted file mode 100644 index f9eb2ec..0000000 --- a/docs/doc/arduboy_rust/prelude/led/constant.RGB_ON.html +++ /dev/null @@ -1,2 +0,0 @@ -RGB_ON in arduboy_rust::prelude::led - Rust

Constant arduboy_rust::prelude::led::RGB_ON

source ·
pub const RGB_ON: u8 = 1;
Expand description

Just a const for led on

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/led/index.html b/docs/doc/arduboy_rust/prelude/led/index.html deleted file mode 100644 index 27c3efb..0000000 --- a/docs/doc/arduboy_rust/prelude/led/index.html +++ /dev/null @@ -1,2 +0,0 @@ -arduboy_rust::prelude::led - Rust

Module arduboy_rust::prelude::led

source ·
Expand description

A list of all LED variables available

-

Constants

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/led/sidebar-items.js b/docs/doc/arduboy_rust/prelude/led/sidebar-items.js deleted file mode 100644 index d30825f..0000000 --- a/docs/doc/arduboy_rust/prelude/led/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["BLUE_LED","GREEN_LED","RED_LED","RGB_OFF","RGB_ON"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/macro.f!.html b/docs/doc/arduboy_rust/prelude/macro.f!.html deleted file mode 100644 index 0426db3..0000000 --- a/docs/doc/arduboy_rust/prelude/macro.f!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.f.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/macro.f.html b/docs/doc/arduboy_rust/prelude/macro.f.html deleted file mode 100644 index 3758b78..0000000 --- a/docs/doc/arduboy_rust/prelude/macro.f.html +++ /dev/null @@ -1,8 +0,0 @@ -f in arduboy_rust::prelude - Rust

Macro arduboy_rust::prelude::f

source ·
macro_rules! f {
-    ($string_literal:literal) => { ... };
-}
Expand description

This is the way to go if you want print some random text

-

This doesn’t waste the 2kb ram it saves to progmem (28kb) -This automatically saves the given text to the Progmem.

-

Example

-
arduboy.print(f!(b"Random text to print\0"))
-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/macro.get_ardvoice_tone_addr!.html b/docs/doc/arduboy_rust/prelude/macro.get_ardvoice_tone_addr!.html deleted file mode 100644 index dc78a40..0000000 --- a/docs/doc/arduboy_rust/prelude/macro.get_ardvoice_tone_addr!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.get_ardvoice_tone_addr.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/macro.get_ardvoice_tone_addr.html b/docs/doc/arduboy_rust/prelude/macro.get_ardvoice_tone_addr.html deleted file mode 100644 index 03e192f..0000000 --- a/docs/doc/arduboy_rust/prelude/macro.get_ardvoice_tone_addr.html +++ /dev/null @@ -1,4 +0,0 @@ -get_ardvoice_tone_addr in arduboy_rust::prelude - Rust
macro_rules! get_ardvoice_tone_addr {
-    ( $s:expr ) => { ... };
-}
Expand description

Create a const raw pointer to a ardvoice tone as u8, without creating an intermediate reference.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/macro.get_sprite_addr!.html b/docs/doc/arduboy_rust/prelude/macro.get_sprite_addr!.html deleted file mode 100644 index d167c9b..0000000 --- a/docs/doc/arduboy_rust/prelude/macro.get_sprite_addr!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.get_sprite_addr.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/macro.get_sprite_addr.html b/docs/doc/arduboy_rust/prelude/macro.get_sprite_addr.html deleted file mode 100644 index 43272a6..0000000 --- a/docs/doc/arduboy_rust/prelude/macro.get_sprite_addr.html +++ /dev/null @@ -1,4 +0,0 @@ -get_sprite_addr in arduboy_rust::prelude - Rust
macro_rules! get_sprite_addr {
-    ( $s:expr ) => { ... };
-}
Expand description

Create a const raw pointer to a sprite as u8, without creating an intermediate reference.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/macro.get_string_addr!.html b/docs/doc/arduboy_rust/prelude/macro.get_string_addr!.html deleted file mode 100644 index 1e2e060..0000000 --- a/docs/doc/arduboy_rust/prelude/macro.get_string_addr!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.get_string_addr.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/macro.get_string_addr.html b/docs/doc/arduboy_rust/prelude/macro.get_string_addr.html deleted file mode 100644 index 0200a54..0000000 --- a/docs/doc/arduboy_rust/prelude/macro.get_string_addr.html +++ /dev/null @@ -1,4 +0,0 @@ -get_string_addr in arduboy_rust::prelude - Rust
macro_rules! get_string_addr {
-    ( $s:expr ) => { ... };
-}
Expand description

Create a const raw pointer to a [u8;_] that saves text, without creating an intermediate reference.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/macro.get_tones_addr!.html b/docs/doc/arduboy_rust/prelude/macro.get_tones_addr!.html deleted file mode 100644 index 59c26ea..0000000 --- a/docs/doc/arduboy_rust/prelude/macro.get_tones_addr!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.get_tones_addr.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/macro.get_tones_addr.html b/docs/doc/arduboy_rust/prelude/macro.get_tones_addr.html deleted file mode 100644 index f5be8f0..0000000 --- a/docs/doc/arduboy_rust/prelude/macro.get_tones_addr.html +++ /dev/null @@ -1,4 +0,0 @@ -get_tones_addr in arduboy_rust::prelude - Rust
macro_rules! get_tones_addr {
-    ( $s:expr ) => { ... };
-}
Expand description

Create a const raw pointer to a tone sequenze as u16, without creating an intermediate reference.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/macro.progmem!.html b/docs/doc/arduboy_rust/prelude/macro.progmem!.html deleted file mode 100644 index 7376712..0000000 --- a/docs/doc/arduboy_rust/prelude/macro.progmem!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.progmem.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/macro.progmem.html b/docs/doc/arduboy_rust/prelude/macro.progmem.html deleted file mode 100644 index 92529c4..0000000 --- a/docs/doc/arduboy_rust/prelude/macro.progmem.html +++ /dev/null @@ -1,44 +0,0 @@ -progmem in arduboy_rust::prelude - Rust
macro_rules! progmem {
-    (
-        $( #[$attr:meta] )*
-        $v:vis $id:ident $name:ident: [$ty:ty; _] = $value:expr;
-        $($rest:tt)*
-    ) => { ... };
-    (
-        $( #[$attr:meta] )*
-        $v:vis $id:ident mut $name:ident: [$ty:ty; _] = $value:expr;
-        $($rest:tt)*
-    ) => { ... };
-    (
-        $( #[$attr:meta] )*
-        $v:vis $id:ident $name:ident: $ty:ty = $value:expr;
-        $($rest:tt)*
-    ) => { ... };
-    (
-        $( #[$attr:meta] )*
-        $v:vis $id:ident mut $name:ident: $ty:ty = $value:expr;
-        $($rest:tt)*
-    ) => { ... };
-    () => { ... };
-}
Expand description

Create a space for Progmem variable

-

Example

-
//for text
-progmem!(
-    static text: [u8; _] = *b"I'm a PROGMEM Text\0";
-);
-//for tone sequence
-progmem!(
-    static tone: [u16; _] = [
-        NOTE_E4, 400, NOTE_D4, 200, NOTE_C4, 400, NOTE_D4, 200, NOTE_C4, 300, NOTE_REST,
-    ];
-);
-//for for bitmap
-progmem!(
-    static image: [u8; _] = [8, 8, 0x81, 0x00, 0x12, 0x40, 0x04, 0x11, 0x00, 0x04];
-);
-
-// for a Vector
-progmem!(
-    static mut walls: Vec<Player, 100> = Vec::new();
-);
-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/sidebar-items.js b/docs/doc/arduboy_rust/prelude/sidebar-items.js deleted file mode 100644 index 2bcb7c8..0000000 --- a/docs/doc/arduboy_rust/prelude/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["A","A_BUTTON","B","BLUE_LED","B_BUTTON","DOWN","DOWN_BUTTON","FONT_SIZE","GREEN_LED","HEIGHT","LEFT","LEFT_BUTTON","RED_LED","RGB_OFF","RGB_ON","RIGHT","RIGHT_BUTTON","UP","UP_BUTTON","WIDTH"],"enum":["Base","Color"],"fn":["constrain","delay","random_between","random_less_than","strlen"],"macro":["f","get_ardvoice_tone_addr","get_sprite_addr","get_string_addr","get_tones_addr","progmem"],"mod":["arduboy2","arduboy_tone","ardvoice","buttons","led","sprites"],"struct":["ArdVoice","Arduboy2","ArduboyTones","ButtonSet","EEPROM","EEPROMBYTE","EEPROMBYTECHECKLESS","LinearMap","Point","Rect","String","Vec"],"trait":["Printable"],"type":["c_char","c_double","c_float","c_int","c_long","c_longlong","c_size_t","c_uchar","c_uint","c_ulong","c_ulonglong"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/sprites/fn.draw_erase.html b/docs/doc/arduboy_rust/prelude/sprites/fn.draw_erase.html deleted file mode 100644 index 65f5d88..0000000 --- a/docs/doc/arduboy_rust/prelude/sprites/fn.draw_erase.html +++ /dev/null @@ -1,24 +0,0 @@ -draw_erase in arduboy_rust::prelude::sprites - Rust
pub fn draw_erase(x: i16, y: i16, bitmap: *const u8, frame: u8)
Expand description

“Erase” a sprite.

-

Parameters

-
    -
  • x,y The coordinates of the top left pixel location.
  • -
  • bitmap A pointer to the array containing the image frames.
  • -
  • frame The frame number of the image to erase.
  • -
-

The data from the specified frame in the array is used to erase a sprite. To “erase” a sprite, bits set to 1 in the frame will set the corresponding pixel in the buffer to 0. Frame bits set to 0 will remain unchanged in the buffer.

-
 image  before  after  (# = 1, - = 0)
-
- -----  -----   -----
- --#--  -----   -----
- ##-##  -----   -----
- --#--  -----   -----
- -----  -----   -----
-
- image  before  after
-
- -----  #####   #####
- --#--  #####   ##-##
- ##-##  #####   --#--
- --#--  #####   ##-##
- -----  #####   #####
-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/sprites/fn.draw_external_mask.html b/docs/doc/arduboy_rust/prelude/sprites/fn.draw_external_mask.html deleted file mode 100644 index 958c634..0000000 --- a/docs/doc/arduboy_rust/prelude/sprites/fn.draw_external_mask.html +++ /dev/null @@ -1,35 +0,0 @@ -draw_external_mask in arduboy_rust::prelude::sprites - Rust
pub fn draw_external_mask(
-    x: i16,
-    y: i16,
-    bitmap: *const u8,
-    mask: *const u8,
-    frame: u8,
-    mask_frame: u8
-)
Expand description

Draw a sprite using a separate image and mask array.

-

Parameters

-
    -
  • x,y The coordinates of the top left pixel location.
  • -
  • bitmap A pointer to the array containing the image frames.
  • -
  • mask A pointer to the array containing the mask frames.
  • -
  • frame The frame number of the image to draw.
  • -
  • mask_frame The frame number for the mask to use (can be different from the image frame number).
  • -
-

An array containing the image frames, and another array containing corresponding mask frames, are used to draw a sprite.

-

For the mask array, the width and height are not included but must contain data of the same dimensions as the corresponding image array.

-

Bits set to 1 in the mask indicate that the pixel will be set to the value of the corresponding image bit. Bits set to 0 in the mask will be left unchanged.

-
 image  mask   before  after  (# = 1, - = 0)
-
- -----  -###-  -----   -----
- --#--  #####  -----   --#--
- ##-##  ##-##  -----   ##-##
- --#--  #####  -----   --#--
- -----  -###-  -----   -----
-
- image  mask   before  after
-
- -----  -###-  #####   #---#
- --#--  #####  #####   --#--
- ##-##  #####  #####   ##-##
- --#--  #####  #####   --#--
- -----  -###-  #####   #---#
-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/sprites/fn.draw_override.html b/docs/doc/arduboy_rust/prelude/sprites/fn.draw_override.html deleted file mode 100644 index 0cac8cc..0000000 --- a/docs/doc/arduboy_rust/prelude/sprites/fn.draw_override.html +++ /dev/null @@ -1,24 +0,0 @@ -draw_override in arduboy_rust::prelude::sprites - Rust
pub fn draw_override(x: i16, y: i16, bitmap: *const u8, frame: u8)
Expand description

Draw a sprite by replacing the existing content completely.

-

Parameters

-
    -
  • x,y The coordinates of the top left pixel location.
  • -
  • bitmap A pointer to the array containing the image frames.
  • -
  • frame The frame number of the image to draw.
  • -
-

A sprite is drawn by overwriting the pixels in the buffer with the data from the specified frame in the array. No masking is done. A bit set to 1 in the frame will set the pixel to 1 in the buffer, and a 0 in the array will set a 0 in the buffer.

-
 image  before  after  (# = 1, - = 0)
-
- -----  -----   -----
- --#--  -----   --#--
- ##-##  -----   ##-##
- --#--  -----   --#--
- -----  -----   -----
-
- image  before  after
-
- -----  #####   -----
- --#--  #####   --#--
- ##-##  #####   ##-##
- --#--  #####   --#--
- -----  #####   -----
-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/sprites/fn.draw_plus_mask.html b/docs/doc/arduboy_rust/prelude/sprites/fn.draw_plus_mask.html deleted file mode 100644 index 3dfe524..0000000 --- a/docs/doc/arduboy_rust/prelude/sprites/fn.draw_plus_mask.html +++ /dev/null @@ -1,24 +0,0 @@ -draw_plus_mask in arduboy_rust::prelude::sprites - Rust
pub fn draw_plus_mask(x: i16, y: i16, bitmap: *const u8, frame: u8)
Expand description

Draw a sprite using an array containing both image and mask values.

-

Parameters

-
    -
  • x,y The coordinates of the top left pixel location.
  • -
  • bitmap A pointer to the array containing the image/mask frames.
  • -
  • frame The frame number of the image to draw.
  • -
-

An array containing combined image and mask data is used to draw a sprite. Bytes are given in pairs with the first byte representing the image pixels and the second byte specifying the corresponding mask. The width given in the array still specifies the image width, so each row of image and mask bytes will be twice the width value.

-

Bits set to 1 in the mask indicate that the pixel will be set to the value of the corresponding image bit. Bits set to 0 in the mask will be left unchanged.

-

image mask before after (# = 1, - = 0)

-
 -----  -###-  -----   -----
- --#--  #####  -----   --#--
- ##-##  ##-##  -----   ##-##
- --#--  #####  -----   --#--
- -----  -###-  -----   -----
-
- image  mask   before  after
-
- -----  -###-  #####   #---#
- --#--  #####  #####   --#--
- ##-##  #####  #####   ##-##
- --#--  #####  #####   --#--
- -----  -###-  #####   #---#
-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/sprites/fn.draw_self_masked.html b/docs/doc/arduboy_rust/prelude/sprites/fn.draw_self_masked.html deleted file mode 100644 index 35a26b2..0000000 --- a/docs/doc/arduboy_rust/prelude/sprites/fn.draw_self_masked.html +++ /dev/null @@ -1,24 +0,0 @@ -draw_self_masked in arduboy_rust::prelude::sprites - Rust
pub fn draw_self_masked(x: i16, y: i16, bitmap: *const u8, frame: u8)
Expand description

Draw a sprite using only the bits set to 1.

-

Parameters

-
    -
  • x,y The coordinates of the top left pixel location.
  • -
  • bitmap A pointer to the array containing the image frames.
  • -
  • frame The frame number of the image to draw.
  • -
-

Bits set to 1 in the frame will be used to draw the sprite by setting the corresponding pixel in the buffer to 1. Bits set to 0 in the frame will remain unchanged in the buffer.

-
 image  before  after  (# = 1, - = 0)
-
- -----  -----   -----
- --#--  -----   --#--
- ##-##  -----   ##-##
- --#--  -----   --#--
- -----  -----   -----
-
- image  before  after
-
- -----  #####   #####  (no change because all pixels were
- --#--  #####   #####  already white)
- ##-##  #####   #####
- --#--  #####   #####
- -----  #####   #####
-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/sprites/index.html b/docs/doc/arduboy_rust/prelude/sprites/index.html deleted file mode 100644 index 27721cf..0000000 --- a/docs/doc/arduboy_rust/prelude/sprites/index.html +++ /dev/null @@ -1,2 +0,0 @@ -arduboy_rust::prelude::sprites - Rust
Expand description

This is the module to interact in a save way with the Sprites C++ library.

-

Functions

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/sprites/sidebar-items.js b/docs/doc/arduboy_rust/prelude/sprites/sidebar-items.js deleted file mode 100644 index 7046e20..0000000 --- a/docs/doc/arduboy_rust/prelude/sprites/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["draw_erase","draw_external_mask","draw_override","draw_plus_mask","draw_self_masked"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/struct.ArdVoice.html b/docs/doc/arduboy_rust/prelude/struct.ArdVoice.html deleted file mode 100644 index 48a3292..0000000 --- a/docs/doc/arduboy_rust/prelude/struct.ArdVoice.html +++ /dev/null @@ -1,19 +0,0 @@ -ArdVoice in arduboy_rust::prelude - Rust
pub struct ArdVoice {}
Expand description

This is the struct to interact in a save way with the ArdVoice C++ library.

-

You will need to uncomment the ArdVoice_Library in the import_config.h file.

-

Implementations§

source§

impl ArdVoice

source

pub const fn new() -> Self

source

pub fn play_voice(&self, audio: *const u8)

source

pub fn play_voice_complex( - &self, - audio: *const u8, - start_time: u32, - end_time: u32, - speed: f32 -)

source

pub fn stop_voice(&self)

source

pub fn is_voice_playing(&self) -> bool

Auto Trait Implementations§

§

impl RefUnwindSafe for ArdVoice

§

impl Send for ArdVoice

§

impl Sync for ArdVoice

§

impl Unpin for ArdVoice

§

impl UnwindSafe for ArdVoice

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/struct.Arduboy2.html b/docs/doc/arduboy_rust/prelude/struct.Arduboy2.html deleted file mode 100644 index 5e07a82..0000000 --- a/docs/doc/arduboy_rust/prelude/struct.Arduboy2.html +++ /dev/null @@ -1,379 +0,0 @@ -Arduboy2 in arduboy_rust::prelude - Rust
pub struct Arduboy2 {}
Expand description

This is the struct to interact in a save way with the Arduboy2 C++ library.

-

Implementations§

source§

impl Arduboy2

source

pub const fn new() -> Self

gives you a new instance of the Arduboy2

-
Example
-
const arduboy: Arduboy2 = Arduboy2::new();
-
source

pub fn begin(&self)

Initialize the hardware, display the boot logo, provide boot utilities, etc. -This function should be called once near the start of the sketch, usually in setup(), before using any other functions in this class. It initializes the display, displays the boot logo, provides “flashlight” and system control features and initializes audio control.

-
source

pub fn clear(&self)

Clear the display buffer and set the text cursor to location 0, 0.

-
source

pub fn display(&self)

Copy the contents of the display buffer to the display. -The contents of the display buffer in RAM are copied to the display and will appear on the screen.

-
source

pub fn display_and_clear_buffer(&self)

Copy the contents of the display buffer to the display. The display buffer will be cleared to zero.

-

Operation is the same as calling display() without parameters except additionally the display buffer will be cleared.

-
source

pub fn draw_fast_hline(&self, x: i16, y: i16, w: u8, color: Color)

Draw a horizontal line.

-
Parameters:
-
    -
  • x The X coordinate of the left start point.
  • -
  • y The Y coordinate of the left start point.
  • -
  • w The width of the line.
  • -
-

color The color of the line (optional; defaults to WHITE).

-
source

pub fn draw_fast_vline(&self, x: i16, y: i16, h: u8, color: Color)

Draw a vertical line.

-
Parameters:
-
    -
  • x The X coordinate of the left start point.
  • -
  • y The Y coordinate of the left start point.
  • -
  • h The height of the line.
  • -
-

color The color of the line (optional; defaults to WHITE).

-
source

pub fn draw_pixel(&self, x: i16, y: i16, color: Color)

Set a single pixel in the display buffer to the specified color.

-
Parameters
-
    -
  • x The X coordinate of the pixel.
  • -
  • y The Y coordinate of the pixel.
  • -
  • color The color of the pixel (optional; defaults to WHITE).
  • -
-

The single pixel specified location in the display buffer is set to the specified color. The values WHITE or BLACK can be used for the color. If the color parameter isn’t included, the pixel will be set to WHITE.

-
source

pub fn fill_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

Draw a filled-in rectangle of a specified width and height.

-
Parameters
-
    -
  • x The X coordinate of the upper left corner.
  • -
  • y The Y coordinate of the upper left corner.
  • -
  • w The width of the rectangle.
  • -
  • h The height of the rectangle.
  • -
-

color The color of the pixel (optional; defaults to WHITE).

-
source

pub fn draw_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

Draw a rectangle of a specified width and height.

-

Parameters

-
    -
  • x The X coordinate of the upper left corner.
  • -
  • y The Y coordinate of the upper left corner.
  • -
  • w The width of the rectangle.
  • -
  • h The height of the rectangle.
  • -
  • color The color of the pixel (optional; defaults to WHITE).
  • -
-
source

pub fn draw_circle(&self, x: i16, y: i16, r: u8, color: Color)

Draw a circle of a given radius.

-

Parameters

-
    -
  • x0 The X coordinate of the circle’s center.
  • -
  • y0 The Y coordinate of the circle’s center.
  • -
  • r The radius of the circle in pixels.
  • -
  • color The circle’s color (optional; defaults to WHITE).
  • -
-
source

pub fn fill_circle(&self, x: i16, y: i16, r: u8, color: Color)

Draw a filled-in circle of a given radius.

-
Parameters
-
    -
  • x The X coordinate of the circle’s center.
  • -
  • y The Y coordinate of the circle’s center.
  • -
  • r The radius of the circle in pixels.
  • -
-

color The circle’s color (optional; defaults to WHITE).

-
source

pub fn fill_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

Draw a filled-in rectangle with rounded corners.

-

Parameters

-
    -
  • x The X coordinate of the left edge.
  • -
  • y The Y coordinate of the top edge.
  • -
  • w The width of the rectangle.
  • -
  • h The height of the rectangle.
  • -
  • r The radius of the semicircles forming the corners.
  • -
  • color The color of the rectangle (optional; defaults to WHITE).
  • -
-
source

pub fn draw_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

Draw a rectangle with rounded corners.

-

Parameters

-
    -
  • x The X coordinate of the left edge.
  • -
  • y The Y coordinate of the top edge.
  • -
  • w The width of the rectangle.
  • -
  • h The height of the rectangle.
  • -
  • r The radius of the semicircles forming the corners.
  • -
  • color The color of the rectangle (optional; defaults to WHITE).
  • -
-
source

pub fn draw_triangle( - &self, - x0: i16, - y0: i16, - x1: i16, - y1: i16, - x2: i16, - y2: i16, - color: Color -)

Draw a triangle given the coordinates of each corner.

-

Parameters

-
    -
  • x0,x1,x2 The X coordinates of the corners.
  • -
  • y0,y1,y2 The Y coordinates of the corners.
  • -
  • color The triangle’s color (optional; defaults to WHITE).
  • -
-

A triangle is drawn by specifying each of the three corner locations. The corners can be at any position with respect to the others.

-
source

pub fn fill_triangle( - &self, - x0: i16, - y0: i16, - x1: i16, - y1: i16, - x2: i16, - y2: i16, - color: Color -)

Draw a filled-in triangle given the coordinates of each corner.

-

Parameters

-
    -
  • x0,x1,x2 The X coordinates of the corners.
  • -
  • y0,y1,y2 The Y coordinates of the corners.
  • -
  • color The triangle’s color (optional; defaults to WHITE).
  • -
-

A triangle is drawn by specifying each of the three corner locations. The corners can be at any position with respect to the others.

-
source

pub fn get_pixel(&self, x: u8, y: u8) -> Color

Returns the state of the given pixel in the screen buffer.

-
Parameters
-
    -
  • x The X coordinate of the pixel.
  • -
  • y The Y coordinate of the pixel.
  • -
-
Returns
-

WHITE if the pixel is on or BLACK if the pixel is off.

-
source

pub fn init_random_seed(&self)

Seed the random number generator with a random value.

-

The Arduino pseudorandom number generator is seeded with the random value returned from a call to generateRandomSeed().

-
source

pub fn just_pressed(&self, button: ButtonSet) -> bool

Check if a button has just been pressed.

-
Parameters
-
    -
  • button The button to test for. Only one button should be specified.
  • -
-
Returns
-

true if the specified button has just been pressed.

-

Return true if the given button was pressed between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.

-

There is no need to check for the release of the button since it must have been released for this function to return true when pressed again.

-

This function should only be used to test a single button.

-
source

pub fn just_released(&self, button: ButtonSet) -> bool

Check if a button has just been released.

-
Parameters
-
    -
  • button The button to test for. Only one button should be specified.
  • -
-
Returns
-

true if the specified button has just been released.

-

Return true if the given button was released between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.

-

There is no need to check for the released of the button since it must have been pressed for this function to return true when pressed again.

-

This function should only be used to test a single button.

-
source

pub fn not_pressed(&self, button: ButtonSet) -> bool

Test if the specified buttons are not pressed.

-
Parameters
-
    -
  • buttons A bit mask indicating which buttons to test. (Can be a single button)
  • -
-
Returns
-

True if all buttons in the provided mask are currently released.

-

Read the state of the buttons and return true if all the buttons in the specified mask are currently released.

-
source

pub fn next_frame(&self) -> bool

Indicate that it’s time to render the next frame.

-
Returns
-

true if it’s time for the next frame.

-

When this function returns true, the amount of time has elapsed to display the next frame, as specified by setFrameRate() or setFrameDuration().

-

This function will normally be called at the start of the rendering loop which would wait for true to be returned before rendering and displaying the next frame.

-
source

pub fn poll_buttons(&self)

Poll the buttons and track their state over time.

-

Read and save the current state of the buttons and also keep track of the button state when this function was previously called. These states are used by the justPressed() and justReleased() functions to determine if a button has changed state between now and the previous call to pollButtons().

-

This function should be called once at the start of each new frame.

-

The justPressed() and justReleased() functions rely on this function.

-
source

pub fn pressed(&self, button: ButtonSet) -> bool

Test if the all of the specified buttons are pressed.

-
Parameters
-
    -
  • buttons A bit mask indicating which buttons to test. (Can be a single button)
  • -
-
Returns
-

true if all buttons in the provided mask are currently pressed.

-

Read the state of the buttons and return true if all of the buttons in the specified mask are being pressed.

-
source

pub fn print(&self, x: impl Printable)

The Arduino Print class is available for writing text to the screen buffer.

-

For an Arduboy2 class object, functions provided by the Arduino Print class can be used to write text to the screen buffer, in the same manner as the Arduino Serial.print(), etc., functions.

-

Print will use the write() function to actually draw each character in the screen buffer, using the library’s font5x7 font. Two character values are handled specially:

-
    -
  • ASCII newline/line feed (\n, 0x0A, inverse white circle). This will move the text cursor position to the start of the next line, based on the current text size.
  • -
  • ASCII carriage return (\r, 0x0D, musical eighth note). This character will be ignored.
  • -
-

Example

- -
let value: i16 = 42;
-
-arduboy.print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the
-                                       // text cursor to the start of the next line
-arduboy.print(f!(b"Hello World\n")); // Prints "Hello World" but does not use the 2kb ram
-arduboy.print(value); // Prints "42"
-arduboy.print("\n\0"); // Sets the text cursor to the start of the next line
-arduboy.print("hello world") // Prints normal [&str]
-
source

pub fn set_cursor(&self, x: i16, y: i16)

Set the location of the text cursor.

-
Parameters
-
    -
  • -

    x The X (horizontal) coordinate, in pixels, for the new location of the text cursor.

    -
  • -
  • -

    y The Y (vertical) coordinate, in pixels, for the new location of the text cursor.

    -
  • -
-

The location of the text cursor is set the the specified coordinates. The coordinates are in pixels. Since the coordinates can specify any pixel location, the text does not have to be placed on specific rows. As with all drawing functions, location 0, 0 is the top left corner of the display. The cursor location represents the top left corner of the next character written.

-
source

pub fn set_frame_rate(&self, rate: u8)

Set the frame rate used by the frame control functions.

-
Parameters
-
    -
  • rate The desired frame rate in frames per second.
  • -
-

Normally, the frame rate would be set to the desired value once, at the start of the game, but it can be changed at any time to alter the frame update rate.

-
source

pub fn set_text_size(&self, size: u8)

Set the text character size.

-
Parameters
-
    -
  • s The text size multiplier. Must be 1 or higher.
  • -
-

Setting a text size of 1 will result in standard size characters with one pixel for each bit in the bitmap for a character. The value specified is a multiplier. A value of 2 will double the width and height. A value of 3 will triple the dimensions, etc.

-
source

pub fn audio_on(&self)

Turn sound on.

-

The system is configured to generate sound. This function sets the sound mode only until the unit is powered off.

-
source

pub fn audio_off(&self)

Turn sound off (mute).

-

The system is configured to not produce sound (mute). This function sets the sound mode only until the unit is powered off.

-
source

pub fn audio_save_on_off(&self)

Save the current sound state in EEPROM.

-

The current sound state, set by on() or off(), is saved to the reserved system area in EEPROM. This allows the state to carry over between power cycles and after uploading a different sketch.

-

Note -EEPROM is limited in the number of times it can be written to. Sketches should not continuously change and then save the state rapidly.

-
source

pub fn audio_toggle(&self)

Toggle the sound on/off state.

-

If the system is configured for sound on, it will be changed to sound off (mute). If sound is off, it will be changed to on. This function sets the sound mode only until the unit is powered off. To save the current mode use saveOnOff().

-
source

pub fn audio_on_and_save(&self)

Combines the use function of audio_on() and audio_save_on_off()

-
source

pub fn audio_enabled(&self) -> bool

Get the current sound state.

-
Returns
-

true if sound is currently enabled (not muted).

-

This function should be used by code that actually generates sound. If true is returned, sound can be produced. If false is returned, sound should be muted.

-
source

pub fn invert(&self, inverse: bool)

Invert the entire display or set it back to normal.

-
Parameters
-
    -
  • inverse true will invert the display. false will set the display to no-inverted.
  • -
-

Calling this function with a value of true will set the display to inverted mode. A pixel with a value of 0 will be on and a pixel set to 1 will be off.

-

Once in inverted mode, the display will remain this way until it is set back to non-inverted mode by calling this function with false.

-
source

pub fn collide_point(&self, point: Point, rect: Rect) -> bool

Test if a point falls within a rectangle.

-

Parameters

-
    -
  • point A structure describing the location of the point.
  • -
  • rect A structure describing the location and size of the rectangle.
  • -
-

Returns -true if the specified point is within the specified rectangle.

-

This function is intended to detemine if an object, whose boundaries are defined by the given rectangle, is in contact with the given point.

-
source

pub fn collide_rect(&self, rect1: Rect, rect2: Rect) -> bool

Test if a rectangle is intersecting with another rectangle.

-

Parameters

-
    -
  • rect1,rect2 Structures describing the size and locations of the rectangles.
  • -
-

Returns -true if the first rectangle is intersecting the second.

-

This function is intended to detemine if an object, whose boundaries are defined by the given rectangle, is in contact with another rectangular object.

-
source

pub fn digital_write_rgb_single(&self, color: u8, val: u8)

Set one of the RGB LEDs digitally, to either fully on or fully off.

-

Parameters

-
    -
  • color The name of the LED to set. The value given should be one of RED_LED, GREEN_LED or BLUE_LED.
  • -
  • val Indicates whether to turn the specified LED on or off. The value given should be RGB_ON or RGB_OFF.
  • -
-

This 2 parameter version of the function will set a single LED within the RGB LED either fully on or fully off. See the description of the 3 parameter version of this function for more details on the RGB LED.

-
source

pub fn digital_write_rgb(&self, red: u8, green: u8, blue: u8)

Set the RGB LEDs digitally, to either fully on or fully off.

-

Parameters

-
    -
  • red,green,blue Use value RGB_ON or RGB_OFF to set each LED.
  • -
-

The RGB LED is actually individual red, green and blue LEDs placed very close together in a single package. This 3 parameter version of the function will set each LED either on or off, to set the RGB LED to 7 different colors at their highest brightness or turn it off.

-
 The colors are as follows:
- RED LED    GREEN LED    BLUE LED    COLOR
- RGB_OFF    RGB_OFF      RGB_OFF     OFF
- RGB_OFF    RGB_OFF      RGB_ON      Blue
- RGB_OFF    RGB_ON       RGB_OFF     Green
- RGB_OFF    RGB_ON       RGB_ON      Cyan
- RGB_ON     RGB_OFF      RGB_OFF     Red
- RGB_ON     RGB_OFF      RGB_ON      Magenta
- RGB_ON     RGB_ON       RGB_OFF     Yellow
- RGB_ON     RGB_ON       RGB_ON      White
-
source

pub fn set_rgb_led_single(&self, color: u8, val: u8)

Set the brightness of one of the RGB LEDs without affecting the others.

-

Parameters

-
    -
  • color The name of the LED to set. The value given should be one of RED_LED, GREEN_LED or BLUE_LED.
  • -
  • val The brightness value for the LED, from 0 to 255.
  • -
-

Note

-
-

In order to use this function, the 3 parameter version must first be called at least once, in order to initialize the hardware.

-
-

This 2 parameter version of the function will set the brightness of a single LED within the RGB LED without affecting the current brightness of the other two. See the description of the 3 parameter version of this function for more details on the RGB LED.

-
source

pub fn set_rgb_led(&self, red: u8, green: u8, blue: u8)

Set the light output of the RGB LED.

-

Parameters

-
    -
  • red,green,blue The brightness value for each LED.
  • -
-

The RGB LED is actually individual red, green and blue LEDs placed very close together in a single package. By setting the brightness of each LED, the RGB LED can show various colors and intensities. The brightness of each LED can be set to a value from 0 (fully off) to 255 (fully on).

-

Note

-
-

Certain libraries that take control of the hardware timers may interfere with the ability of this function to properly control the RGB LED. ArduboyPlaytune is one such library known to do this. The digital_write_rgb() function will still work properly in this case.

-
-

Note

-
-

Many of the Kickstarter Arduboys were accidentally shipped with the RGB LED installed incorrectly. For these units, the green LED cannot be lit. As long as the green led is set to off, setting the red LED will actually control the blue LED and setting the blue LED will actually control the red LED. If the green LED is turned fully on, none of the LEDs will light.

-
-
source

pub fn every_x_frames(&self, frames: u8) -> bool

Indicate if the specified number of frames has elapsed.

-

Parameters

-
    -
  • frames The desired number of elapsed frames.
  • -
-

Returns -true if the specified number of frames has elapsed.

-

This function should be called with the same value each time for a given event. It will return true if the given number of frames has elapsed since the previous frame in which it returned true.

-
Example
-

If you wanted to fire a shot every 5 frames while the A button is being held down:

- -
if arduboy.everyXFrames(5) {
-    if arduboy.pressed(A_BUTTON) {
-        fireShot();
-    }
-}
-
source

pub fn flip_vertical(&self, flipped: bool)

Flip the display vertically or set it back to normal.

-

Parameters

-
    -
  • flipped true will set vertical flip mode. false will set normal vertical orientation.
  • -
-

Calling this function with a value of true will cause the Y coordinate to start at the bottom edge of the display instead of the top, effectively flipping the display vertically.

-

Once in vertical flip mode, it will remain this way until normal vertical mode is set by calling this function with a value of false.

-
source

pub fn flip_horizontal(&self, flipped: bool)

Flip the display horizontally or set it back to normal.

-

Parameters

-
    -
  • flipped true will set horizontal flip mode. false will set normal horizontal orientation.
  • -
-

Calling this function with a value of true will cause the X coordinate to start at the left edge of the display instead of the right, effectively flipping the display horizontally.

-

Once in horizontal flip mode, it will remain this way until normal horizontal mode is set by calling this function with a value of false.

-
source

pub fn set_text_color(&self, color: Color)

Set the text foreground color.

-

Parameters

-
    -
  • color The color to be used for following text. The values WHITE or BLACK should be used.
  • -
-
source

pub fn set_text_background_color(&self, color: Color)

Set the text background color.

-

Parameters

-
    -
  • color The background color to be used for following text. The values WHITE or BLACK should be used.
  • -
-

The background pixels of following characters will be set to the specified color.

-

However, if the background color is set to be the same as the text color, the background will be transparent. Only the foreground pixels will be drawn. The background pixels will remain as they were before the character was drawn.

-
source

pub fn set_cursor_x(&self, x: i16)

Set the X coordinate of the text cursor location.

-

Parameters

-
    -
  • x The X (horizontal) coordinate, in pixels, for the new location of the text cursor.
  • -
-

The X coordinate for the location of the text cursor is set to the specified value, leaving the Y coordinate unchanged. For more details about the text cursor, see the setCursor() function.

-
source

pub fn set_cursor_y(&self, y: i16)

Set the Y coordinate of the text cursor location.

-

Parameters

-
    -
  • y The Y (vertical) coordinate, in pixels, for the new location of the text cursor.
  • -
-

The Y coordinate for the location of the text cursor is set to the specified value, leaving the X coordinate unchanged. For more details about the text cursor, see the setCursor() function.

-
source

pub fn set_text_wrap(&self, w: bool)

Set or disable text wrap mode.

-

Parameters

-
    -
  • w true enables text wrap mode. false disables it.
  • -
-

Text wrap mode is enabled by specifying true. In wrap mode, if a character to be drawn would end up partially or fully past the right edge of the screen (based on the current text size), it will be placed at the start of the next line. The text cursor will be adjusted accordingly.

-

If wrap mode is disabled, characters will always be written at the current text cursor position. A character near the right edge of the screen may only be partially displayed and characters drawn at a position past the right edge of the screen will remain off screen.

-
source

pub fn idle(&self)

Idle the CPU to save power.

-

This puts the CPU in idle sleep mode. You should call this as often as you can for the best power savings. The timer 0 overflow interrupt will wake up the chip every 1ms, so even at 60 FPS a well written app should be able to sleep maybe half the time in between rendering it’s own frames.

-

Auto Trait Implementations§

§

impl RefUnwindSafe for Arduboy2

§

impl Send for Arduboy2

§

impl Sync for Arduboy2

§

impl Unpin for Arduboy2

§

impl UnwindSafe for Arduboy2

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/struct.ArduboyTones.html b/docs/doc/arduboy_rust/prelude/struct.ArduboyTones.html deleted file mode 100644 index 2965637..0000000 --- a/docs/doc/arduboy_rust/prelude/struct.ArduboyTones.html +++ /dev/null @@ -1,94 +0,0 @@ -ArduboyTones in arduboy_rust::prelude - Rust
pub struct ArduboyTones {}
Expand description

This is the struct to interact in a save way with the ArduboyTones C++ library.

-

You will need to uncomment the ArduboyTones_Library in the import_config.h file.

-

Implementations§

source§

impl ArduboyTones

source

pub const fn new() -> ArduboyTones

Get a new instance of ArduboyTones

-
Example
-
const sound: ArduboyTones = ArduboyTones::new();
-
source

pub fn tone(&self, frequency: u16, duration: u32)

Play a single tone.

-
    -
  • freq The frequency of the tone, in hertz.
  • -
  • dur The duration to play the tone for, in 1024ths of a -second (very close to milliseconds). A duration of 0, or if not provided, -means play forever, or until noTone() is called or a new tone or -sequence is started.
  • -
-
source

pub fn tone2( - &self, - frequency1: u16, - duration1: u32, - frequency2: u16, - duration2: u32 -)

Play two tones in sequence.

-
    -
  • freq1,freq2 The frequency of the tone in hertz.
  • -
  • dur1,dur2 The duration to play the tone for, in 1024ths of a -second (very close to milliseconds).
  • -
-
source

pub fn tone3( - &self, - frequency1: u16, - duration1: u32, - frequency2: u16, - duration2: u32, - frequency3: u16, - duration3: u32 -)

Play three tones in sequence.

-
    -
  • freq1,freq2,freq3 The frequency of the tone, in hertz.
  • -
  • dur1,dur2,dur3 The duration to play the tone for, in 1024ths of a -second (very close to milliseconds).
  • -
-
source

pub fn tones(&self, tones: *const u16)

Play a tone sequence from frequency/duration pairs in a PROGMEM array.

-
    -
  • tones A pointer to an array of frequency/duration pairs.
  • -
-

The array must be placed in code space using PROGMEM.

-

See the tone() function for details on the frequency and duration values. -A frequency of 0 for any tone means silence (a musical rest).

-

The last element of the array must be TONES_END or TONES_REPEAT.

-

Example:

- -
progmem!(
-    static sound1:[u8;_]=[220,1000, 0,250, 440,500, 880,2000,TONES_END]
-);
-
-tones(get_tones_addr!(sound1));
-
source

pub fn no_tone(&self)

Stop playing the tone or sequence.

-

If a tone or sequence is playing, it will stop. If nothing -is playing, this function will do nothing.

-
source

pub fn playing(&self) -> bool

Check if a tone or tone sequence is playing.

-
    -
  • return boolean true if playing (even if sound is muted).
  • -
-
source

pub fn tones_in_ram(&self, tones: *mut u32)

Play a tone sequence from frequency/duration pairs in an array in RAM.

-
    -
  • tones A pointer to an array of frequency/duration pairs.
  • -
-

The array must be located in RAM.

-

See the tone() function for details on the frequency and duration values. -A frequency of 0 for any tone means silence (a musical rest).

-

The last element of the array must be TONES_END or TONES_REPEAT.

-

Example:

- -
let sound2: [u16; 9] = [220, 1000, 0, 250, 440, 500, 880, 2000, TONES_END];
-

Using tones(), with the data in PROGMEM, is normally a better -choice. The only reason to use tonesInRAM() would be if dynamically -altering the contents of the array is required.

-
source

pub fn volume_mode(&self, mode: u8)

Set the volume to always normal, always high, or tone controlled.

-

One of the following values should be used:

-
    -
  • VOLUME_IN_TONE The volume of each tone will be specified in the tone -itself.
  • -
  • VOLUME_ALWAYS_NORMAL All tones will play at the normal volume level.
  • -
  • VOLUME_ALWAYS_HIGH All tones will play at the high volume level.
  • -
-

Auto Trait Implementations§

§

impl RefUnwindSafe for ArduboyTones

§

impl Send for ArduboyTones

§

impl Sync for ArduboyTones

§

impl Unpin for ArduboyTones

§

impl UnwindSafe for ArduboyTones

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/struct.ButtonSet.html b/docs/doc/arduboy_rust/prelude/struct.ButtonSet.html deleted file mode 100644 index 85d6102..0000000 --- a/docs/doc/arduboy_rust/prelude/struct.ButtonSet.html +++ /dev/null @@ -1,23 +0,0 @@ -ButtonSet in arduboy_rust::prelude - Rust
pub struct ButtonSet {
-    pub flag_set: u8,
-}
Expand description

This struct gives the library a understanding what Buttons on the Arduboy are.

-

Fields§

§flag_set: u8

Implementations§

source§

impl ButtonSet

source

pub unsafe fn pressed(&self) -> bool

source

pub unsafe fn just_pressed(&self) -> bool

source

pub unsafe fn just_released(&self) -> bool

source

pub unsafe fn not_pressed(&self) -> bool

Trait Implementations§

source§

impl BitOr<ButtonSet> for ButtonSet

§

type Output = ButtonSet

The resulting type after applying the | operator.
source§

fn bitor(self, other: Self) -> Self

Performs the | operation. Read more
source§

impl Clone for ButtonSet

source§

fn clone(&self) -> ButtonSet

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ButtonSet

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for ButtonSet

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl Ord for ButtonSet

source§

fn cmp(&self, other: &ButtonSet) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<ButtonSet> for ButtonSet

source§

fn eq(&self, other: &ButtonSet) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<ButtonSet> for ButtonSet

source§

fn partial_cmp(&self, other: &ButtonSet) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for ButtonSet

source§

impl Eq for ButtonSet

source§

impl StructuralEq for ButtonSet

source§

impl StructuralPartialEq for ButtonSet

Auto Trait Implementations§

§

impl RefUnwindSafe for ButtonSet

§

impl Send for ButtonSet

§

impl Sync for ButtonSet

§

impl Unpin for ButtonSet

§

impl UnwindSafe for ButtonSet

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/struct.EEPROM.html b/docs/doc/arduboy_rust/prelude/struct.EEPROM.html deleted file mode 100644 index 5b9ff48..0000000 --- a/docs/doc/arduboy_rust/prelude/struct.EEPROM.html +++ /dev/null @@ -1,25 +0,0 @@ -EEPROM in arduboy_rust::prelude - Rust
pub struct EEPROM { /* private fields */ }
Expand description

This is the struct to store and read structs objects to/from eeprom memory.

-

Example

-
static e: EEPROM = EEPROM::new(10);
-struct Scorebord {
-    player1: u16,
-    text: &'static str,
-}
-static mut s: Scorebord = Scorebord {
-    player1: 0,
-    text: "lol\0",
-};
-
-// init inside of the setup function
-e.init(&mut s);
-

Implementations§

source§

impl EEPROM

source

pub const fn new(idx: i16) -> EEPROM

source

pub fn init<T>(&self, your_struct: &mut T)

source

pub fn get<T>(&self, your_struct: &mut T)

source

pub fn get_direct<T>(&self) -> T

source

pub fn put<T>(&self, your_struct: &T)

Auto Trait Implementations§

§

impl RefUnwindSafe for EEPROM

§

impl Send for EEPROM

§

impl Sync for EEPROM

§

impl Unpin for EEPROM

§

impl UnwindSafe for EEPROM

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/struct.EEPROMBYTE.html b/docs/doc/arduboy_rust/prelude/struct.EEPROMBYTE.html deleted file mode 100644 index 81bfe6a..0000000 --- a/docs/doc/arduboy_rust/prelude/struct.EEPROMBYTE.html +++ /dev/null @@ -1,12 +0,0 @@ -EEPROMBYTE in arduboy_rust::prelude - Rust
pub struct EEPROMBYTE { /* private fields */ }
Expand description

Use this struct to store and read single bytes to/from eeprom memory.

-

Implementations§

source§

impl EEPROMBYTE

source

pub const fn new(idx: i16) -> EEPROMBYTE

source

pub fn init(&self)

source

pub fn read(&self) -> u8

source

pub fn update(&self, val: u8)

source

pub fn write(&self, val: u8)

Auto Trait Implementations§

§

impl RefUnwindSafe for EEPROMBYTE

§

impl Send for EEPROMBYTE

§

impl Sync for EEPROMBYTE

§

impl Unpin for EEPROMBYTE

§

impl UnwindSafe for EEPROMBYTE

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/struct.EEPROMBYTECHECKLESS.html b/docs/doc/arduboy_rust/prelude/struct.EEPROMBYTECHECKLESS.html deleted file mode 100644 index f27edb9..0000000 --- a/docs/doc/arduboy_rust/prelude/struct.EEPROMBYTECHECKLESS.html +++ /dev/null @@ -1,13 +0,0 @@ -EEPROMBYTECHECKLESS in arduboy_rust::prelude - Rust
pub struct EEPROMBYTECHECKLESS { /* private fields */ }
Expand description

Use this struct to store and read single bytes to/from eeprom memory without using a check digit. -Unlike the other eeprom structs, this does not need to be initialised.

-

Implementations§

source§

impl EEPROMBYTECHECKLESS

source

pub const fn new(idx: i16) -> EEPROMBYTECHECKLESS

source

pub fn read(&self) -> u8

source

pub fn update(&self, val: u8)

source

pub fn write(&self, val: u8)

Auto Trait Implementations§

§

impl RefUnwindSafe for EEPROMBYTECHECKLESS

§

impl Send for EEPROMBYTECHECKLESS

§

impl Sync for EEPROMBYTECHECKLESS

§

impl Unpin for EEPROMBYTECHECKLESS

§

impl UnwindSafe for EEPROMBYTECHECKLESS

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/struct.LinearMap.html b/docs/doc/arduboy_rust/prelude/struct.LinearMap.html deleted file mode 100644 index d5e203d..0000000 --- a/docs/doc/arduboy_rust/prelude/struct.LinearMap.html +++ /dev/null @@ -1,214 +0,0 @@ -LinearMap in arduboy_rust::prelude - Rust
pub struct LinearMap<K, V, const N: usize> { /* private fields */ }
Expand description

A fixed capacity map / dictionary that performs lookups via linear search

-

Note that as this map doesn’t use hashing so most operations are O(N) instead of O(1)

-

Implementations§

source§

impl<K, V, const N: usize> LinearMap<K, V, N>

source

pub const fn new() -> LinearMap<K, V, N>

Creates an empty LinearMap

-
Examples
-
use heapless::LinearMap;
-
-// allocate the map on the stack
-let mut map: LinearMap<&str, isize, 8> = LinearMap::new();
-
-// allocate the map in a static variable
-static mut MAP: LinearMap<&str, isize, 8> = LinearMap::new();
-
source§

impl<K, V, const N: usize> LinearMap<K, V, N>where - K: Eq,

source

pub fn capacity(&self) -> usize

Returns the number of elements that the map can hold

-

Computes in O(1) time

-
Examples
-
use heapless::LinearMap;
-
-let map: LinearMap<&str, isize, 8> = LinearMap::new();
-assert_eq!(map.capacity(), 8);
-
source

pub fn clear(&mut self)

Clears the map, removing all key-value pairs

-

Computes in O(1) time

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert(1, "a").unwrap();
-map.clear();
-assert!(map.is_empty());
-
source

pub fn contains_key(&self, key: &K) -> bool

Returns true if the map contains a value for the specified key.

-

Computes in O(N) time

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.contains_key(&1), true);
-assert_eq!(map.contains_key(&2), false);
-
source

pub fn get<Q>(&self, key: &Q) -> Option<&V>where - K: Borrow<Q>, - Q: Eq + ?Sized,

Returns a reference to the value corresponding to the key

-

Computes in O(N) time

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.get(&1), Some(&"a"));
-assert_eq!(map.get(&2), None);
-
source

pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>where - K: Borrow<Q>, - Q: Eq + ?Sized,

Returns a mutable reference to the value corresponding to the key

-

Computes in O(N) time

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert(1, "a").unwrap();
-if let Some(x) = map.get_mut(&1) {
-    *x = "b";
-}
-assert_eq!(map[&1], "b");
-
source

pub fn len(&self) -> usize

Returns the number of elements in this map

-

Computes in O(1) time

-
Examples
-
use heapless::LinearMap;
-
-let mut a: LinearMap<_, _, 8> = LinearMap::new();
-assert_eq!(a.len(), 0);
-a.insert(1, "a").unwrap();
-assert_eq!(a.len(), 1);
-
source

pub fn insert(&mut self, key: K, value: V) -> Result<Option<V>, (K, V)>

Inserts a key-value pair into the map.

-

If the map did not have this key present, None is returned.

-

If the map did have this key present, the value is updated, and the old value is returned.

-

Computes in O(N) time

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-assert_eq!(map.insert(37, "a").unwrap(), None);
-assert_eq!(map.is_empty(), false);
-
-map.insert(37, "b").unwrap();
-assert_eq!(map.insert(37, "c").unwrap(), Some("b"));
-assert_eq!(map[&37], "c");
-
source

pub fn is_empty(&self) -> bool

Returns true if the map contains no elements

-

Computes in O(1) time

-
Examples
-
use heapless::LinearMap;
-
-let mut a: LinearMap<_, _, 8> = LinearMap::new();
-assert!(a.is_empty());
-a.insert(1, "a").unwrap();
-assert!(!a.is_empty());
-
source

pub fn iter(&self) -> Iter<'_, K, V>

An iterator visiting all key-value pairs in arbitrary order.

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for (key, val) in map.iter() {
-    println!("key: {} val: {}", key, val);
-}
-
source

pub fn iter_mut(&mut self) -> IterMut<'_, K, V>

An iterator visiting all key-value pairs in arbitrary order, with mutable references to the -values

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-// Update all values
-for (_, val) in map.iter_mut() {
-    *val = 2;
-}
-
-for (key, val) in &map {
-    println!("key: {} val: {}", key, val);
-}
-
source

pub fn keys(&self) -> impl Iterator<Item = &K>

An iterator visiting all keys in arbitrary order

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for key in map.keys() {
-    println!("{}", key);
-}
-
source

pub fn remove<Q>(&mut self, key: &Q) -> Option<V>where - K: Borrow<Q>, - Q: Eq + ?Sized,

Removes a key from the map, returning the value at the key if the key was previously in the -map

-

Computes in O(N) time

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.remove(&1), Some("a"));
-assert_eq!(map.remove(&1), None);
-
source

pub fn values(&self) -> impl Iterator<Item = &V>

An iterator visiting all values in arbitrary order

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for val in map.values() {
-    println!("{}", val);
-}
-
source

pub fn values_mut(&mut self) -> impl Iterator<Item = &mut V>

An iterator visiting all values mutably in arbitrary order

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for val in map.values_mut() {
-    *val += 10;
-}
-
-for val in map.values() {
-    println!("{}", val);
-}
-

Trait Implementations§

source§

impl<K, V, const N: usize> Clone for LinearMap<K, V, N>where - K: Eq + Clone, - V: Clone,

source§

fn clone(&self) -> LinearMap<K, V, N>

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<K, V, const N: usize> Debug for LinearMap<K, V, N>where - K: Eq + Debug, - V: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<K, V, const N: usize> Default for LinearMap<K, V, N>where - K: Eq,

source§

fn default() -> LinearMap<K, V, N>

Returns the “default value” for a type. Read more
source§

impl<K, V, const N: usize> Drop for LinearMap<K, V, N>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<K, V, const N: usize> FromIterator<(K, V)> for LinearMap<K, V, N>where - K: Eq,

source§

fn from_iter<I>(iter: I) -> LinearMap<K, V, N>where - I: IntoIterator<Item = (K, V)>,

Creates a value from an iterator. Read more
source§

impl<'a, K, V, Q, const N: usize> Index<&'a Q> for LinearMap<K, V, N>where - K: Borrow<Q> + Eq, - Q: Eq + ?Sized,

§

type Output = V

The returned type after indexing.
source§

fn index(&self, key: &Q) -> &V

Performs the indexing (container[index]) operation. Read more
source§

impl<'a, K, V, Q, const N: usize> IndexMut<&'a Q> for LinearMap<K, V, N>where - K: Borrow<Q> + Eq, - Q: Eq + ?Sized,

source§

fn index_mut(&mut self, key: &Q) -> &mut V

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<'a, K, V, const N: usize> IntoIterator for &'a LinearMap<K, V, N>where - K: Eq,

§

type Item = (&'a K, &'a V)

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, K, V>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <&'a LinearMap<K, V, N> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<K, V, const N: usize, const N2: usize> PartialEq<LinearMap<K, V, N2>> for LinearMap<K, V, N>where - K: Eq, - V: PartialEq<V>,

source§

fn eq(&self, other: &LinearMap<K, V, N2>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<K, V, const N: usize> Eq for LinearMap<K, V, N>where - K: Eq, - V: PartialEq<V>,

Auto Trait Implementations§

§

impl<K, V, const N: usize> RefUnwindSafe for LinearMap<K, V, N>where - K: RefUnwindSafe, - V: RefUnwindSafe,

§

impl<K, V, const N: usize> Send for LinearMap<K, V, N>where - K: Send, - V: Send,

§

impl<K, V, const N: usize> Sync for LinearMap<K, V, N>where - K: Sync, - V: Sync,

§

impl<K, V, const N: usize> Unpin for LinearMap<K, V, N>where - K: Unpin, - V: Unpin,

§

impl<K, V, const N: usize> UnwindSafe for LinearMap<K, V, N>where - K: UnwindSafe, - V: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/struct.Point.html b/docs/doc/arduboy_rust/prelude/struct.Point.html deleted file mode 100644 index b73f3e6..0000000 --- a/docs/doc/arduboy_rust/prelude/struct.Point.html +++ /dev/null @@ -1,17 +0,0 @@ -Point in arduboy_rust::prelude - Rust

Struct arduboy_rust::prelude::Point

source ·
pub struct Point {
-    pub x: i16,
-    pub y: i16,
-}
Expand description

This struct is used by a few Arduboy functions.

-

Fields§

§x: i16

Position X

-
§y: i16

Position Y

-

Trait Implementations§

source§

impl Clone for Point

source§

fn clone(&self) -> Point

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Point

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for Point

Auto Trait Implementations§

§

impl RefUnwindSafe for Point

§

impl Send for Point

§

impl Sync for Point

§

impl Unpin for Point

§

impl UnwindSafe for Point

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/struct.Rect.html b/docs/doc/arduboy_rust/prelude/struct.Rect.html deleted file mode 100644 index 64dd7f2..0000000 --- a/docs/doc/arduboy_rust/prelude/struct.Rect.html +++ /dev/null @@ -1,21 +0,0 @@ -Rect in arduboy_rust::prelude - Rust

Struct arduboy_rust::prelude::Rect

source ·
pub struct Rect {
-    pub x: i16,
-    pub y: i16,
-    pub width: u8,
-    pub height: u8,
-}
Expand description

This struct is used by a few Arduboy functions.

-

Fields§

§x: i16

Position X

-
§y: i16

Position Y

-
§width: u8

Rect width

-
§height: u8

Rect height

-

Trait Implementations§

source§

impl Clone for Rect

source§

fn clone(&self) -> Rect

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Rect

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for Rect

Auto Trait Implementations§

§

impl RefUnwindSafe for Rect

§

impl Send for Rect

§

impl Sync for Rect

§

impl Unpin for Rect

§

impl UnwindSafe for Rect

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/struct.String.html b/docs/doc/arduboy_rust/prelude/struct.String.html deleted file mode 100644 index a85f9ee..0000000 --- a/docs/doc/arduboy_rust/prelude/struct.String.html +++ /dev/null @@ -1,1376 +0,0 @@ -String in arduboy_rust::prelude - Rust
pub struct String<const N: usize> { /* private fields */ }
Expand description

A fixed capacity String

-

Implementations§

source§

impl<const N: usize> String<N>

source

pub const fn new() -> String<N>

Constructs a new, empty String with a fixed capacity of N bytes

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-// allocate the string on the stack
-let mut s: String<4> = String::new();
-
-// allocate the string in a static variable
-static mut S: String<4> = String::new();
-
source

pub fn into_bytes(self) -> Vec<u8, N>

Converts a String into a byte vector.

-

This consumes the String, so we do not need to copy its contents.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let s: String<4> = String::from("ab");
-let b = s.into_bytes();
-assert!(b.len() == 2);
-
-assert_eq!(&['a' as u8, 'b' as u8], &b[..]);
-
source

pub fn as_str(&self) -> &str

Extracts a string slice containing the entire string.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<4> = String::from("ab");
-assert!(s.as_str() == "ab");
-
-let _s = s.as_str();
-// s.push('c'); // <- cannot borrow `s` as mutable because it is also borrowed as immutable
-
source

pub fn as_mut_str(&mut self) -> &mut str

Converts a String into a mutable string slice.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<4> = String::from("ab");
-let s = s.as_mut_str();
-s.make_ascii_uppercase();
-
source

pub unsafe fn as_mut_vec(&mut self) -> &mut Vec<u8, N>

Returns a mutable reference to the contents of this String.

-
Safety
-

This function is unsafe because it does not check that the bytes passed -to it are valid UTF-8. If this constraint is violated, it may cause -memory unsafety issues with future users of the String, as the rest of -the library assumes that Strings are valid UTF-8.

-
Examples
-

Basic usage:

- -
let mut s = String::from("hello");
-
-unsafe {
-    let vec = s.as_mut_vec();
-    assert_eq!(&[104, 101, 108, 108, 111][..], &vec[..]);
-
-    vec.reverse();
-}
-assert_eq!(s, "olleh");
-
source

pub fn push_str(&mut self, string: &str) -> Result<(), ()>

Appends a given string slice onto the end of this String.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<8> = String::from("foo");
-
-assert!(s.push_str("bar").is_ok());
-
-assert_eq!("foobar", s);
-
-assert!(s.push_str("tender").is_err());
-
source

pub fn capacity(&self) -> usize

Returns the maximum number of elements the String can hold

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<4> = String::new();
-assert!(s.capacity() == 4);
-
source

pub fn push(&mut self, c: char) -> Result<(), ()>

Appends the given char to the end of this String.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<8> = String::from("abc");
-
-s.push('1').unwrap();
-s.push('2').unwrap();
-s.push('3').unwrap();
-
-assert!("abc123" == s.as_str());
-
-assert_eq!("abc123", s);
-
source

pub fn truncate(&mut self, new_len: usize)

Shortens this String to the specified length.

-

If new_len is greater than the string’s current length, this has no -effect.

-

Note that this method has no effect on the allocated capacity -of the string

-
Panics
-

Panics if new_len does not lie on a char boundary.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<8> = String::from("hello");
-
-s.truncate(2);
-
-assert_eq!("he", s);
-
source

pub fn pop(&mut self) -> Option<char>

Removes the last character from the string buffer and returns it.

-

Returns None if this String is empty.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<8> = String::from("foo");
-
-assert_eq!(s.pop(), Some('o'));
-assert_eq!(s.pop(), Some('o'));
-assert_eq!(s.pop(), Some('f'));
-
-assert_eq!(s.pop(), None);
-
source

pub fn clear(&mut self)

Truncates this String, removing all contents.

-

While this means the String will have a length of zero, it does not -touch its capacity.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<8> = String::from("foo");
-
-s.clear();
-
-assert!(s.is_empty());
-assert_eq!(0, s.len());
-assert_eq!(8, s.capacity());
-

Methods from Deref<Target = str>§

1.0.0

pub fn len(&self) -> usize

Returns the length of self.

-

This length is in bytes, not chars or graphemes. In other words, -it might not be what a human considers the length of the string.

-
Examples
-
let len = "foo".len();
-assert_eq!(3, len);
-
-assert_eq!("ƒoo".len(), 4); // fancy f!
-assert_eq!("ƒoo".chars().count(), 3);
-
1.0.0

pub fn is_empty(&self) -> bool

Returns true if self has a length of zero bytes.

-
Examples
-
let s = "";
-assert!(s.is_empty());
-
-let s = "not empty";
-assert!(!s.is_empty());
-
1.9.0

pub fn is_char_boundary(&self, index: usize) -> bool

Checks that index-th byte is the first byte in a UTF-8 code point -sequence or the end of the string.

-

The start and end of the string (when index == self.len()) are -considered to be boundaries.

-

Returns false if index is greater than self.len().

-
Examples
-
let s = "Löwe 老虎 Léopard";
-assert!(s.is_char_boundary(0));
-// start of `老`
-assert!(s.is_char_boundary(6));
-assert!(s.is_char_boundary(s.len()));
-
-// second byte of `ö`
-assert!(!s.is_char_boundary(2));
-
-// third byte of `老`
-assert!(!s.is_char_boundary(8));
-

pub fn floor_char_boundary(&self, index: usize) -> usize

🔬This is a nightly-only experimental API. (round_char_boundary)

Finds the closest x not exceeding index where is_char_boundary(x) is true.

-

This method can help you truncate a string so that it’s still valid UTF-8, but doesn’t -exceed a given number of bytes. Note that this is done purely at the character level -and can still visually split graphemes, even though the underlying characters aren’t -split. For example, the emoji 🧑‍🔬 (scientist) could be split so that the string only -includes 🧑 (person) instead.

-
Examples
-
#![feature(round_char_boundary)]
-let s = "❤️🧡💛💚💙💜";
-assert_eq!(s.len(), 26);
-assert!(!s.is_char_boundary(13));
-
-let closest = s.floor_char_boundary(13);
-assert_eq!(closest, 10);
-assert_eq!(&s[..closest], "❤️🧡");
-

pub fn ceil_char_boundary(&self, index: usize) -> usize

🔬This is a nightly-only experimental API. (round_char_boundary)

Finds the closest x not below index where is_char_boundary(x) is true.

-

If index is greater than the length of the string, this returns the length of the string.

-

This method is the natural complement to floor_char_boundary. See that method -for more details.

-
Examples
-
#![feature(round_char_boundary)]
-let s = "❤️🧡💛💚💙💜";
-assert_eq!(s.len(), 26);
-assert!(!s.is_char_boundary(13));
-
-let closest = s.ceil_char_boundary(13);
-assert_eq!(closest, 14);
-assert_eq!(&s[..closest], "❤️🧡💛");
-
1.0.0

pub fn as_bytes(&self) -> &[u8]

Converts a string slice to a byte slice. To convert the byte slice back -into a string slice, use the [from_utf8] function.

-
Examples
-
let bytes = "bors".as_bytes();
-assert_eq!(b"bors", bytes);
-
1.20.0

pub unsafe fn as_bytes_mut(&mut self) -> &mut [u8]

Converts a mutable string slice to a mutable byte slice.

-
Safety
-

The caller must ensure that the content of the slice is valid UTF-8 -before the borrow ends and the underlying str is used.

-

Use of a str whose contents are not valid UTF-8 is undefined behavior.

-
Examples
-

Basic usage:

- -
let mut s = String::from("Hello");
-let bytes = unsafe { s.as_bytes_mut() };
-
-assert_eq!(b"Hello", bytes);
-

Mutability:

- -
let mut s = String::from("🗻∈🌏");
-
-unsafe {
-    let bytes = s.as_bytes_mut();
-
-    bytes[0] = 0xF0;
-    bytes[1] = 0x9F;
-    bytes[2] = 0x8D;
-    bytes[3] = 0x94;
-}
-
-assert_eq!("🍔∈🌏", s);
-
1.0.0

pub fn as_ptr(&self) -> *const u8

Converts a string slice to a raw pointer.

-

As string slices are a slice of bytes, the raw pointer points to a -[u8]. This pointer will be pointing to the first byte of the string -slice.

-

The caller must ensure that the returned pointer is never written to. -If you need to mutate the contents of the string slice, use as_mut_ptr.

-
Examples
-
let s = "Hello";
-let ptr = s.as_ptr();
-
1.36.0

pub fn as_mut_ptr(&mut self) -> *mut u8

Converts a mutable string slice to a raw pointer.

-

As string slices are a slice of bytes, the raw pointer points to a -[u8]. This pointer will be pointing to the first byte of the string -slice.

-

It is your responsibility to make sure that the string slice only gets -modified in a way that it remains valid UTF-8.

-
1.20.0

pub fn get<I>(&self, i: I) -> Option<&<I as SliceIndex<str>>::Output>where - I: SliceIndex<str>,

Returns a subslice of str.

-

This is the non-panicking alternative to indexing the str. Returns -[None] whenever equivalent indexing operation would panic.

-
Examples
-
let v = String::from("🗻∈🌏");
-
-assert_eq!(Some("🗻"), v.get(0..4));
-
-// indices not on UTF-8 sequence boundaries
-assert!(v.get(1..).is_none());
-assert!(v.get(..8).is_none());
-
-// out of bounds
-assert!(v.get(..42).is_none());
-
1.20.0

pub fn get_mut<I>( - &mut self, - i: I -) -> Option<&mut <I as SliceIndex<str>>::Output>where - I: SliceIndex<str>,

Returns a mutable subslice of str.

-

This is the non-panicking alternative to indexing the str. Returns -[None] whenever equivalent indexing operation would panic.

-
Examples
-
let mut v = String::from("hello");
-// correct length
-assert!(v.get_mut(0..5).is_some());
-// out of bounds
-assert!(v.get_mut(..42).is_none());
-assert_eq!(Some("he"), v.get_mut(0..2).map(|v| &*v));
-
-assert_eq!("hello", v);
-{
-    let s = v.get_mut(0..2);
-    let s = s.map(|s| {
-        s.make_ascii_uppercase();
-        &*s
-    });
-    assert_eq!(Some("HE"), s);
-}
-assert_eq!("HEllo", v);
-
1.20.0

pub unsafe fn get_unchecked<I>(&self, i: I) -> &<I as SliceIndex<str>>::Outputwhere - I: SliceIndex<str>,

Returns an unchecked subslice of str.

-

This is the unchecked alternative to indexing the str.

-
Safety
-

Callers of this function are responsible that these preconditions are -satisfied:

-
    -
  • The starting index must not exceed the ending index;
  • -
  • Indexes must be within bounds of the original slice;
  • -
  • Indexes must lie on UTF-8 sequence boundaries.
  • -
-

Failing that, the returned string slice may reference invalid memory or -violate the invariants communicated by the str type.

-
Examples
-
let v = "🗻∈🌏";
-unsafe {
-    assert_eq!("🗻", v.get_unchecked(0..4));
-    assert_eq!("∈", v.get_unchecked(4..7));
-    assert_eq!("🌏", v.get_unchecked(7..11));
-}
-
1.20.0

pub unsafe fn get_unchecked_mut<I>( - &mut self, - i: I -) -> &mut <I as SliceIndex<str>>::Outputwhere - I: SliceIndex<str>,

Returns a mutable, unchecked subslice of str.

-

This is the unchecked alternative to indexing the str.

-
Safety
-

Callers of this function are responsible that these preconditions are -satisfied:

-
    -
  • The starting index must not exceed the ending index;
  • -
  • Indexes must be within bounds of the original slice;
  • -
  • Indexes must lie on UTF-8 sequence boundaries.
  • -
-

Failing that, the returned string slice may reference invalid memory or -violate the invariants communicated by the str type.

-
Examples
-
let mut v = String::from("🗻∈🌏");
-unsafe {
-    assert_eq!("🗻", v.get_unchecked_mut(0..4));
-    assert_eq!("∈", v.get_unchecked_mut(4..7));
-    assert_eq!("🌏", v.get_unchecked_mut(7..11));
-}
-
1.0.0

pub unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &str

👎Deprecated since 1.29.0: use get_unchecked(begin..end) instead

Creates a string slice from another string slice, bypassing safety -checks.

-

This is generally not recommended, use with caution! For a safe -alternative see [str] and Index.

-

This new slice goes from begin to end, including begin but -excluding end.

-

To get a mutable string slice instead, see the -slice_mut_unchecked method.

-
Safety
-

Callers of this function are responsible that three preconditions are -satisfied:

-
    -
  • begin must not exceed end.
  • -
  • begin and end must be byte positions within the string slice.
  • -
  • begin and end must lie on UTF-8 sequence boundaries.
  • -
-
Examples
-
let s = "Löwe 老虎 Léopard";
-
-unsafe {
-    assert_eq!("Löwe 老虎 Léopard", s.slice_unchecked(0, 21));
-}
-
-let s = "Hello, world!";
-
-unsafe {
-    assert_eq!("world", s.slice_unchecked(7, 12));
-}
-
1.5.0

pub unsafe fn slice_mut_unchecked( - &mut self, - begin: usize, - end: usize -) -> &mut str

👎Deprecated since 1.29.0: use get_unchecked_mut(begin..end) instead

Creates a string slice from another string slice, bypassing safety -checks. -This is generally not recommended, use with caution! For a safe -alternative see [str] and IndexMut.

-

This new slice goes from begin to end, including begin but -excluding end.

-

To get an immutable string slice instead, see the -slice_unchecked method.

-
Safety
-

Callers of this function are responsible that three preconditions are -satisfied:

-
    -
  • begin must not exceed end.
  • -
  • begin and end must be byte positions within the string slice.
  • -
  • begin and end must lie on UTF-8 sequence boundaries.
  • -
-
1.4.0

pub fn split_at(&self, mid: usize) -> (&str, &str)

Divide one string slice into two at an index.

-

The argument, mid, should be a byte offset from the start of the -string. It must also be on the boundary of a UTF-8 code point.

-

The two slices returned go from the start of the string slice to mid, -and from mid to the end of the string slice.

-

To get mutable string slices instead, see the split_at_mut -method.

-
Panics
-

Panics if mid is not on a UTF-8 code point boundary, or if it is -past the end of the last code point of the string slice.

-
Examples
-
let s = "Per Martin-Löf";
-
-let (first, last) = s.split_at(3);
-
-assert_eq!("Per", first);
-assert_eq!(" Martin-Löf", last);
-
1.4.0

pub fn split_at_mut(&mut self, mid: usize) -> (&mut str, &mut str)

Divide one mutable string slice into two at an index.

-

The argument, mid, should be a byte offset from the start of the -string. It must also be on the boundary of a UTF-8 code point.

-

The two slices returned go from the start of the string slice to mid, -and from mid to the end of the string slice.

-

To get immutable string slices instead, see the split_at method.

-
Panics
-

Panics if mid is not on a UTF-8 code point boundary, or if it is -past the end of the last code point of the string slice.

-
Examples
-
let mut s = "Per Martin-Löf".to_string();
-{
-    let (first, last) = s.split_at_mut(3);
-    first.make_ascii_uppercase();
-    assert_eq!("PER", first);
-    assert_eq!(" Martin-Löf", last);
-}
-assert_eq!("PER Martin-Löf", s);
-
1.0.0

pub fn chars(&self) -> Chars<'_>

Returns an iterator over the chars of a string slice.

-

As a string slice consists of valid UTF-8, we can iterate through a -string slice by char. This method returns such an iterator.

-

It’s important to remember that char represents a Unicode Scalar -Value, and might not match your idea of what a ‘character’ is. Iteration -over grapheme clusters may be what you actually want. This functionality -is not provided by Rust’s standard library, check crates.io instead.

-
Examples
-

Basic usage:

- -
let word = "goodbye";
-
-let count = word.chars().count();
-assert_eq!(7, count);
-
-let mut chars = word.chars();
-
-assert_eq!(Some('g'), chars.next());
-assert_eq!(Some('o'), chars.next());
-assert_eq!(Some('o'), chars.next());
-assert_eq!(Some('d'), chars.next());
-assert_eq!(Some('b'), chars.next());
-assert_eq!(Some('y'), chars.next());
-assert_eq!(Some('e'), chars.next());
-
-assert_eq!(None, chars.next());
-

Remember, chars might not match your intuition about characters:

- -
let y = "y̆";
-
-let mut chars = y.chars();
-
-assert_eq!(Some('y'), chars.next()); // not 'y̆'
-assert_eq!(Some('\u{0306}'), chars.next());
-
-assert_eq!(None, chars.next());
-
1.0.0

pub fn char_indices(&self) -> CharIndices<'_>

Returns an iterator over the chars of a string slice, and their -positions.

-

As a string slice consists of valid UTF-8, we can iterate through a -string slice by char. This method returns an iterator of both -these chars, as well as their byte positions.

-

The iterator yields tuples. The position is first, the char is -second.

-
Examples
-

Basic usage:

- -
let word = "goodbye";
-
-let count = word.char_indices().count();
-assert_eq!(7, count);
-
-let mut char_indices = word.char_indices();
-
-assert_eq!(Some((0, 'g')), char_indices.next());
-assert_eq!(Some((1, 'o')), char_indices.next());
-assert_eq!(Some((2, 'o')), char_indices.next());
-assert_eq!(Some((3, 'd')), char_indices.next());
-assert_eq!(Some((4, 'b')), char_indices.next());
-assert_eq!(Some((5, 'y')), char_indices.next());
-assert_eq!(Some((6, 'e')), char_indices.next());
-
-assert_eq!(None, char_indices.next());
-

Remember, chars might not match your intuition about characters:

- -
let yes = "y̆es";
-
-let mut char_indices = yes.char_indices();
-
-assert_eq!(Some((0, 'y')), char_indices.next()); // not (0, 'y̆')
-assert_eq!(Some((1, '\u{0306}')), char_indices.next());
-
-// note the 3 here - the last character took up two bytes
-assert_eq!(Some((3, 'e')), char_indices.next());
-assert_eq!(Some((4, 's')), char_indices.next());
-
-assert_eq!(None, char_indices.next());
-
1.0.0

pub fn bytes(&self) -> Bytes<'_>

An iterator over the bytes of a string slice.

-

As a string slice consists of a sequence of bytes, we can iterate -through a string slice by byte. This method returns such an iterator.

-
Examples
-
let mut bytes = "bors".bytes();
-
-assert_eq!(Some(b'b'), bytes.next());
-assert_eq!(Some(b'o'), bytes.next());
-assert_eq!(Some(b'r'), bytes.next());
-assert_eq!(Some(b's'), bytes.next());
-
-assert_eq!(None, bytes.next());
-
1.1.0

pub fn split_whitespace(&self) -> SplitWhitespace<'_>

Splits a string slice by whitespace.

-

The iterator returned will return string slices that are sub-slices of -the original string slice, separated by any amount of whitespace.

-

‘Whitespace’ is defined according to the terms of the Unicode Derived -Core Property White_Space. If you only want to split on ASCII whitespace -instead, use split_ascii_whitespace.

-
Examples
-

Basic usage:

- -
let mut iter = "A few words".split_whitespace();
-
-assert_eq!(Some("A"), iter.next());
-assert_eq!(Some("few"), iter.next());
-assert_eq!(Some("words"), iter.next());
-
-assert_eq!(None, iter.next());
-

All kinds of whitespace are considered:

- -
let mut iter = " Mary   had\ta\u{2009}little  \n\t lamb".split_whitespace();
-assert_eq!(Some("Mary"), iter.next());
-assert_eq!(Some("had"), iter.next());
-assert_eq!(Some("a"), iter.next());
-assert_eq!(Some("little"), iter.next());
-assert_eq!(Some("lamb"), iter.next());
-
-assert_eq!(None, iter.next());
-

If the string is empty or all whitespace, the iterator yields no string slices:

- -
assert_eq!("".split_whitespace().next(), None);
-assert_eq!("   ".split_whitespace().next(), None);
-
1.34.0

pub fn split_ascii_whitespace(&self) -> SplitAsciiWhitespace<'_>

Splits a string slice by ASCII whitespace.

-

The iterator returned will return string slices that are sub-slices of -the original string slice, separated by any amount of ASCII whitespace.

-

To split by Unicode Whitespace instead, use split_whitespace.

-
Examples
-

Basic usage:

- -
let mut iter = "A few words".split_ascii_whitespace();
-
-assert_eq!(Some("A"), iter.next());
-assert_eq!(Some("few"), iter.next());
-assert_eq!(Some("words"), iter.next());
-
-assert_eq!(None, iter.next());
-

All kinds of ASCII whitespace are considered:

- -
let mut iter = " Mary   had\ta little  \n\t lamb".split_ascii_whitespace();
-assert_eq!(Some("Mary"), iter.next());
-assert_eq!(Some("had"), iter.next());
-assert_eq!(Some("a"), iter.next());
-assert_eq!(Some("little"), iter.next());
-assert_eq!(Some("lamb"), iter.next());
-
-assert_eq!(None, iter.next());
-

If the string is empty or all ASCII whitespace, the iterator yields no string slices:

- -
assert_eq!("".split_ascii_whitespace().next(), None);
-assert_eq!("   ".split_ascii_whitespace().next(), None);
-
1.0.0

pub fn lines(&self) -> Lines<'_>

An iterator over the lines of a string, as string slices.

-

Lines are split at line endings that are either newlines (\n) or -sequences of a carriage return followed by a line feed (\r\n).

-

Line terminators are not included in the lines returned by the iterator.

-

Note that any carriage return (\r) not immediately followed by a -line feed (\n) does not split a line. These carriage returns are -thereby included in the produced lines.

-

The final line ending is optional. A string that ends with a final line -ending will return the same lines as an otherwise identical string -without a final line ending.

-
Examples
-

Basic usage:

- -
let text = "foo\r\nbar\n\nbaz\r";
-let mut lines = text.lines();
-
-assert_eq!(Some("foo"), lines.next());
-assert_eq!(Some("bar"), lines.next());
-assert_eq!(Some(""), lines.next());
-// Trailing carriage return is included in the last line
-assert_eq!(Some("baz\r"), lines.next());
-
-assert_eq!(None, lines.next());
-

The final line does not require any ending:

- -
let text = "foo\nbar\n\r\nbaz";
-let mut lines = text.lines();
-
-assert_eq!(Some("foo"), lines.next());
-assert_eq!(Some("bar"), lines.next());
-assert_eq!(Some(""), lines.next());
-assert_eq!(Some("baz"), lines.next());
-
-assert_eq!(None, lines.next());
-
1.0.0

pub fn lines_any(&self) -> LinesAny<'_>

👎Deprecated since 1.4.0: use lines() instead now

An iterator over the lines of a string.

-
1.8.0

pub fn encode_utf16(&self) -> EncodeUtf16<'_>

Returns an iterator of u16 over the string encoded as UTF-16.

-
Examples
-
let text = "Zażółć gęślą jaźń";
-
-let utf8_len = text.len();
-let utf16_len = text.encode_utf16().count();
-
-assert!(utf16_len <= utf8_len);
-
1.0.0

pub fn contains<'a, P>(&'a self, pat: P) -> boolwhere - P: Pattern<'a>,

Returns true if the given pattern matches a sub-slice of -this string slice.

-

Returns false if it does not.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-
let bananas = "bananas";
-
-assert!(bananas.contains("nana"));
-assert!(!bananas.contains("apples"));
-
1.0.0

pub fn starts_with<'a, P>(&'a self, pat: P) -> boolwhere - P: Pattern<'a>,

Returns true if the given pattern matches a prefix of this -string slice.

-

Returns false if it does not.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-
let bananas = "bananas";
-
-assert!(bananas.starts_with("bana"));
-assert!(!bananas.starts_with("nana"));
-
1.0.0

pub fn ends_with<'a, P>(&'a self, pat: P) -> boolwhere - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns true if the given pattern matches a suffix of this -string slice.

-

Returns false if it does not.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-
let bananas = "bananas";
-
-assert!(bananas.ends_with("anas"));
-assert!(!bananas.ends_with("nana"));
-
1.0.0

pub fn find<'a, P>(&'a self, pat: P) -> Option<usize>where - P: Pattern<'a>,

Returns the byte index of the first character of this string slice that -matches the pattern.

-

Returns [None] if the pattern doesn’t match.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-

Simple patterns:

- -
let s = "Löwe 老虎 Léopard Gepardi";
-
-assert_eq!(s.find('L'), Some(0));
-assert_eq!(s.find('é'), Some(14));
-assert_eq!(s.find("pard"), Some(17));
-

More complex patterns using point-free style and closures:

- -
let s = "Löwe 老虎 Léopard";
-
-assert_eq!(s.find(char::is_whitespace), Some(5));
-assert_eq!(s.find(char::is_lowercase), Some(1));
-assert_eq!(s.find(|c: char| c.is_whitespace() || c.is_lowercase()), Some(1));
-assert_eq!(s.find(|c: char| (c < 'o') && (c > 'a')), Some(4));
-

Not finding the pattern:

- -
let s = "Löwe 老虎 Léopard";
-let x: &[_] = &['1', '2'];
-
-assert_eq!(s.find(x), None);
-
1.0.0

pub fn rfind<'a, P>(&'a self, pat: P) -> Option<usize>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns the byte index for the first character of the last match of the pattern in -this string slice.

-

Returns [None] if the pattern doesn’t match.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-

Simple patterns:

- -
let s = "Löwe 老虎 Léopard Gepardi";
-
-assert_eq!(s.rfind('L'), Some(13));
-assert_eq!(s.rfind('é'), Some(14));
-assert_eq!(s.rfind("pard"), Some(24));
-

More complex patterns with closures:

- -
let s = "Löwe 老虎 Léopard";
-
-assert_eq!(s.rfind(char::is_whitespace), Some(12));
-assert_eq!(s.rfind(char::is_lowercase), Some(20));
-

Not finding the pattern:

- -
let s = "Löwe 老虎 Léopard";
-let x: &[_] = &['1', '2'];
-
-assert_eq!(s.rfind(x), None);
-
1.0.0

pub fn split<'a, P>(&'a self, pat: P) -> Split<'a, P>where - P: Pattern<'a>,

An iterator over substrings of this string slice, separated by -characters matched by a pattern.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator will be a [DoubleEndedIterator] if the pattern -allows a reverse search and forward/reverse search yields the same -elements. This is true for, e.g., char, but not for &str.

-

If the pattern allows a reverse search but its results might differ -from a forward search, the rsplit method can be used.

-
Examples
-

Simple patterns:

- -
let v: Vec<&str> = "Mary had a little lamb".split(' ').collect();
-assert_eq!(v, ["Mary", "had", "a", "little", "lamb"]);
-
-let v: Vec<&str> = "".split('X').collect();
-assert_eq!(v, [""]);
-
-let v: Vec<&str> = "lionXXtigerXleopard".split('X').collect();
-assert_eq!(v, ["lion", "", "tiger", "leopard"]);
-
-let v: Vec<&str> = "lion::tiger::leopard".split("::").collect();
-assert_eq!(v, ["lion", "tiger", "leopard"]);
-
-let v: Vec<&str> = "abc1def2ghi".split(char::is_numeric).collect();
-assert_eq!(v, ["abc", "def", "ghi"]);
-
-let v: Vec<&str> = "lionXtigerXleopard".split(char::is_uppercase).collect();
-assert_eq!(v, ["lion", "tiger", "leopard"]);
-

If the pattern is a slice of chars, split on each occurrence of any of the characters:

- -
let v: Vec<&str> = "2020-11-03 23:59".split(&['-', ' ', ':', '@'][..]).collect();
-assert_eq!(v, ["2020", "11", "03", "23", "59"]);
-

A more complex pattern, using a closure:

- -
let v: Vec<&str> = "abc1defXghi".split(|c| c == '1' || c == 'X').collect();
-assert_eq!(v, ["abc", "def", "ghi"]);
-

If a string contains multiple contiguous separators, you will end up -with empty strings in the output:

- -
let x = "||||a||b|c".to_string();
-let d: Vec<_> = x.split('|').collect();
-
-assert_eq!(d, &["", "", "", "", "a", "", "b", "c"]);
-

Contiguous separators are separated by the empty string.

- -
let x = "(///)".to_string();
-let d: Vec<_> = x.split('/').collect();
-
-assert_eq!(d, &["(", "", "", ")"]);
-

Separators at the start or end of a string are neighbored -by empty strings.

- -
let d: Vec<_> = "010".split("0").collect();
-assert_eq!(d, &["", "1", ""]);
-

When the empty string is used as a separator, it separates -every character in the string, along with the beginning -and end of the string.

- -
let f: Vec<_> = "rust".split("").collect();
-assert_eq!(f, &["", "r", "u", "s", "t", ""]);
-

Contiguous separators can lead to possibly surprising behavior -when whitespace is used as the separator. This code is correct:

- -
let x = "    a  b c".to_string();
-let d: Vec<_> = x.split(' ').collect();
-
-assert_eq!(d, &["", "", "", "", "a", "", "b", "c"]);
-

It does not give you:

- -
assert_eq!(d, &["a", "b", "c"]);
-

Use split_whitespace for this behavior.

-
1.51.0

pub fn split_inclusive<'a, P>(&'a self, pat: P) -> SplitInclusive<'a, P>where - P: Pattern<'a>,

An iterator over substrings of this string slice, separated by -characters matched by a pattern. Differs from the iterator produced by -split in that split_inclusive leaves the matched part as the -terminator of the substring.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-
let v: Vec<&str> = "Mary had a little lamb\nlittle lamb\nlittle lamb."
-    .split_inclusive('\n').collect();
-assert_eq!(v, ["Mary had a little lamb\n", "little lamb\n", "little lamb."]);
-

If the last element of the string is matched, -that element will be considered the terminator of the preceding substring. -That substring will be the last item returned by the iterator.

- -
let v: Vec<&str> = "Mary had a little lamb\nlittle lamb\nlittle lamb.\n"
-    .split_inclusive('\n').collect();
-assert_eq!(v, ["Mary had a little lamb\n", "little lamb\n", "little lamb.\n"]);
-
1.0.0

pub fn rsplit<'a, P>(&'a self, pat: P) -> RSplit<'a, P>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over substrings of the given string slice, separated by -characters matched by a pattern and yielded in reverse order.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator requires that the pattern supports a reverse -search, and it will be a [DoubleEndedIterator] if a forward/reverse -search yields the same elements.

-

For iterating from the front, the split method can be used.

-
Examples
-

Simple patterns:

- -
let v: Vec<&str> = "Mary had a little lamb".rsplit(' ').collect();
-assert_eq!(v, ["lamb", "little", "a", "had", "Mary"]);
-
-let v: Vec<&str> = "".rsplit('X').collect();
-assert_eq!(v, [""]);
-
-let v: Vec<&str> = "lionXXtigerXleopard".rsplit('X').collect();
-assert_eq!(v, ["leopard", "tiger", "", "lion"]);
-
-let v: Vec<&str> = "lion::tiger::leopard".rsplit("::").collect();
-assert_eq!(v, ["leopard", "tiger", "lion"]);
-

A more complex pattern, using a closure:

- -
let v: Vec<&str> = "abc1defXghi".rsplit(|c| c == '1' || c == 'X').collect();
-assert_eq!(v, ["ghi", "def", "abc"]);
-
1.0.0

pub fn split_terminator<'a, P>(&'a self, pat: P) -> SplitTerminator<'a, P>where - P: Pattern<'a>,

An iterator over substrings of the given string slice, separated by -characters matched by a pattern.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-

Equivalent to split, except that the trailing substring -is skipped if empty.

-

This method can be used for string data that is terminated, -rather than separated by a pattern.

-
Iterator behavior
-

The returned iterator will be a [DoubleEndedIterator] if the pattern -allows a reverse search and forward/reverse search yields the same -elements. This is true for, e.g., char, but not for &str.

-

If the pattern allows a reverse search but its results might differ -from a forward search, the rsplit_terminator method can be used.

-
Examples
-
let v: Vec<&str> = "A.B.".split_terminator('.').collect();
-assert_eq!(v, ["A", "B"]);
-
-let v: Vec<&str> = "A..B..".split_terminator(".").collect();
-assert_eq!(v, ["A", "", "B", ""]);
-
-let v: Vec<&str> = "A.B:C.D".split_terminator(&['.', ':'][..]).collect();
-assert_eq!(v, ["A", "B", "C", "D"]);
-
1.0.0

pub fn rsplit_terminator<'a, P>(&'a self, pat: P) -> RSplitTerminator<'a, P>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over substrings of self, separated by characters -matched by a pattern and yielded in reverse order.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-

Equivalent to split, except that the trailing substring is -skipped if empty.

-

This method can be used for string data that is terminated, -rather than separated by a pattern.

-
Iterator behavior
-

The returned iterator requires that the pattern supports a -reverse search, and it will be double ended if a forward/reverse -search yields the same elements.

-

For iterating from the front, the split_terminator method can be -used.

-
Examples
-
let v: Vec<&str> = "A.B.".rsplit_terminator('.').collect();
-assert_eq!(v, ["B", "A"]);
-
-let v: Vec<&str> = "A..B..".rsplit_terminator(".").collect();
-assert_eq!(v, ["", "B", "", "A"]);
-
-let v: Vec<&str> = "A.B:C.D".rsplit_terminator(&['.', ':'][..]).collect();
-assert_eq!(v, ["D", "C", "B", "A"]);
-
1.0.0

pub fn splitn<'a, P>(&'a self, n: usize, pat: P) -> SplitN<'a, P>where - P: Pattern<'a>,

An iterator over substrings of the given string slice, separated by a -pattern, restricted to returning at most n items.

-

If n substrings are returned, the last substring (the nth substring) -will contain the remainder of the string.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator will not be double ended, because it is -not efficient to support.

-

If the pattern allows a reverse search, the rsplitn method can be -used.

-
Examples
-

Simple patterns:

- -
let v: Vec<&str> = "Mary had a little lambda".splitn(3, ' ').collect();
-assert_eq!(v, ["Mary", "had", "a little lambda"]);
-
-let v: Vec<&str> = "lionXXtigerXleopard".splitn(3, "X").collect();
-assert_eq!(v, ["lion", "", "tigerXleopard"]);
-
-let v: Vec<&str> = "abcXdef".splitn(1, 'X').collect();
-assert_eq!(v, ["abcXdef"]);
-
-let v: Vec<&str> = "".splitn(1, 'X').collect();
-assert_eq!(v, [""]);
-

A more complex pattern, using a closure:

- -
let v: Vec<&str> = "abc1defXghi".splitn(2, |c| c == '1' || c == 'X').collect();
-assert_eq!(v, ["abc", "defXghi"]);
-
1.0.0

pub fn rsplitn<'a, P>(&'a self, n: usize, pat: P) -> RSplitN<'a, P>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over substrings of this string slice, separated by a -pattern, starting from the end of the string, restricted to returning -at most n items.

-

If n substrings are returned, the last substring (the nth substring) -will contain the remainder of the string.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator will not be double ended, because it is not -efficient to support.

-

For splitting from the front, the splitn method can be used.

-
Examples
-

Simple patterns:

- -
let v: Vec<&str> = "Mary had a little lamb".rsplitn(3, ' ').collect();
-assert_eq!(v, ["lamb", "little", "Mary had a"]);
-
-let v: Vec<&str> = "lionXXtigerXleopard".rsplitn(3, 'X').collect();
-assert_eq!(v, ["leopard", "tiger", "lionX"]);
-
-let v: Vec<&str> = "lion::tiger::leopard".rsplitn(2, "::").collect();
-assert_eq!(v, ["leopard", "lion::tiger"]);
-

A more complex pattern, using a closure:

- -
let v: Vec<&str> = "abc1defXghi".rsplitn(2, |c| c == '1' || c == 'X').collect();
-assert_eq!(v, ["ghi", "abc1def"]);
-
1.52.0

pub fn split_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)>where - P: Pattern<'a>,

Splits the string on the first occurrence of the specified delimiter and -returns prefix before delimiter and suffix after delimiter.

-
Examples
-
assert_eq!("cfg".split_once('='), None);
-assert_eq!("cfg=".split_once('='), Some(("cfg", "")));
-assert_eq!("cfg=foo".split_once('='), Some(("cfg", "foo")));
-assert_eq!("cfg=foo=bar".split_once('='), Some(("cfg", "foo=bar")));
-
1.52.0

pub fn rsplit_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Splits the string on the last occurrence of the specified delimiter and -returns prefix before delimiter and suffix after delimiter.

-
Examples
-
assert_eq!("cfg".rsplit_once('='), None);
-assert_eq!("cfg=foo".rsplit_once('='), Some(("cfg", "foo")));
-assert_eq!("cfg=foo=bar".rsplit_once('='), Some(("cfg=foo", "bar")));
-
1.2.0

pub fn matches<'a, P>(&'a self, pat: P) -> Matches<'a, P>where - P: Pattern<'a>,

An iterator over the disjoint matches of a pattern within the given string -slice.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator will be a [DoubleEndedIterator] if the pattern -allows a reverse search and forward/reverse search yields the same -elements. This is true for, e.g., char, but not for &str.

-

If the pattern allows a reverse search but its results might differ -from a forward search, the rmatches method can be used.

-
Examples
-
let v: Vec<&str> = "abcXXXabcYYYabc".matches("abc").collect();
-assert_eq!(v, ["abc", "abc", "abc"]);
-
-let v: Vec<&str> = "1abc2abc3".matches(char::is_numeric).collect();
-assert_eq!(v, ["1", "2", "3"]);
-
1.2.0

pub fn rmatches<'a, P>(&'a self, pat: P) -> RMatches<'a, P>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over the disjoint matches of a pattern within this string slice, -yielded in reverse order.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator requires that the pattern supports a reverse -search, and it will be a [DoubleEndedIterator] if a forward/reverse -search yields the same elements.

-

For iterating from the front, the matches method can be used.

-
Examples
-
let v: Vec<&str> = "abcXXXabcYYYabc".rmatches("abc").collect();
-assert_eq!(v, ["abc", "abc", "abc"]);
-
-let v: Vec<&str> = "1abc2abc3".rmatches(char::is_numeric).collect();
-assert_eq!(v, ["3", "2", "1"]);
-
1.5.0

pub fn match_indices<'a, P>(&'a self, pat: P) -> MatchIndices<'a, P>where - P: Pattern<'a>,

An iterator over the disjoint matches of a pattern within this string -slice as well as the index that the match starts at.

-

For matches of pat within self that overlap, only the indices -corresponding to the first match are returned.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator will be a [DoubleEndedIterator] if the pattern -allows a reverse search and forward/reverse search yields the same -elements. This is true for, e.g., char, but not for &str.

-

If the pattern allows a reverse search but its results might differ -from a forward search, the rmatch_indices method can be used.

-
Examples
-
let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect();
-assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]);
-
-let v: Vec<_> = "1abcabc2".match_indices("abc").collect();
-assert_eq!(v, [(1, "abc"), (4, "abc")]);
-
-let v: Vec<_> = "ababa".match_indices("aba").collect();
-assert_eq!(v, [(0, "aba")]); // only the first `aba`
-
1.5.0

pub fn rmatch_indices<'a, P>(&'a self, pat: P) -> RMatchIndices<'a, P>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over the disjoint matches of a pattern within self, -yielded in reverse order along with the index of the match.

-

For matches of pat within self that overlap, only the indices -corresponding to the last match are returned.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator requires that the pattern supports a reverse -search, and it will be a [DoubleEndedIterator] if a forward/reverse -search yields the same elements.

-

For iterating from the front, the match_indices method can be used.

-
Examples
-
let v: Vec<_> = "abcXXXabcYYYabc".rmatch_indices("abc").collect();
-assert_eq!(v, [(12, "abc"), (6, "abc"), (0, "abc")]);
-
-let v: Vec<_> = "1abcabc2".rmatch_indices("abc").collect();
-assert_eq!(v, [(4, "abc"), (1, "abc")]);
-
-let v: Vec<_> = "ababa".rmatch_indices("aba").collect();
-assert_eq!(v, [(2, "aba")]); // only the last `aba`
-
1.0.0

pub fn trim(&self) -> &str

Returns a string slice with leading and trailing whitespace removed.

-

‘Whitespace’ is defined according to the terms of the Unicode Derived -Core Property White_Space, which includes newlines.

-
Examples
-
let s = "\n Hello\tworld\t\n";
-
-assert_eq!("Hello\tworld", s.trim());
-
1.30.0

pub fn trim_start(&self) -> &str

Returns a string slice with leading whitespace removed.

-

‘Whitespace’ is defined according to the terms of the Unicode Derived -Core Property White_Space, which includes newlines.

-
Text directionality
-

A string is a sequence of bytes. start in this context means the first -position of that byte string; for a left-to-right language like English or -Russian, this will be left side, and for right-to-left languages like -Arabic or Hebrew, this will be the right side.

-
Examples
-

Basic usage:

- -
let s = "\n Hello\tworld\t\n";
-assert_eq!("Hello\tworld\t\n", s.trim_start());
-

Directionality:

- -
let s = "  English  ";
-assert!(Some('E') == s.trim_start().chars().next());
-
-let s = "  עברית  ";
-assert!(Some('ע') == s.trim_start().chars().next());
-
1.30.0

pub fn trim_end(&self) -> &str

Returns a string slice with trailing whitespace removed.

-

‘Whitespace’ is defined according to the terms of the Unicode Derived -Core Property White_Space, which includes newlines.

-
Text directionality
-

A string is a sequence of bytes. end in this context means the last -position of that byte string; for a left-to-right language like English or -Russian, this will be right side, and for right-to-left languages like -Arabic or Hebrew, this will be the left side.

-
Examples
-

Basic usage:

- -
let s = "\n Hello\tworld\t\n";
-assert_eq!("\n Hello\tworld", s.trim_end());
-

Directionality:

- -
let s = "  English  ";
-assert!(Some('h') == s.trim_end().chars().rev().next());
-
-let s = "  עברית  ";
-assert!(Some('ת') == s.trim_end().chars().rev().next());
-
1.0.0

pub fn trim_left(&self) -> &str

👎Deprecated since 1.33.0: superseded by trim_start

Returns a string slice with leading whitespace removed.

-

‘Whitespace’ is defined according to the terms of the Unicode Derived -Core Property White_Space.

-
Text directionality
-

A string is a sequence of bytes. ‘Left’ in this context means the first -position of that byte string; for a language like Arabic or Hebrew -which are ‘right to left’ rather than ‘left to right’, this will be -the right side, not the left.

-
Examples
-

Basic usage:

- -
let s = " Hello\tworld\t";
-
-assert_eq!("Hello\tworld\t", s.trim_left());
-

Directionality:

- -
let s = "  English";
-assert!(Some('E') == s.trim_left().chars().next());
-
-let s = "  עברית";
-assert!(Some('ע') == s.trim_left().chars().next());
-
1.0.0

pub fn trim_right(&self) -> &str

👎Deprecated since 1.33.0: superseded by trim_end

Returns a string slice with trailing whitespace removed.

-

‘Whitespace’ is defined according to the terms of the Unicode Derived -Core Property White_Space.

-
Text directionality
-

A string is a sequence of bytes. ‘Right’ in this context means the last -position of that byte string; for a language like Arabic or Hebrew -which are ‘right to left’ rather than ‘left to right’, this will be -the left side, not the right.

-
Examples
-

Basic usage:

- -
let s = " Hello\tworld\t";
-
-assert_eq!(" Hello\tworld", s.trim_right());
-

Directionality:

- -
let s = "English  ";
-assert!(Some('h') == s.trim_right().chars().rev().next());
-
-let s = "עברית  ";
-assert!(Some('ת') == s.trim_right().chars().rev().next());
-
1.0.0

pub fn trim_matches<'a, P>(&'a self, pat: P) -> &'a strwhere - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: DoubleEndedSearcher<'a>,

Returns a string slice with all prefixes and suffixes that match a -pattern repeatedly removed.

-

The pattern can be a char, a slice of chars, or a function -or closure that determines if a character matches.

-
Examples
-

Simple patterns:

- -
assert_eq!("11foo1bar11".trim_matches('1'), "foo1bar");
-assert_eq!("123foo1bar123".trim_matches(char::is_numeric), "foo1bar");
-
-let x: &[_] = &['1', '2'];
-assert_eq!("12foo1bar12".trim_matches(x), "foo1bar");
-

A more complex pattern, using a closure:

- -
assert_eq!("1foo1barXX".trim_matches(|c| c == '1' || c == 'X'), "foo1bar");
-
1.30.0

pub fn trim_start_matches<'a, P>(&'a self, pat: P) -> &'a strwhere - P: Pattern<'a>,

Returns a string slice with all prefixes that match a pattern -repeatedly removed.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Text directionality
-

A string is a sequence of bytes. start in this context means the first -position of that byte string; for a left-to-right language like English or -Russian, this will be left side, and for right-to-left languages like -Arabic or Hebrew, this will be the right side.

-
Examples
-
assert_eq!("11foo1bar11".trim_start_matches('1'), "foo1bar11");
-assert_eq!("123foo1bar123".trim_start_matches(char::is_numeric), "foo1bar123");
-
-let x: &[_] = &['1', '2'];
-assert_eq!("12foo1bar12".trim_start_matches(x), "foo1bar12");
-
1.45.0

pub fn strip_prefix<'a, P>(&'a self, prefix: P) -> Option<&'a str>where - P: Pattern<'a>,

Returns a string slice with the prefix removed.

-

If the string starts with the pattern prefix, returns substring after the prefix, wrapped -in Some. Unlike trim_start_matches, this method removes the prefix exactly once.

-

If the string does not start with prefix, returns None.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-
assert_eq!("foo:bar".strip_prefix("foo:"), Some("bar"));
-assert_eq!("foo:bar".strip_prefix("bar"), None);
-assert_eq!("foofoo".strip_prefix("foo"), Some("foo"));
-
1.45.0

pub fn strip_suffix<'a, P>(&'a self, suffix: P) -> Option<&'a str>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns a string slice with the suffix removed.

-

If the string ends with the pattern suffix, returns the substring before the suffix, -wrapped in Some. Unlike trim_end_matches, this method removes the suffix exactly once.

-

If the string does not end with suffix, returns None.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-
assert_eq!("bar:foo".strip_suffix(":foo"), Some("bar"));
-assert_eq!("bar:foo".strip_suffix("bar"), None);
-assert_eq!("foofoo".strip_suffix("foo"), Some("foo"));
-
1.30.0

pub fn trim_end_matches<'a, P>(&'a self, pat: P) -> &'a strwhere - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns a string slice with all suffixes that match a pattern -repeatedly removed.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Text directionality
-

A string is a sequence of bytes. end in this context means the last -position of that byte string; for a left-to-right language like English or -Russian, this will be right side, and for right-to-left languages like -Arabic or Hebrew, this will be the left side.

-
Examples
-

Simple patterns:

- -
assert_eq!("11foo1bar11".trim_end_matches('1'), "11foo1bar");
-assert_eq!("123foo1bar123".trim_end_matches(char::is_numeric), "123foo1bar");
-
-let x: &[_] = &['1', '2'];
-assert_eq!("12foo1bar12".trim_end_matches(x), "12foo1bar");
-

A more complex pattern, using a closure:

- -
assert_eq!("1fooX".trim_end_matches(|c| c == '1' || c == 'X'), "1foo");
-
1.0.0

pub fn trim_left_matches<'a, P>(&'a self, pat: P) -> &'a strwhere - P: Pattern<'a>,

👎Deprecated since 1.33.0: superseded by trim_start_matches

Returns a string slice with all prefixes that match a pattern -repeatedly removed.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Text directionality
-

A string is a sequence of bytes. ‘Left’ in this context means the first -position of that byte string; for a language like Arabic or Hebrew -which are ‘right to left’ rather than ‘left to right’, this will be -the right side, not the left.

-
Examples
-
assert_eq!("11foo1bar11".trim_left_matches('1'), "foo1bar11");
-assert_eq!("123foo1bar123".trim_left_matches(char::is_numeric), "foo1bar123");
-
-let x: &[_] = &['1', '2'];
-assert_eq!("12foo1bar12".trim_left_matches(x), "foo1bar12");
-
1.0.0

pub fn trim_right_matches<'a, P>(&'a self, pat: P) -> &'a strwhere - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

👎Deprecated since 1.33.0: superseded by trim_end_matches

Returns a string slice with all suffixes that match a pattern -repeatedly removed.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Text directionality
-

A string is a sequence of bytes. ‘Right’ in this context means the last -position of that byte string; for a language like Arabic or Hebrew -which are ‘right to left’ rather than ‘left to right’, this will be -the left side, not the right.

-
Examples
-

Simple patterns:

- -
assert_eq!("11foo1bar11".trim_right_matches('1'), "11foo1bar");
-assert_eq!("123foo1bar123".trim_right_matches(char::is_numeric), "123foo1bar");
-
-let x: &[_] = &['1', '2'];
-assert_eq!("12foo1bar12".trim_right_matches(x), "12foo1bar");
-

A more complex pattern, using a closure:

- -
assert_eq!("1fooX".trim_right_matches(|c| c == '1' || c == 'X'), "1foo");
-
1.0.0

pub fn parse<F>(&self) -> Result<F, <F as FromStr>::Err>where - F: FromStr,

Parses this string slice into another type.

-

Because parse is so general, it can cause problems with type -inference. As such, parse is one of the few times you’ll see -the syntax affectionately known as the ‘turbofish’: ::<>. This -helps the inference algorithm understand specifically which type -you’re trying to parse into.

-

parse can parse into any type that implements the [FromStr] trait.

-
Errors
-

Will return Err if it’s not possible to parse this string slice into -the desired type.

-
Examples
-

Basic usage

- -
let four: u32 = "4".parse().unwrap();
-
-assert_eq!(4, four);
-

Using the ‘turbofish’ instead of annotating four:

- -
let four = "4".parse::<u32>();
-
-assert_eq!(Ok(4), four);
-

Failing to parse:

- -
let nope = "j".parse::<u32>();
-
-assert!(nope.is_err());
-
1.23.0

pub fn is_ascii(&self) -> bool

Checks if all characters in this string are within the ASCII range.

-
Examples
-
let ascii = "hello!\n";
-let non_ascii = "Grüße, Jürgen ❤";
-
-assert!(ascii.is_ascii());
-assert!(!non_ascii.is_ascii());
-

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this string slice is_ascii, returns it as a slice -of ASCII characters, otherwise returns None.

-
1.23.0

pub fn eq_ignore_ascii_case(&self, other: &str) -> bool

Checks that two strings are an ASCII case-insensitive match.

-

Same as to_ascii_lowercase(a) == to_ascii_lowercase(b), -but without allocating and copying temporaries.

-
Examples
-
assert!("Ferris".eq_ignore_ascii_case("FERRIS"));
-assert!("Ferrös".eq_ignore_ascii_case("FERRöS"));
-assert!(!"Ferrös".eq_ignore_ascii_case("FERRÖS"));
-
1.23.0

pub fn make_ascii_uppercase(&mut self)

Converts this string to its ASCII upper case equivalent in-place.

-

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, -but non-ASCII letters are unchanged.

-

To return a new uppercased value without modifying the existing one, use -to_ascii_uppercase().

-
Examples
-
let mut s = String::from("Grüße, Jürgen ❤");
-
-s.make_ascii_uppercase();
-
-assert_eq!("GRüßE, JüRGEN ❤", s);
-
1.23.0

pub fn make_ascii_lowercase(&mut self)

Converts this string to its ASCII lower case equivalent in-place.

-

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, -but non-ASCII letters are unchanged.

-

To return a new lowercased value without modifying the existing one, use -to_ascii_lowercase().

-
Examples
-
let mut s = String::from("GRÜßE, JÜRGEN ❤");
-
-s.make_ascii_lowercase();
-
-assert_eq!("grÜße, jÜrgen ❤", s);
-
1.34.0

pub fn escape_debug(&self) -> EscapeDebug<'_>

Return an iterator that escapes each char in self with [char::escape_debug].

-

Note: only extended grapheme codepoints that begin the string will be -escaped.

-
Examples
-

As an iterator:

- -
for c in "❤\n!".escape_debug() {
-    print!("{c}");
-}
-println!();
-

Using println! directly:

- -
println!("{}", "❤\n!".escape_debug());
-

Both are equivalent to:

- -
println!("❤\\n!");
-

Using to_string:

- -
assert_eq!("❤\n!".escape_debug().to_string(), "❤\\n!");
-
1.34.0

pub fn escape_default(&self) -> EscapeDefault<'_>

Return an iterator that escapes each char in self with [char::escape_default].

-
Examples
-

As an iterator:

- -
for c in "❤\n!".escape_default() {
-    print!("{c}");
-}
-println!();
-

Using println! directly:

- -
println!("{}", "❤\n!".escape_default());
-

Both are equivalent to:

- -
println!("\\u{{2764}}\\n!");
-

Using to_string:

- -
assert_eq!("❤\n!".escape_default().to_string(), "\\u{2764}\\n!");
-
1.34.0

pub fn escape_unicode(&self) -> EscapeUnicode<'_>

Return an iterator that escapes each char in self with [char::escape_unicode].

-
Examples
-

As an iterator:

- -
for c in "❤\n!".escape_unicode() {
-    print!("{c}");
-}
-println!();
-

Using println! directly:

- -
println!("{}", "❤\n!".escape_unicode());
-

Both are equivalent to:

- -
println!("\\u{{2764}}\\u{{a}}\\u{{21}}");
-

Using to_string:

- -
assert_eq!("❤\n!".escape_unicode().to_string(), "\\u{2764}\\u{a}\\u{21}");
-

Trait Implementations§

source§

impl<const N: usize> AsRef<[u8]> for String<N>

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<const N: usize> AsRef<str> for String<N>

source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<const N: usize> Clone for String<N>

source§

fn clone(&self) -> String<N>

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<const N: usize> Debug for String<N>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<const N: usize> Default for String<N>

source§

fn default() -> String<N>

Returns the “default value” for a type. Read more
source§

impl<const N: usize> Deref for String<N>

§

type Target = str

The resulting type after dereferencing.
source§

fn deref(&self) -> &str

Dereferences the value.
source§

impl<const N: usize> DerefMut for String<N>

source§

fn deref_mut(&mut self) -> &mut str

Mutably dereferences the value.
source§

impl<const N: usize> Display for String<N>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'a, const N: usize> From<&'a str> for String<N>

source§

fn from(s: &'a str) -> String<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<i16> for String<N>

source§

fn from(s: i16) -> String<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<i32> for String<N>

source§

fn from(s: i32) -> String<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<i64> for String<N>

source§

fn from(s: i64) -> String<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<i8> for String<N>

source§

fn from(s: i8) -> String<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<u16> for String<N>

source§

fn from(s: u16) -> String<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<u32> for String<N>

source§

fn from(s: u32) -> String<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<u64> for String<N>

source§

fn from(s: u64) -> String<N>

Converts to this type from the input type.
source§

impl<const N: usize> From<u8> for String<N>

source§

fn from(s: u8) -> String<N>

Converts to this type from the input type.
source§

impl<'a, const N: usize> FromIterator<&'a char> for String<N>

source§

fn from_iter<T>(iter: T) -> String<N>where - T: IntoIterator<Item = &'a char>,

Creates a value from an iterator. Read more
source§

impl<'a, const N: usize> FromIterator<&'a str> for String<N>

source§

fn from_iter<T>(iter: T) -> String<N>where - T: IntoIterator<Item = &'a str>,

Creates a value from an iterator. Read more
source§

impl<const N: usize> FromIterator<char> for String<N>

source§

fn from_iter<T>(iter: T) -> String<N>where - T: IntoIterator<Item = char>,

Creates a value from an iterator. Read more
source§

impl<const N: usize> FromStr for String<N>

§

type Err = ()

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<String<N>, <String<N> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
source§

impl<const N: usize> Hash for String<N>

source§

fn hash<H>(&self, hasher: &mut H)where - H: Hasher,

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl<const N: usize> Hash for String<N>

source§

fn hash<H>(&self, hasher: &mut H)where - H: Hasher,

Feeds this value into the given Hasher.
source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher.
source§

impl<const N: usize> Ord for String<N>

source§

fn cmp(&self, other: &String<N>) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<const N: usize> PartialEq<&str> for String<N>

source§

fn eq(&self, other: &&str) -> bool

This method tests for self and other values to be equal, and is used -by ==.
source§

fn ne(&self, other: &&str) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<const N: usize> PartialEq<String<N>> for &str

source§

fn eq(&self, other: &String<N>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
source§

fn ne(&self, other: &String<N>) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<const N: usize> PartialEq<String<N>> for str

source§

fn eq(&self, other: &String<N>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
source§

fn ne(&self, other: &String<N>) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<const N1: usize, const N2: usize> PartialEq<String<N2>> for String<N1>

source§

fn eq(&self, rhs: &String<N2>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
source§

fn ne(&self, rhs: &String<N2>) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<const N: usize> PartialEq<str> for String<N>

source§

fn eq(&self, other: &str) -> bool

This method tests for self and other values to be equal, and is used -by ==.
source§

fn ne(&self, other: &str) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<const N1: usize, const N2: usize> PartialOrd<String<N2>> for String<N1>

source§

fn partial_cmp(&self, other: &String<N2>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl<const N: usize> Printable for String<N>

§

type Parameters = ()

source§

fn print_2(self, _params: Self::Parameters)

source§

fn default_parameters() -> Self::Parameters

source§

fn print(self)

source§

impl<const N: usize> Serialprintable for String<N>

§

type Parameters = ()

source§

fn print_2(self, _params: Self::Parameters)

source§

fn default_parameters() -> Self::Parameters

source§

fn print(self)

source§

impl<const N: usize> Serialprintlnable for String<N>

§

type Parameters = ()

source§

fn println_2(self, _params: Self::Parameters)

source§

fn default_parameters() -> Self::Parameters

source§

fn println(self)

source§

impl<const N: usize> Write for String<N>

source§

fn write_str(&mut self, s: &str) -> Result<(), Error>

Writes a string slice into this writer, returning whether the write -succeeded. Read more
source§

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a [char] into this writer, returning whether the write succeeded. Read more
1.0.0§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the [write!] macro with implementors of this trait. Read more
source§

impl<const N: usize> Eq for String<N>

Auto Trait Implementations§

§

impl<const N: usize> RefUnwindSafe for String<N>

§

impl<const N: usize> Send for String<N>

§

impl<const N: usize> Sync for String<N>

§

impl<const N: usize> Unpin for String<N>

§

impl<const N: usize> UnwindSafe for String<N>

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/struct.Vec.html b/docs/doc/arduboy_rust/prelude/struct.Vec.html deleted file mode 100644 index a6c4439..0000000 --- a/docs/doc/arduboy_rust/prelude/struct.Vec.html +++ /dev/null @@ -1,2527 +0,0 @@ -Vec in arduboy_rust::prelude - Rust

Struct arduboy_rust::prelude::Vec

source ·
pub struct Vec<T, const N: usize> { /* private fields */ }
Expand description

A fixed capacity Vec

-

Examples

-
use heapless::Vec;
-
-
-// A vector with a fixed capacity of 8 elements allocated on the stack
-let mut vec = Vec::<_, 8>::new();
-vec.push(1);
-vec.push(2);
-
-assert_eq!(vec.len(), 2);
-assert_eq!(vec[0], 1);
-
-assert_eq!(vec.pop(), Some(2));
-assert_eq!(vec.len(), 1);
-
-vec[0] = 7;
-assert_eq!(vec[0], 7);
-
-vec.extend([1, 2, 3].iter().cloned());
-
-for x in &vec {
-    println!("{}", x);
-}
-assert_eq!(*vec, [7, 1, 2, 3]);
-

Implementations§

source§

impl<T, const N: usize> Vec<T, N>

source

pub const fn new() -> Vec<T, N>

Constructs a new, empty vector with a fixed capacity of N

-
Examples
-
use heapless::Vec;
-
-// allocate the vector on the stack
-let mut x: Vec<u8, 16> = Vec::new();
-
-// allocate the vector in a static variable
-static mut X: Vec<u8, 16> = Vec::new();
-

Vec const constructor; wrap the returned value in Vec

-
source

pub fn from_slice(other: &[T]) -> Result<Vec<T, N>, ()>where - T: Clone,

Constructs a new vector with a fixed capacity of N and fills it -with the provided slice.

-

This is equivalent to the following code:

- -
use heapless::Vec;
-
-let mut v: Vec<u8, 16> = Vec::new();
-v.extend_from_slice(&[1, 2, 3]).unwrap();
-
source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the vector’s buffer.

-
source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns a raw pointer to the vector’s buffer, which may be mutated through.

-
source

pub fn as_slice(&self) -> &[T]

Extracts a slice containing the entire vector.

-

Equivalent to &s[..].

-
Examples
-
use heapless::Vec;
-let buffer: Vec<u8, 5> = Vec::from_slice(&[1, 2, 3, 5, 8]).unwrap();
-assert_eq!(buffer.as_slice(), &[1, 2, 3, 5, 8]);
-
source

pub fn into_array<const M: usize>(self) -> Result<[T; M], Vec<T, N>>

Returns the contents of the vector as an array of length M if the length -of the vector is exactly M, otherwise returns Err(self).

-
Examples
-
use heapless::Vec;
-let buffer: Vec<u8, 42> = Vec::from_slice(&[1, 2, 3, 5, 8]).unwrap();
-let array: [u8; 5] = buffer.into_array().unwrap();
-assert_eq!(array, [1, 2, 3, 5, 8]);
-
source

pub const fn capacity(&self) -> usize

Returns the maximum number of elements the vector can hold.

-
source

pub fn clear(&mut self)

Clears the vector, removing all values.

-
source

pub fn extend<I>(&mut self, iter: I)where - I: IntoIterator<Item = T>,

Extends the vec from an iterator.

-
Panic
-

Panics if the vec cannot hold all elements of the iterator.

-
source

pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), ()>where - T: Clone,

Clones and appends all elements in a slice to the Vec.

-

Iterates over the slice other, clones each element, and then appends -it to this Vec. The other vector is traversed in-order.

-
Examples
-
use heapless::Vec;
-
-let mut vec = Vec::<u8, 8>::new();
-vec.push(1).unwrap();
-vec.extend_from_slice(&[2, 3, 4]).unwrap();
-assert_eq!(*vec, [1, 2, 3, 4]);
-
source

pub fn pop(&mut self) -> Option<T>

Removes the last element from a vector and returns it, or None if it’s empty

-
source

pub fn push(&mut self, item: T) -> Result<(), T>

Appends an item to the back of the collection

-

Returns back the item if the vector is full

-
source

pub unsafe fn pop_unchecked(&mut self) -> T

Removes the last element from a vector and returns it

-
Safety
-

This assumes the vec to have at least one element.

-
source

pub unsafe fn push_unchecked(&mut self, item: T)

Appends an item to the back of the collection

-
Safety
-

This assumes the vec is not full.

-
source

pub fn truncate(&mut self, len: usize)

Shortens the vector, keeping the first len elements and dropping the rest.

-
source

pub fn resize(&mut self, new_len: usize, value: T) -> Result<(), ()>where - T: Clone,

Resizes the Vec in-place so that len is equal to new_len.

-

If new_len is greater than len, the Vec is extended by the -difference, with each additional slot filled with value. If -new_len is less than len, the Vec is simply truncated.

-

See also resize_default.

-
source

pub fn resize_default(&mut self, new_len: usize) -> Result<(), ()>where - T: Clone + Default,

Resizes the Vec in-place so that len is equal to new_len.

-

If new_len is greater than len, the Vec is extended by the -difference, with each additional slot filled with Default::default(). -If new_len is less than len, the Vec is simply truncated.

-

See also resize.

-
source

pub unsafe fn set_len(&mut self, new_len: usize)

Forces the length of the vector to new_len.

-

This is a low-level operation that maintains none of the normal -invariants of the type. Normally changing the length of a vector -is done using one of the safe operations instead, such as -truncate, resize, extend, or clear.

-
Safety
-
    -
  • new_len must be less than or equal to capacity().
  • -
  • The elements at old_len..new_len must be initialized.
  • -
-
Examples
-

This method can be useful for situations in which the vector -is serving as a buffer for other code, particularly over FFI:

- -
use heapless::Vec;
-
-pub fn get_dictionary(&self) -> Option<Vec<u8, 32768>> {
-    // Per the FFI method's docs, "32768 bytes is always enough".
-    let mut dict = Vec::new();
-    let mut dict_length = 0;
-    // SAFETY: When `deflateGetDictionary` returns `Z_OK`, it holds that:
-    // 1. `dict_length` elements were initialized.
-    // 2. `dict_length` <= the capacity (32_768)
-    // which makes `set_len` safe to call.
-    unsafe {
-        // Make the FFI call...
-        let r = deflateGetDictionary(self.strm, dict.as_mut_ptr(), &mut dict_length);
-        if r == Z_OK {
-            // ...and update the length to what was initialized.
-            dict.set_len(dict_length);
-            Some(dict)
-        } else {
-            None
-        }
-    }
-}
-

While the following example is sound, there is a memory leak since -the inner vectors were not freed prior to the set_len call:

- -
use core::iter::FromIterator;
-use heapless::Vec;
-
-let mut vec = Vec::<Vec<u8, 3>, 3>::from_iter(
-    [
-        Vec::from_iter([1, 0, 0].iter().cloned()),
-        Vec::from_iter([0, 1, 0].iter().cloned()),
-        Vec::from_iter([0, 0, 1].iter().cloned()),
-    ]
-    .iter()
-    .cloned()
-);
-// SAFETY:
-// 1. `old_len..0` is empty so no elements need to be initialized.
-// 2. `0 <= capacity` always holds whatever `capacity` is.
-unsafe {
-    vec.set_len(0);
-}
-

Normally, here, one would use clear instead to correctly drop -the contents and thus not leak memory.

-
source

pub fn swap_remove(&mut self, index: usize) -> T

Removes an element from the vector and returns it.

-

The removed element is replaced by the last element of the vector.

-

This does not preserve ordering, but is O(1).

-
Panics
-

Panics if index is out of bounds.

-
Examples
-
use heapless::Vec;
-
-let mut v: Vec<_, 8> = Vec::new();
-v.push("foo").unwrap();
-v.push("bar").unwrap();
-v.push("baz").unwrap();
-v.push("qux").unwrap();
-
-assert_eq!(v.swap_remove(1), "bar");
-assert_eq!(&*v, ["foo", "qux", "baz"]);
-
-assert_eq!(v.swap_remove(0), "foo");
-assert_eq!(&*v, ["baz", "qux"]);
-
source

pub unsafe fn swap_remove_unchecked(&mut self, index: usize) -> T

Removes an element from the vector and returns it.

-

The removed element is replaced by the last element of the vector.

-

This does not preserve ordering, but is O(1).

-
Safety
-

Assumes index within bounds.

-
Examples
-
use heapless::Vec;
-
-let mut v: Vec<_, 8> = Vec::new();
-v.push("foo").unwrap();
-v.push("bar").unwrap();
-v.push("baz").unwrap();
-v.push("qux").unwrap();
-
-assert_eq!(unsafe { v.swap_remove_unchecked(1) }, "bar");
-assert_eq!(&*v, ["foo", "qux", "baz"]);
-
-assert_eq!(unsafe { v.swap_remove_unchecked(0) }, "foo");
-assert_eq!(&*v, ["baz", "qux"]);
-
source

pub fn is_full(&self) -> bool

Returns true if the vec is full

-
source

pub fn is_empty(&self) -> bool

Returns true if the vec is empty

-
source

pub fn starts_with(&self, needle: &[T]) -> boolwhere - T: PartialEq<T>,

Returns true if needle is a prefix of the Vec.

-

Always returns true if needle is an empty slice.

-
Examples
-
use heapless::Vec;
-
-let v: Vec<_, 8> = Vec::from_slice(b"abc").unwrap();
-assert_eq!(v.starts_with(b""), true);
-assert_eq!(v.starts_with(b"ab"), true);
-assert_eq!(v.starts_with(b"bc"), false);
-
source

pub fn ends_with(&self, needle: &[T]) -> boolwhere - T: PartialEq<T>,

Returns true if needle is a suffix of the Vec.

-

Always returns true if needle is an empty slice.

-
Examples
-
use heapless::Vec;
-
-let v: Vec<_, 8> = Vec::from_slice(b"abc").unwrap();
-assert_eq!(v.ends_with(b""), true);
-assert_eq!(v.ends_with(b"ab"), false);
-assert_eq!(v.ends_with(b"bc"), true);
-
source

pub fn insert(&mut self, index: usize, element: T) -> Result<(), T>

Inserts an element at position index within the vector, shifting all -elements after it to the right.

-

Returns back the element if the vector is full.

-
Panics
-

Panics if index > len.

-
Examples
-
use heapless::Vec;
-
-let mut vec: Vec<_, 8> = Vec::from_slice(&[1, 2, 3]).unwrap();
-vec.insert(1, 4);
-assert_eq!(vec, [1, 4, 2, 3]);
-vec.insert(4, 5);
-assert_eq!(vec, [1, 4, 2, 3, 5]);
-
source

pub fn remove(&mut self, index: usize) -> T

Removes and returns the element at position index within the vector, -shifting all elements after it to the left.

-

Note: Because this shifts over the remaining elements, it has a -worst-case performance of O(n). If you don’t need the order of -elements to be preserved, use swap_remove instead. If you’d like to -remove elements from the beginning of the Vec, consider using -Deque::pop_front instead.

-
Panics
-

Panics if index is out of bounds.

-
Examples
-
use heapless::Vec;
-
-let mut v: Vec<_, 8> = Vec::from_slice(&[1, 2, 3]).unwrap();
-assert_eq!(v.remove(1), 2);
-assert_eq!(v, [1, 3]);
-
source

pub fn retain<F>(&mut self, f: F)where - F: FnMut(&T) -> bool,

Retains only the elements specified by the predicate.

-

In other words, remove all elements e for which f(&e) returns false. -This method operates in place, visiting each element exactly once in the -original order, and preserves the order of the retained elements.

-
Examples
-
use heapless::Vec;
-
-let mut vec: Vec<_, 8> = Vec::from_slice(&[1, 2, 3, 4]).unwrap();
-vec.retain(|&x| x % 2 == 0);
-assert_eq!(vec, [2, 4]);
-

Because the elements are visited exactly once in the original order, -external state may be used to decide which elements to keep.

- -
use heapless::Vec;
-
-let mut vec: Vec<_, 8> = Vec::from_slice(&[1, 2, 3, 4, 5]).unwrap();
-let keep = [false, true, true, false, true];
-let mut iter = keep.iter();
-vec.retain(|_| *iter.next().unwrap());
-assert_eq!(vec, [2, 3, 5]);
-
source

pub fn retain_mut<F>(&mut self, f: F)where - F: FnMut(&mut T) -> bool,

Retains only the elements specified by the predicate, passing a mutable reference to it.

-

In other words, remove all elements e such that f(&mut e) returns false. -This method operates in place, visiting each element exactly once in the -original order, and preserves the order of the retained elements.

-
Examples
-
use heapless::Vec;
-
-let mut vec: Vec<_, 8> = Vec::from_slice(&[1, 2, 3, 4]).unwrap();
-vec.retain_mut(|x| if *x <= 3 {
-    *x += 1;
-    true
-} else {
-    false
-});
-assert_eq!(vec, [2, 3, 4]);
-

Methods from Deref<Target = [T]>§

pub fn flatten(&self) -> &[T]

🔬This is a nightly-only experimental API. (slice_flatten)

Takes a &[[T; N]], and flattens it to a &[T].

-
Panics
-

This panics if the length of the resulting slice would overflow a usize.

-

This is only possible when flattening a slice of arrays of zero-sized -types, and thus tends to be irrelevant in practice. If -size_of::<T>() > 0, this will never panic.

-
Examples
-
#![feature(slice_flatten)]
-
-assert_eq!([[1, 2, 3], [4, 5, 6]].flatten(), &[1, 2, 3, 4, 5, 6]);
-
-assert_eq!(
-    [[1, 2, 3], [4, 5, 6]].flatten(),
-    [[1, 2], [3, 4], [5, 6]].flatten(),
-);
-
-let slice_of_empty_arrays: &[[i32; 0]] = &[[], [], [], [], []];
-assert!(slice_of_empty_arrays.flatten().is_empty());
-
-let empty_slice_of_arrays: &[[u32; 10]] = &[];
-assert!(empty_slice_of_arrays.flatten().is_empty());
-

pub fn flatten_mut(&mut self) -> &mut [T]

🔬This is a nightly-only experimental API. (slice_flatten)

Takes a &mut [[T; N]], and flattens it to a &mut [T].

-
Panics
-

This panics if the length of the resulting slice would overflow a usize.

-

This is only possible when flattening a slice of arrays of zero-sized -types, and thus tends to be irrelevant in practice. If -size_of::<T>() > 0, this will never panic.

-
Examples
-
#![feature(slice_flatten)]
-
-fn add_5_to_all(slice: &mut [i32]) {
-    for i in slice {
-        *i += 5;
-    }
-}
-
-let mut array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
-add_5_to_all(array.flatten_mut());
-assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
-
1.23.0

pub fn is_ascii(&self) -> bool

Checks if all bytes in this slice are within the ASCII range.

-

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this slice is_ascii, returns it as a slice of -ASCII characters, otherwise returns None.

-

pub unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar]

🔬This is a nightly-only experimental API. (ascii_char)

Converts this slice of bytes into a slice of ASCII characters, -without checking whether they’re valid.

-
Safety
-

Every byte in the slice must be in 0..=127, or else this is UB.

-
1.23.0

pub fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool

Checks that two slices are an ASCII case-insensitive match.

-

Same as to_ascii_lowercase(a) == to_ascii_lowercase(b), -but without allocating and copying temporaries.

-
1.23.0

pub fn make_ascii_uppercase(&mut self)

Converts this slice to its ASCII upper case equivalent in-place.

-

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, -but non-ASCII letters are unchanged.

-

To return a new uppercased value without modifying the existing one, use -to_ascii_uppercase.

-
1.23.0

pub fn make_ascii_lowercase(&mut self)

Converts this slice to its ASCII lower case equivalent in-place.

-

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, -but non-ASCII letters are unchanged.

-

To return a new lowercased value without modifying the existing one, use -to_ascii_lowercase.

-
1.60.0

pub fn escape_ascii(&self) -> EscapeAscii<'_>

Returns an iterator that produces an escaped version of this slice, -treating it as an ASCII string.

-
Examples
-

-let s = b"0\t\r\n'\"\\\x9d";
-let escaped = s.escape_ascii().to_string();
-assert_eq!(escaped, "0\\t\\r\\n\\'\\\"\\\\\\x9d");
-

pub fn trim_ascii_start(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with leading ASCII whitespace bytes removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b" \t hello world\n".trim_ascii_start(), b"hello world\n");
-assert_eq!(b"  ".trim_ascii_start(), b"");
-assert_eq!(b"".trim_ascii_start(), b"");
-

pub fn trim_ascii_end(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with trailing ASCII whitespace bytes removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b"\r hello world\n ".trim_ascii_end(), b"\r hello world");
-assert_eq!(b"  ".trim_ascii_end(), b"");
-assert_eq!(b"".trim_ascii_end(), b"");
-

pub fn trim_ascii(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with leading and trailing ASCII whitespace bytes -removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b"\r hello world\n ".trim_ascii(), b"hello world");
-assert_eq!(b"  ".trim_ascii(), b"");
-assert_eq!(b"".trim_ascii(), b"");
-

pub fn as_str(&self) -> &str

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a UTF-8 str.

-

pub fn as_bytes(&self) -> &[u8]

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a slice of u8 bytes.

-
1.0.0

pub fn len(&self) -> usize

Returns the number of elements in the slice.

-
Examples
-
let a = [1, 2, 3];
-assert_eq!(a.len(), 3);
-
1.0.0

pub fn is_empty(&self) -> bool

Returns true if the slice has a length of 0.

-
Examples
-
let a = [1, 2, 3];
-assert!(!a.is_empty());
-
1.0.0

pub fn first(&self) -> Option<&T>

Returns the first element of the slice, or None if it is empty.

-
Examples
-
let v = [10, 40, 30];
-assert_eq!(Some(&10), v.first());
-
-let w: &[i32] = &[];
-assert_eq!(None, w.first());
-
1.0.0

pub fn first_mut(&mut self) -> Option<&mut T>

Returns a mutable pointer to the first element of the slice, or None if it is empty.

-
Examples
-
let x = &mut [0, 1, 2];
-
-if let Some(first) = x.first_mut() {
-    *first = 5;
-}
-assert_eq!(x, &[5, 1, 2]);
-
1.5.0

pub fn split_first(&self) -> Option<(&T, &[T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
let x = &[0, 1, 2];
-
-if let Some((first, elements)) = x.split_first() {
-    assert_eq!(first, &0);
-    assert_eq!(elements, &[1, 2]);
-}
-
1.5.0

pub fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
let x = &mut [0, 1, 2];
-
-if let Some((first, elements)) = x.split_first_mut() {
-    *first = 3;
-    elements[0] = 4;
-    elements[1] = 5;
-}
-assert_eq!(x, &[3, 4, 5]);
-
1.5.0

pub fn split_last(&self) -> Option<(&T, &[T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
let x = &[0, 1, 2];
-
-if let Some((last, elements)) = x.split_last() {
-    assert_eq!(last, &2);
-    assert_eq!(elements, &[0, 1]);
-}
-
1.5.0

pub fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
let x = &mut [0, 1, 2];
-
-if let Some((last, elements)) = x.split_last_mut() {
-    *last = 3;
-    elements[0] = 4;
-    elements[1] = 5;
-}
-assert_eq!(x, &[4, 5, 3]);
-
1.0.0

pub fn last(&self) -> Option<&T>

Returns the last element of the slice, or None if it is empty.

-
Examples
-
let v = [10, 40, 30];
-assert_eq!(Some(&30), v.last());
-
-let w: &[i32] = &[];
-assert_eq!(None, w.last());
-
1.0.0

pub fn last_mut(&mut self) -> Option<&mut T>

Returns a mutable pointer to the last item in the slice.

-
Examples
-
let x = &mut [0, 1, 2];
-
-if let Some(last) = x.last_mut() {
-    *last = 10;
-}
-assert_eq!(x, &[0, 1, 10]);
-

pub fn first_chunk<const N: usize>(&self) -> Option<&[T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the first N elements of the slice, or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let u = [10, 40, 30];
-assert_eq!(Some(&[10, 40]), u.first_chunk::<2>());
-
-let v: &[i32] = &[10];
-assert_eq!(None, v.first_chunk::<2>());
-
-let w: &[i32] = &[];
-assert_eq!(Some(&[]), w.first_chunk::<0>());
-

pub fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns a mutable reference to the first N elements of the slice, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &mut [0, 1, 2];
-
-if let Some(first) = x.first_chunk_mut::<2>() {
-    first[0] = 5;
-    first[1] = 4;
-}
-assert_eq!(x, &[5, 4, 2]);
-

pub fn split_first_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the first N elements of the slice and the remainder, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &[0, 1, 2];
-
-if let Some((first, elements)) = x.split_first_chunk::<2>() {
-    assert_eq!(first, &[0, 1]);
-    assert_eq!(elements, &[2]);
-}
-

pub fn split_first_chunk_mut<const N: usize>( - &mut self -) -> Option<(&mut [T; N], &mut [T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns a mutable reference to the first N elements of the slice and the remainder, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &mut [0, 1, 2];
-
-if let Some((first, elements)) = x.split_first_chunk_mut::<2>() {
-    first[0] = 3;
-    first[1] = 4;
-    elements[0] = 5;
-}
-assert_eq!(x, &[3, 4, 5]);
-

pub fn split_last_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the last N elements of the slice and the remainder, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &[0, 1, 2];
-
-if let Some((last, elements)) = x.split_last_chunk::<2>() {
-    assert_eq!(last, &[1, 2]);
-    assert_eq!(elements, &[0]);
-}
-

pub fn split_last_chunk_mut<const N: usize>( - &mut self -) -> Option<(&mut [T; N], &mut [T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the last and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &mut [0, 1, 2];
-
-if let Some((last, elements)) = x.split_last_chunk_mut::<2>() {
-    last[0] = 3;
-    last[1] = 4;
-    elements[0] = 5;
-}
-assert_eq!(x, &[5, 3, 4]);
-

pub fn last_chunk<const N: usize>(&self) -> Option<&[T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the last element of the slice, or None if it is empty.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let u = [10, 40, 30];
-assert_eq!(Some(&[40, 30]), u.last_chunk::<2>());
-
-let v: &[i32] = &[10];
-assert_eq!(None, v.last_chunk::<2>());
-
-let w: &[i32] = &[];
-assert_eq!(Some(&[]), w.last_chunk::<0>());
-

pub fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns a mutable pointer to the last item in the slice.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &mut [0, 1, 2];
-
-if let Some(last) = x.last_chunk_mut::<2>() {
-    last[0] = 10;
-    last[1] = 20;
-}
-assert_eq!(x, &[0, 10, 20]);
-
1.0.0

pub fn get<I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output>where - I: SliceIndex<[T]>,

Returns a reference to an element or subslice depending on the type of -index.

-
    -
  • If given a position, returns a reference to the element at that -position or None if out of bounds.
  • -
  • If given a range, returns the subslice corresponding to that range, -or None if out of bounds.
  • -
-
Examples
-
let v = [10, 40, 30];
-assert_eq!(Some(&40), v.get(1));
-assert_eq!(Some(&[10, 40][..]), v.get(0..2));
-assert_eq!(None, v.get(3));
-assert_eq!(None, v.get(0..4));
-
1.0.0

pub fn get_mut<I>( - &mut self, - index: I -) -> Option<&mut <I as SliceIndex<[T]>>::Output>where - I: SliceIndex<[T]>,

Returns a mutable reference to an element or subslice depending on the -type of index (see get) or None if the index is out of bounds.

-
Examples
-
let x = &mut [0, 1, 2];
-
-if let Some(elem) = x.get_mut(1) {
-    *elem = 42;
-}
-assert_eq!(x, &[0, 42, 2]);
-
1.0.0

pub unsafe fn get_unchecked<I>( - &self, - index: I -) -> &<I as SliceIndex<[T]>>::Outputwhere - I: SliceIndex<[T]>,

Returns a reference to an element or subslice, without doing bounds -checking.

-

For a safe alternative see get.

-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior -even if the resulting reference is not used.

-
Examples
-
let x = &[1, 2, 4];
-
-unsafe {
-    assert_eq!(x.get_unchecked(1), &2);
-}
-
1.0.0

pub unsafe fn get_unchecked_mut<I>( - &mut self, - index: I -) -> &mut <I as SliceIndex<[T]>>::Outputwhere - I: SliceIndex<[T]>,

Returns a mutable reference to an element or subslice, without doing -bounds checking.

-

For a safe alternative see get_mut.

-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior -even if the resulting reference is not used.

-
Examples
-
let x = &mut [1, 2, 4];
-
-unsafe {
-    let elem = x.get_unchecked_mut(1);
-    *elem = 13;
-}
-assert_eq!(x, &[1, 13, 4]);
-
1.0.0

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the slice’s buffer.

-

The caller must ensure that the slice outlives the pointer this -function returns, or else it will end up pointing to garbage.

-

The caller must also ensure that the memory the pointer (non-transitively) points to -is never written to (except inside an UnsafeCell) using this pointer or any pointer -derived from it. If you need to mutate the contents of the slice, use as_mut_ptr.

-

Modifying the container referenced by this slice may cause its buffer -to be reallocated, which would also make any pointers to it invalid.

-
Examples
-
let x = &[1, 2, 4];
-let x_ptr = x.as_ptr();
-
-unsafe {
-    for i in 0..x.len() {
-        assert_eq!(x.get_unchecked(i), &*x_ptr.add(i));
-    }
-}
-
1.0.0

pub fn as_mut_ptr(&mut self) -> *mut T

Returns an unsafe mutable pointer to the slice’s buffer.

-

The caller must ensure that the slice outlives the pointer this -function returns, or else it will end up pointing to garbage.

-

Modifying the container referenced by this slice may cause its buffer -to be reallocated, which would also make any pointers to it invalid.

-
Examples
-
let x = &mut [1, 2, 4];
-let x_ptr = x.as_mut_ptr();
-
-unsafe {
-    for i in 0..x.len() {
-        *x_ptr.add(i) += 2;
-    }
-}
-assert_eq!(x, &[3, 4, 6]);
-
1.48.0

pub fn as_ptr_range(&self) -> Range<*const T>

Returns the two raw pointers spanning the slice.

-

The returned range is half-open, which means that the end pointer -points one past the last element of the slice. This way, an empty -slice is represented by two equal pointers, and the difference between -the two pointers represents the size of the slice.

-

See as_ptr for warnings on using these pointers. The end pointer -requires extra caution, as it does not point to a valid element in the -slice.

-

This function is useful for interacting with foreign interfaces which -use two pointers to refer to a range of elements in memory, as is -common in C++.

-

It can also be useful to check if a pointer to an element refers to an -element of this slice:

- -
let a = [1, 2, 3];
-let x = &a[1] as *const _;
-let y = &5 as *const _;
-
-assert!(a.as_ptr_range().contains(&x));
-assert!(!a.as_ptr_range().contains(&y));
-
1.48.0

pub fn as_mut_ptr_range(&mut self) -> Range<*mut T>

Returns the two unsafe mutable pointers spanning the slice.

-

The returned range is half-open, which means that the end pointer -points one past the last element of the slice. This way, an empty -slice is represented by two equal pointers, and the difference between -the two pointers represents the size of the slice.

-

See as_mut_ptr for warnings on using these pointers. The end -pointer requires extra caution, as it does not point to a valid element -in the slice.

-

This function is useful for interacting with foreign interfaces which -use two pointers to refer to a range of elements in memory, as is -common in C++.

-
1.0.0

pub fn swap(&mut self, a: usize, b: usize)

Swaps two elements in the slice.

-

If a equals to b, it’s guaranteed that elements won’t change value.

-
Arguments
-
    -
  • a - The index of the first element
  • -
  • b - The index of the second element
  • -
-
Panics
-

Panics if a or b are out of bounds.

-
Examples
-
let mut v = ["a", "b", "c", "d", "e"];
-v.swap(2, 4);
-assert!(v == ["a", "b", "e", "d", "c"]);
-

pub unsafe fn swap_unchecked(&mut self, a: usize, b: usize)

🔬This is a nightly-only experimental API. (slice_swap_unchecked)

Swaps two elements in the slice, without doing bounds checking.

-

For a safe alternative see swap.

-
Arguments
-
    -
  • a - The index of the first element
  • -
  • b - The index of the second element
  • -
-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior. -The caller has to ensure that a < self.len() and b < self.len().

-
Examples
-
#![feature(slice_swap_unchecked)]
-
-let mut v = ["a", "b", "c", "d"];
-// SAFETY: we know that 1 and 3 are both indices of the slice
-unsafe { v.swap_unchecked(1, 3) };
-assert!(v == ["a", "d", "c", "b"]);
-
1.0.0

pub fn reverse(&mut self)

Reverses the order of elements in the slice, in place.

-
Examples
-
let mut v = [1, 2, 3];
-v.reverse();
-assert!(v == [3, 2, 1]);
-
1.0.0

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the slice.

-

The iterator yields all items from start to end.

-
Examples
-
let x = &[1, 2, 4];
-let mut iterator = x.iter();
-
-assert_eq!(iterator.next(), Some(&1));
-assert_eq!(iterator.next(), Some(&2));
-assert_eq!(iterator.next(), Some(&4));
-assert_eq!(iterator.next(), None);
-
1.0.0

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns an iterator that allows modifying each value.

-

The iterator yields all items from start to end.

-
Examples
-
let x = &mut [1, 2, 4];
-for elem in x.iter_mut() {
-    *elem += 2;
-}
-assert_eq!(x, &[3, 4, 6]);
-
1.0.0

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length -size. The windows overlap. If the slice is shorter than -size, the iterator returns no values.

-
Panics
-

Panics if size is 0.

-
Examples
-
let slice = ['r', 'u', 's', 't'];
-let mut iter = slice.windows(2);
-assert_eq!(iter.next().unwrap(), &['r', 'u']);
-assert_eq!(iter.next().unwrap(), &['u', 's']);
-assert_eq!(iter.next().unwrap(), &['s', 't']);
-assert!(iter.next().is_none());
-

If the slice is shorter than size:

- -
let slice = ['f', 'o', 'o'];
-let mut iter = slice.windows(4);
-assert!(iter.next().is_none());
-

There’s no windows_mut, as that existing would let safe code violate the -“only one &mut at a time to the same thing” rule. However, you can sometimes -use Cell::as_slice_of_cells in -conjunction with windows to accomplish something similar:

- -
use std::cell::Cell;
-
-let mut array = ['R', 'u', 's', 't', ' ', '2', '0', '1', '5'];
-let slice = &mut array[..];
-let slice_of_cells: &[Cell<char>] = Cell::from_mut(slice).as_slice_of_cells();
-for w in slice_of_cells.windows(3) {
-    Cell::swap(&w[0], &w[2]);
-}
-assert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
-
1.0.0

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last chunk will not have length chunk_size.

-

See chunks_exact for a variant of this iterator that returns chunks of always exactly -chunk_size elements, and rchunks for the same iterator but starting at the end of the -slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.chunks(2);
-assert_eq!(iter.next().unwrap(), &['l', 'o']);
-assert_eq!(iter.next().unwrap(), &['r', 'e']);
-assert_eq!(iter.next().unwrap(), &['m']);
-assert!(iter.next().is_none());
-
1.0.0

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the -length of the slice, then the last chunk will not have length chunk_size.

-

See chunks_exact_mut for a variant of this iterator that returns chunks of always -exactly chunk_size elements, and rchunks_mut for the same iterator but starting at -the end of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-for chunk in v.chunks_mut(2) {
-    for elem in chunk.iter_mut() {
-        *elem += count;
-    }
-    count += 1;
-}
-assert_eq!(v, &[1, 1, 2, 2, 3]);
-
1.31.0

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved -from the remainder function of the iterator.

-

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the -resulting code better than in the case of chunks.

-

See chunks for a variant of this iterator that also returns the remainder as a smaller -chunk, and rchunks_exact for the same iterator but starting at the end of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.chunks_exact(2);
-assert_eq!(iter.next().unwrap(), &['l', 'o']);
-assert_eq!(iter.next().unwrap(), &['r', 'e']);
-assert!(iter.next().is_none());
-assert_eq!(iter.remainder(), &['m']);
-
1.31.0

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the -length of the slice, then the last up to chunk_size-1 elements will be omitted and can be -retrieved from the into_remainder function of the iterator.

-

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the -resulting code better than in the case of chunks_mut.

-

See chunks_mut for a variant of this iterator that also returns the remainder as a -smaller chunk, and rchunks_exact_mut for the same iterator but starting at the end of -the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-for chunk in v.chunks_exact_mut(2) {
-    for elem in chunk.iter_mut() {
-        *elem += count;
-    }
-    count += 1;
-}
-assert_eq!(v, &[1, 1, 2, 2, 0]);
-

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -assuming that there’s no remainder.

-
Safety
-

This may only be called when

-
    -
  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • -
  • N != 0.
  • -
-
Examples
-
#![feature(slice_as_chunks)]
-let slice: &[char] = &['l', 'o', 'r', 'e', 'm', '!'];
-let chunks: &[[char; 1]] =
-    // SAFETY: 1-element chunks never have remainder
-    unsafe { slice.as_chunks_unchecked() };
-assert_eq!(chunks, &[['l'], ['o'], ['r'], ['e'], ['m'], ['!']]);
-let chunks: &[[char; 3]] =
-    // SAFETY: The slice length (6) is a multiple of 3
-    unsafe { slice.as_chunks_unchecked() };
-assert_eq!(chunks, &[['l', 'o', 'r'], ['e', 'm', '!']]);
-
-// These would be unsound:
-// let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5
-// let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed
-

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -starting at the beginning of the slice, -and a remainder slice with length strictly less than N.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(slice_as_chunks)]
-let slice = ['l', 'o', 'r', 'e', 'm'];
-let (chunks, remainder) = slice.as_chunks();
-assert_eq!(chunks, &[['l', 'o'], ['r', 'e']]);
-assert_eq!(remainder, &['m']);
-

If you expect the slice to be an exact multiple, you can combine -let-else with an empty slice pattern:

- -
#![feature(slice_as_chunks)]
-let slice = ['R', 'u', 's', 't'];
-let (chunks, []) = slice.as_chunks::<2>() else {
-    panic!("slice didn't have even length")
-};
-assert_eq!(chunks, &[['R', 'u'], ['s', 't']]);
-

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -starting at the end of the slice, -and a remainder slice with length strictly less than N.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(slice_as_chunks)]
-let slice = ['l', 'o', 'r', 'e', 'm'];
-let (remainder, chunks) = slice.as_rchunks();
-assert_eq!(remainder, &['l']);
-assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]);
-

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are array references and do not overlap. If N does not divide the -length of the slice, then the last up to N-1 elements will be omitted and can be -retrieved from the remainder function of the iterator.

-

This method is the const generic equivalent of chunks_exact.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(array_chunks)]
-let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.array_chunks();
-assert_eq!(iter.next().unwrap(), &['l', 'o']);
-assert_eq!(iter.next().unwrap(), &['r', 'e']);
-assert!(iter.next().is_none());
-assert_eq!(iter.remainder(), &['m']);
-

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( - &mut self -) -> &mut [[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -assuming that there’s no remainder.

-
Safety
-

This may only be called when

-
    -
  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • -
  • N != 0.
  • -
-
Examples
-
#![feature(slice_as_chunks)]
-let slice: &mut [char] = &mut ['l', 'o', 'r', 'e', 'm', '!'];
-let chunks: &mut [[char; 1]] =
-    // SAFETY: 1-element chunks never have remainder
-    unsafe { slice.as_chunks_unchecked_mut() };
-chunks[0] = ['L'];
-assert_eq!(chunks, &[['L'], ['o'], ['r'], ['e'], ['m'], ['!']]);
-let chunks: &mut [[char; 3]] =
-    // SAFETY: The slice length (6) is a multiple of 3
-    unsafe { slice.as_chunks_unchecked_mut() };
-chunks[1] = ['a', 'x', '?'];
-assert_eq!(slice, &['L', 'o', 'r', 'a', 'x', '?']);
-
-// These would be unsound:
-// let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut() // The slice length is not a multiple of 5
-// let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed
-

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -starting at the beginning of the slice, -and a remainder slice with length strictly less than N.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(slice_as_chunks)]
-let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-let (chunks, remainder) = v.as_chunks_mut();
-remainder[0] = 9;
-for chunk in chunks {
-    *chunk = [count; 2];
-    count += 1;
-}
-assert_eq!(v, &[1, 1, 2, 2, 9]);
-

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -starting at the end of the slice, -and a remainder slice with length strictly less than N.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(slice_as_chunks)]
-let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-let (remainder, chunks) = v.as_rchunks_mut();
-remainder[0] = 9;
-for chunk in chunks {
-    *chunk = [count; 2];
-    count += 1;
-}
-assert_eq!(v, &[9, 1, 1, 2, 2]);
-

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are mutable array references and do not overlap. If N does not divide -the length of the slice, then the last up to N-1 elements will be omitted and -can be retrieved from the into_remainder function of the iterator.

-

This method is the const generic equivalent of chunks_exact_mut.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(array_chunks)]
-let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-for chunk in v.array_chunks_mut() {
-    *chunk = [count; 2];
-    count += 1;
-}
-assert_eq!(v, &[1, 1, 2, 2, 0]);
-

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, -starting at the beginning of the slice.

-

This is the const generic equivalent of windows.

-

If N is greater than the size of the slice, it will return no windows.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(array_windows)]
-let slice = [0, 1, 2, 3];
-let mut iter = slice.array_windows();
-assert_eq!(iter.next().unwrap(), &[0, 1]);
-assert_eq!(iter.next().unwrap(), &[1, 2]);
-assert_eq!(iter.next().unwrap(), &[2, 3]);
-assert!(iter.next().is_none());
-
1.31.0

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end -of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last chunk will not have length chunk_size.

-

See rchunks_exact for a variant of this iterator that returns chunks of always exactly -chunk_size elements, and chunks for the same iterator but starting at the beginning -of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.rchunks(2);
-assert_eq!(iter.next().unwrap(), &['e', 'm']);
-assert_eq!(iter.next().unwrap(), &['o', 'r']);
-assert_eq!(iter.next().unwrap(), &['l']);
-assert!(iter.next().is_none());
-
1.31.0

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end -of the slice.

-

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the -length of the slice, then the last chunk will not have length chunk_size.

-

See rchunks_exact_mut for a variant of this iterator that returns chunks of always -exactly chunk_size elements, and chunks_mut for the same iterator but starting at the -beginning of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-for chunk in v.rchunks_mut(2) {
-    for elem in chunk.iter_mut() {
-        *elem += count;
-    }
-    count += 1;
-}
-assert_eq!(v, &[3, 2, 2, 1, 1]);
-
1.31.0

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -end of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved -from the remainder function of the iterator.

-

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the -resulting code better than in the case of rchunks.

-

See rchunks for a variant of this iterator that also returns the remainder as a smaller -chunk, and chunks_exact for the same iterator but starting at the beginning of the -slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.rchunks_exact(2);
-assert_eq!(iter.next().unwrap(), &['e', 'm']);
-assert_eq!(iter.next().unwrap(), &['o', 'r']);
-assert!(iter.next().is_none());
-assert_eq!(iter.remainder(), &['l']);
-
1.31.0

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end -of the slice.

-

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the -length of the slice, then the last up to chunk_size-1 elements will be omitted and can be -retrieved from the into_remainder function of the iterator.

-

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the -resulting code better than in the case of chunks_mut.

-

See rchunks_mut for a variant of this iterator that also returns the remainder as a -smaller chunk, and chunks_exact_mut for the same iterator but starting at the beginning -of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-for chunk in v.rchunks_exact_mut(2) {
-    for elem in chunk.iter_mut() {
-        *elem += count;
-    }
-    count += 1;
-}
-assert_eq!(v, &[0, 2, 2, 1, 1]);
-

pub fn group_by<F>(&self, pred: F) -> GroupBy<'_, T, F>where - F: FnMut(&T, &T) -> bool,

🔬This is a nightly-only experimental API. (slice_group_by)

Returns an iterator over the slice producing non-overlapping runs -of elements using the predicate to separate them.

-

The predicate is called on two elements following themselves, -it means the predicate is called on slice[0] and slice[1] -then on slice[1] and slice[2] and so on.

-
Examples
-
#![feature(slice_group_by)]
-
-let slice = &[1, 1, 1, 3, 3, 2, 2, 2];
-
-let mut iter = slice.group_by(|a, b| a == b);
-
-assert_eq!(iter.next(), Some(&[1, 1, 1][..]));
-assert_eq!(iter.next(), Some(&[3, 3][..]));
-assert_eq!(iter.next(), Some(&[2, 2, 2][..]));
-assert_eq!(iter.next(), None);
-

This method can be used to extract the sorted subslices:

- -
#![feature(slice_group_by)]
-
-let slice = &[1, 1, 2, 3, 2, 3, 2, 3, 4];
-
-let mut iter = slice.group_by(|a, b| a <= b);
-
-assert_eq!(iter.next(), Some(&[1, 1, 2, 3][..]));
-assert_eq!(iter.next(), Some(&[2, 3][..]));
-assert_eq!(iter.next(), Some(&[2, 3, 4][..]));
-assert_eq!(iter.next(), None);
-

pub fn group_by_mut<F>(&mut self, pred: F) -> GroupByMut<'_, T, F>where - F: FnMut(&T, &T) -> bool,

🔬This is a nightly-only experimental API. (slice_group_by)

Returns an iterator over the slice producing non-overlapping mutable -runs of elements using the predicate to separate them.

-

The predicate is called on two elements following themselves, -it means the predicate is called on slice[0] and slice[1] -then on slice[1] and slice[2] and so on.

-
Examples
-
#![feature(slice_group_by)]
-
-let slice = &mut [1, 1, 1, 3, 3, 2, 2, 2];
-
-let mut iter = slice.group_by_mut(|a, b| a == b);
-
-assert_eq!(iter.next(), Some(&mut [1, 1, 1][..]));
-assert_eq!(iter.next(), Some(&mut [3, 3][..]));
-assert_eq!(iter.next(), Some(&mut [2, 2, 2][..]));
-assert_eq!(iter.next(), None);
-

This method can be used to extract the sorted subslices:

- -
#![feature(slice_group_by)]
-
-let slice = &mut [1, 1, 2, 3, 2, 3, 2, 3, 4];
-
-let mut iter = slice.group_by_mut(|a, b| a <= b);
-
-assert_eq!(iter.next(), Some(&mut [1, 1, 2, 3][..]));
-assert_eq!(iter.next(), Some(&mut [2, 3][..]));
-assert_eq!(iter.next(), Some(&mut [2, 3, 4][..]));
-assert_eq!(iter.next(), None);
-
1.0.0

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

-

The first will contain all indices from [0, mid) (excluding -the index mid itself) and the second will contain all -indices from [mid, len) (excluding the index len itself).

-
Panics
-

Panics if mid > len.

-
Examples
-
let v = [1, 2, 3, 4, 5, 6];
-
-{
-   let (left, right) = v.split_at(0);
-   assert_eq!(left, []);
-   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_at(2);
-    assert_eq!(left, [1, 2]);
-    assert_eq!(right, [3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_at(6);
-    assert_eq!(left, [1, 2, 3, 4, 5, 6]);
-    assert_eq!(right, []);
-}
-
1.0.0

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

-

The first will contain all indices from [0, mid) (excluding -the index mid itself) and the second will contain all -indices from [mid, len) (excluding the index len itself).

-
Panics
-

Panics if mid > len.

-
Examples
-
let mut v = [1, 0, 3, 0, 5, 6];
-let (left, right) = v.split_at_mut(2);
-assert_eq!(left, [1, 0]);
-assert_eq!(right, [3, 0, 5, 6]);
-left[1] = 2;
-right[1] = 4;
-assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

🔬This is a nightly-only experimental API. (slice_split_at_unchecked)

Divides one slice into two at an index, without doing bounds checking.

-

The first will contain all indices from [0, mid) (excluding -the index mid itself) and the second will contain all -indices from [mid, len) (excluding the index len itself).

-

For a safe alternative see split_at.

-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior -even if the resulting reference is not used. The caller has to ensure that -0 <= mid <= self.len().

-
Examples
-
#![feature(slice_split_at_unchecked)]
-
-let v = [1, 2, 3, 4, 5, 6];
-
-unsafe {
-   let (left, right) = v.split_at_unchecked(0);
-   assert_eq!(left, []);
-   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
-}
-
-unsafe {
-    let (left, right) = v.split_at_unchecked(2);
-    assert_eq!(left, [1, 2]);
-    assert_eq!(right, [3, 4, 5, 6]);
-}
-
-unsafe {
-    let (left, right) = v.split_at_unchecked(6);
-    assert_eq!(left, [1, 2, 3, 4, 5, 6]);
-    assert_eq!(right, []);
-}
-

pub unsafe fn split_at_mut_unchecked( - &mut self, - mid: usize -) -> (&mut [T], &mut [T])

🔬This is a nightly-only experimental API. (slice_split_at_unchecked)

Divides one mutable slice into two at an index, without doing bounds checking.

-

The first will contain all indices from [0, mid) (excluding -the index mid itself) and the second will contain all -indices from [mid, len) (excluding the index len itself).

-

For a safe alternative see split_at_mut.

-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior -even if the resulting reference is not used. The caller has to ensure that -0 <= mid <= self.len().

-
Examples
-
#![feature(slice_split_at_unchecked)]
-
-let mut v = [1, 0, 3, 0, 5, 6];
-// scoped to restrict the lifetime of the borrows
-unsafe {
-    let (left, right) = v.split_at_mut_unchecked(2);
-    assert_eq!(left, [1, 0]);
-    assert_eq!(right, [3, 0, 5, 6]);
-    left[1] = 2;
-    right[1] = 4;
-}
-assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-

pub fn split_array_ref<const N: usize>(&self) -> (&[T; N], &[T])

🔬This is a nightly-only experimental API. (split_array)

Divides one slice into an array and a remainder slice at an index.

-

The array will contain all indices from [0, N) (excluding -the index N itself) and the slice will contain all -indices from [N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let v = &[1, 2, 3, 4, 5, 6][..];
-
-{
-   let (left, right) = v.split_array_ref::<0>();
-   assert_eq!(left, &[]);
-   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_array_ref::<2>();
-    assert_eq!(left, &[1, 2]);
-    assert_eq!(right, [3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_array_ref::<6>();
-    assert_eq!(left, &[1, 2, 3, 4, 5, 6]);
-    assert_eq!(right, []);
-}
-

pub fn split_array_mut<const N: usize>(&mut self) -> (&mut [T; N], &mut [T])

🔬This is a nightly-only experimental API. (split_array)

Divides one mutable slice into an array and a remainder slice at an index.

-

The array will contain all indices from [0, N) (excluding -the index N itself) and the slice will contain all -indices from [N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let mut v = &mut [1, 0, 3, 0, 5, 6][..];
-let (left, right) = v.split_array_mut::<2>();
-assert_eq!(left, &mut [1, 0]);
-assert_eq!(right, [3, 0, 5, 6]);
-left[1] = 2;
-right[1] = 4;
-assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-

pub fn rsplit_array_ref<const N: usize>(&self) -> (&[T], &[T; N])

🔬This is a nightly-only experimental API. (split_array)

Divides one slice into an array and a remainder slice at an index from -the end.

-

The slice will contain all indices from [0, len - N) (excluding -the index len - N itself) and the array will contain all -indices from [len - N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let v = &[1, 2, 3, 4, 5, 6][..];
-
-{
-   let (left, right) = v.rsplit_array_ref::<0>();
-   assert_eq!(left, [1, 2, 3, 4, 5, 6]);
-   assert_eq!(right, &[]);
-}
-
-{
-    let (left, right) = v.rsplit_array_ref::<2>();
-    assert_eq!(left, [1, 2, 3, 4]);
-    assert_eq!(right, &[5, 6]);
-}
-
-{
-    let (left, right) = v.rsplit_array_ref::<6>();
-    assert_eq!(left, []);
-    assert_eq!(right, &[1, 2, 3, 4, 5, 6]);
-}
-

pub fn rsplit_array_mut<const N: usize>(&mut self) -> (&mut [T], &mut [T; N])

🔬This is a nightly-only experimental API. (split_array)

Divides one mutable slice into an array and a remainder slice at an -index from the end.

-

The slice will contain all indices from [0, len - N) (excluding -the index N itself) and the array will contain all -indices from [len - N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let mut v = &mut [1, 0, 3, 0, 5, 6][..];
-let (left, right) = v.rsplit_array_mut::<4>();
-assert_eq!(left, [1, 0]);
-assert_eq!(right, &mut [3, 0, 5, 6]);
-left[1] = 2;
-right[1] = 4;
-assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
1.0.0

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred. The matched element is not contained in the subslices.

-
Examples
-
let slice = [10, 40, 33, 20];
-let mut iter = slice.split(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10, 40]);
-assert_eq!(iter.next().unwrap(), &[20]);
-assert!(iter.next().is_none());
-

If the first element is matched, an empty slice will be the first item -returned by the iterator. Similarly, if the last element in the slice -is matched, an empty slice will be the last item returned by the -iterator:

- -
let slice = [10, 40, 33];
-let mut iter = slice.split(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10, 40]);
-assert_eq!(iter.next().unwrap(), &[]);
-assert!(iter.next().is_none());
-

If two matched elements are directly adjacent, an empty slice will be -present between them:

- -
let slice = [10, 6, 33, 20];
-let mut iter = slice.split(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10]);
-assert_eq!(iter.next().unwrap(), &[]);
-assert_eq!(iter.next().unwrap(), &[20]);
-assert!(iter.next().is_none());
-
1.0.0

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that -match pred. The matched element is not contained in the subslices.

-
Examples
-
let mut v = [10, 40, 30, 20, 60, 50];
-
-for group in v.split_mut(|num| *num % 3 == 0) {
-    group[0] = 1;
-}
-assert_eq!(v, [1, 40, 30, 1, 60, 1]);
-
1.51.0

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred. The matched element is contained in the end of the previous -subslice as a terminator.

-
Examples
-
let slice = [10, 40, 33, 20];
-let mut iter = slice.split_inclusive(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10, 40, 33]);
-assert_eq!(iter.next().unwrap(), &[20]);
-assert!(iter.next().is_none());
-

If the last element of the slice is matched, -that element will be considered the terminator of the preceding slice. -That slice will be the last item returned by the iterator.

- -
let slice = [3, 10, 40, 33];
-let mut iter = slice.split_inclusive(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[3]);
-assert_eq!(iter.next().unwrap(), &[10, 40, 33]);
-assert!(iter.next().is_none());
-
1.51.0

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that -match pred. The matched element is contained in the previous -subslice as a terminator.

-
Examples
-
let mut v = [10, 40, 30, 20, 60, 50];
-
-for group in v.split_inclusive_mut(|num| *num % 3 == 0) {
-    let terminator_idx = group.len()-1;
-    group[terminator_idx] = 1;
-}
-assert_eq!(v, [10, 40, 1, 20, 1, 1]);
-
1.27.0

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred, starting at the end of the slice and working backwards. -The matched element is not contained in the subslices.

-
Examples
-
let slice = [11, 22, 33, 0, 44, 55];
-let mut iter = slice.rsplit(|num| *num == 0);
-
-assert_eq!(iter.next().unwrap(), &[44, 55]);
-assert_eq!(iter.next().unwrap(), &[11, 22, 33]);
-assert_eq!(iter.next(), None);
-

As with split(), if the first or last element is matched, an empty -slice will be the first (or last) item returned by the iterator.

- -
let v = &[0, 1, 1, 2, 3, 5, 8];
-let mut it = v.rsplit(|n| *n % 2 == 0);
-assert_eq!(it.next().unwrap(), &[]);
-assert_eq!(it.next().unwrap(), &[3, 5]);
-assert_eq!(it.next().unwrap(), &[1, 1]);
-assert_eq!(it.next().unwrap(), &[]);
-assert_eq!(it.next(), None);
-
1.27.0

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that -match pred, starting at the end of the slice and working -backwards. The matched element is not contained in the subslices.

-
Examples
-
let mut v = [100, 400, 300, 200, 600, 500];
-
-let mut count = 0;
-for group in v.rsplit_mut(|num| *num % 3 == 0) {
-    count += 1;
-    group[0] = count;
-}
-assert_eq!(v, [3, 400, 300, 2, 600, 1]);
-
1.0.0

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred, limited to returning at most n items. The matched element is -not contained in the subslices.

-

The last element returned, if any, will contain the remainder of the -slice.

-
Examples
-

Print the slice split once by numbers divisible by 3 (i.e., [10, 40], -[20, 60, 50]):

- -
let v = [10, 40, 30, 20, 60, 50];
-
-for group in v.splitn(2, |num| *num % 3 == 0) {
-    println!("{group:?}");
-}
-
1.0.0

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match -pred, limited to returning at most n items. The matched element is -not contained in the subslices.

-

The last element returned, if any, will contain the remainder of the -slice.

-
Examples
-
let mut v = [10, 40, 30, 20, 60, 50];
-
-for group in v.splitn_mut(2, |num| *num % 3 == 0) {
-    group[0] = 1;
-}
-assert_eq!(v, [1, 40, 30, 1, 60, 50]);
-
1.0.0

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred limited to returning at most n items. This starts at the end of -the slice and works backwards. The matched element is not contained in -the subslices.

-

The last element returned, if any, will contain the remainder of the -slice.

-
Examples
-

Print the slice split once, starting from the end, by numbers divisible -by 3 (i.e., [50], [10, 40, 30, 20]):

- -
let v = [10, 40, 30, 20, 60, 50];
-
-for group in v.rsplitn(2, |num| *num % 3 == 0) {
-    println!("{group:?}");
-}
-
1.0.0

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred limited to returning at most n items. This starts at the end of -the slice and works backwards. The matched element is not contained in -the subslices.

-

The last element returned, if any, will contain the remainder of the -slice.

-
Examples
-
let mut s = [10, 40, 30, 20, 60, 50];
-
-for group in s.rsplitn_mut(2, |num| *num % 3 == 0) {
-    group[0] = 1;
-}
-assert_eq!(s, [1, 40, 30, 20, 60, 1]);
-
1.0.0

pub fn contains(&self, x: &T) -> boolwhere - T: PartialEq<T>,

Returns true if the slice contains an element with the given value.

-

This operation is O(n).

-

Note that if you have a sorted slice, binary_search may be faster.

-
Examples
-
let v = [10, 40, 30];
-assert!(v.contains(&30));
-assert!(!v.contains(&50));
-

If you do not have a &T, but some other value that you can compare -with one (for example, String implements PartialEq<str>), you can -use iter().any:

- -
let v = [String::from("hello"), String::from("world")]; // slice of `String`
-assert!(v.iter().any(|e| e == "hello")); // search with `&str`
-assert!(!v.iter().any(|e| e == "hi"));
-
1.0.0

pub fn starts_with(&self, needle: &[T]) -> boolwhere - T: PartialEq<T>,

Returns true if needle is a prefix of the slice.

-
Examples
-
let v = [10, 40, 30];
-assert!(v.starts_with(&[10]));
-assert!(v.starts_with(&[10, 40]));
-assert!(!v.starts_with(&[50]));
-assert!(!v.starts_with(&[10, 50]));
-

Always returns true if needle is an empty slice:

- -
let v = &[10, 40, 30];
-assert!(v.starts_with(&[]));
-let v: &[u8] = &[];
-assert!(v.starts_with(&[]));
-
1.0.0

pub fn ends_with(&self, needle: &[T]) -> boolwhere - T: PartialEq<T>,

Returns true if needle is a suffix of the slice.

-
Examples
-
let v = [10, 40, 30];
-assert!(v.ends_with(&[30]));
-assert!(v.ends_with(&[40, 30]));
-assert!(!v.ends_with(&[50]));
-assert!(!v.ends_with(&[50, 30]));
-

Always returns true if needle is an empty slice:

- -
let v = &[10, 40, 30];
-assert!(v.ends_with(&[]));
-let v: &[u8] = &[];
-assert!(v.ends_with(&[]));
-
1.51.0

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>where - P: SlicePattern<Item = T> + ?Sized, - T: PartialEq<T>,

Returns a subslice with the prefix removed.

-

If the slice starts with prefix, returns the subslice after the prefix, wrapped in Some. -If prefix is empty, simply returns the original slice.

-

If the slice does not start with prefix, returns None.

-
Examples
-
let v = &[10, 40, 30];
-assert_eq!(v.strip_prefix(&[10]), Some(&[40, 30][..]));
-assert_eq!(v.strip_prefix(&[10, 40]), Some(&[30][..]));
-assert_eq!(v.strip_prefix(&[50]), None);
-assert_eq!(v.strip_prefix(&[10, 50]), None);
-
-let prefix : &str = "he";
-assert_eq!(b"hello".strip_prefix(prefix.as_bytes()),
-           Some(b"llo".as_ref()));
-
1.51.0

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>where - P: SlicePattern<Item = T> + ?Sized, - T: PartialEq<T>,

Returns a subslice with the suffix removed.

-

If the slice ends with suffix, returns the subslice before the suffix, wrapped in Some. -If suffix is empty, simply returns the original slice.

-

If the slice does not end with suffix, returns None.

-
Examples
-
let v = &[10, 40, 30];
-assert_eq!(v.strip_suffix(&[30]), Some(&[10, 40][..]));
-assert_eq!(v.strip_suffix(&[40, 30]), Some(&[10][..]));
-assert_eq!(v.strip_suffix(&[50]), None);
-assert_eq!(v.strip_suffix(&[50, 30]), None);
-

Binary searches this slice for a given element. -If the slice is not sorted, the returned result is unspecified and -meaningless.

-

If the value is found then [Result::Ok] is returned, containing the -index of the matching element. If there are multiple matches, then any -one of the matches could be returned. The index is chosen -deterministically, but is subject to change in future versions of Rust. -If the value is not found then [Result::Err] is returned, containing -the index where a matching element could be inserted while maintaining -sorted order.

-

See also binary_search_by, binary_search_by_key, and partition_point.

-
Examples
-

Looks up a series of four elements. The first is found, with a -uniquely determined position; the second and third are not -found; the fourth could match any position in [1, 4].

- -
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-
-assert_eq!(s.binary_search(&13),  Ok(9));
-assert_eq!(s.binary_search(&4),   Err(7));
-assert_eq!(s.binary_search(&100), Err(13));
-let r = s.binary_search(&1);
-assert!(match r { Ok(1..=4) => true, _ => false, });
-

If you want to find that whole range of matching items, rather than -an arbitrary matching one, that can be done using partition_point:

- -
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-
-let low = s.partition_point(|x| x < &1);
-assert_eq!(low, 1);
-let high = s.partition_point(|x| x <= &1);
-assert_eq!(high, 5);
-let r = s.binary_search(&1);
-assert!((low..high).contains(&r.unwrap()));
-
-assert!(s[..low].iter().all(|&x| x < 1));
-assert!(s[low..high].iter().all(|&x| x == 1));
-assert!(s[high..].iter().all(|&x| x > 1));
-
-// For something not found, the "range" of equal items is empty
-assert_eq!(s.partition_point(|x| x < &11), 9);
-assert_eq!(s.partition_point(|x| x <= &11), 9);
-assert_eq!(s.binary_search(&11), Err(9));
-

If you want to insert an item to a sorted vector, while maintaining -sort order, consider using partition_point:

- -
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-let num = 42;
-let idx = s.partition_point(|&x| x < num);
-// The above is equivalent to `let idx = s.binary_search(&num).unwrap_or_else(|x| x);`
-s.insert(idx, num);
-assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
1.0.0

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>where - F: FnMut(&'a T) -> Ordering,

Binary searches this slice with a comparator function.

-

The comparator function should return an order code that indicates -whether its argument is Less, Equal or Greater the desired -target. -If the slice is not sorted or if the comparator function does not -implement an order consistent with the sort order of the underlying -slice, the returned result is unspecified and meaningless.

-

If the value is found then [Result::Ok] is returned, containing the -index of the matching element. If there are multiple matches, then any -one of the matches could be returned. The index is chosen -deterministically, but is subject to change in future versions of Rust. -If the value is not found then [Result::Err] is returned, containing -the index where a matching element could be inserted while maintaining -sorted order.

-

See also binary_search, binary_search_by_key, and partition_point.

-
Examples
-

Looks up a series of four elements. The first is found, with a -uniquely determined position; the second and third are not -found; the fourth could match any position in [1, 4].

- -
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-
-let seek = 13;
-assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Ok(9));
-let seek = 4;
-assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(7));
-let seek = 100;
-assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(13));
-let seek = 1;
-let r = s.binary_search_by(|probe| probe.cmp(&seek));
-assert!(match r { Ok(1..=4) => true, _ => false, });
-
1.10.0

pub fn binary_search_by_key<'a, B, F>( - &'a self, - b: &B, - f: F -) -> Result<usize, usize>where - F: FnMut(&'a T) -> B, - B: Ord,

Binary searches this slice with a key extraction function.

-

Assumes that the slice is sorted by the key, for instance with -sort_by_key using the same key extraction function. -If the slice is not sorted by the key, the returned result is -unspecified and meaningless.

-

If the value is found then [Result::Ok] is returned, containing the -index of the matching element. If there are multiple matches, then any -one of the matches could be returned. The index is chosen -deterministically, but is subject to change in future versions of Rust. -If the value is not found then [Result::Err] is returned, containing -the index where a matching element could be inserted while maintaining -sorted order.

-

See also binary_search, binary_search_by, and partition_point.

-
Examples
-

Looks up a series of four elements in a slice of pairs sorted by -their second elements. The first is found, with a uniquely -determined position; the second and third are not found; the -fourth could match any position in [1, 4].

- -
let s = [(0, 0), (2, 1), (4, 1), (5, 1), (3, 1),
-         (1, 2), (2, 3), (4, 5), (5, 8), (3, 13),
-         (1, 21), (2, 34), (4, 55)];
-
-assert_eq!(s.binary_search_by_key(&13, |&(a, b)| b),  Ok(9));
-assert_eq!(s.binary_search_by_key(&4, |&(a, b)| b),   Err(7));
-assert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13));
-let r = s.binary_search_by_key(&1, |&(a, b)| b);
-assert!(match r { Ok(1..=4) => true, _ => false, });
-
1.20.0

pub fn sort_unstable(&mut self)where - T: Ord,

Sorts the slice, but might not preserve the order of equal elements.

-

This sort is unstable (i.e., may reorder equal elements), in-place -(i.e., does not allocate), and O(n * log(n)) worst-case.

-
Current implementation
-

The current algorithm is based on pattern-defeating quicksort by Orson Peters, -which combines the fast average case of randomized quicksort with the fast worst case of -heapsort, while achieving linear time on slices with certain patterns. It uses some -randomization to avoid degenerate cases, but with a fixed seed to always provide -deterministic behavior.

-

It is typically faster than stable sorting, except in a few special cases, e.g., when the -slice consists of several concatenated sorted sequences.

-
Examples
-
let mut v = [-5, 4, 1, -3, 2];
-
-v.sort_unstable();
-assert!(v == [-5, -3, 1, 2, 4]);
-
1.20.0

pub fn sort_unstable_by<F>(&mut self, compare: F)where - F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparator function, but might not preserve the order of equal -elements.

-

This sort is unstable (i.e., may reorder equal elements), in-place -(i.e., does not allocate), and O(n * log(n)) worst-case.

-

The comparator function must define a total ordering for the elements in the slice. If -the ordering is not total, the order of the elements is unspecified. An order is a -total order if it is (for all a, b and c):

-
    -
  • total and antisymmetric: exactly one of a < b, a == b or a > b is true, and
  • -
  • transitive, a < b and b < c implies a < c. The same must hold for both == and >.
  • -
-

For example, while [f64] doesn’t implement [Ord] because NaN != NaN, we can use -partial_cmp as our sort function when we know the slice doesn’t contain a NaN.

- -
let mut floats = [5f64, 4.0, 1.0, 3.0, 2.0];
-floats.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());
-assert_eq!(floats, [1.0, 2.0, 3.0, 4.0, 5.0]);
-
Current implementation
-

The current algorithm is based on pattern-defeating quicksort by Orson Peters, -which combines the fast average case of randomized quicksort with the fast worst case of -heapsort, while achieving linear time on slices with certain patterns. It uses some -randomization to avoid degenerate cases, but with a fixed seed to always provide -deterministic behavior.

-

It is typically faster than stable sorting, except in a few special cases, e.g., when the -slice consists of several concatenated sorted sequences.

-
Examples
-
let mut v = [5, 4, 1, 3, 2];
-v.sort_unstable_by(|a, b| a.cmp(b));
-assert!(v == [1, 2, 3, 4, 5]);
-
-// reverse sorting
-v.sort_unstable_by(|a, b| b.cmp(a));
-assert!(v == [5, 4, 3, 2, 1]);
-
1.20.0

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)where - F: FnMut(&T) -> K, - K: Ord,

Sorts the slice with a key extraction function, but might not preserve the order of equal -elements.

-

This sort is unstable (i.e., may reorder equal elements), in-place -(i.e., does not allocate), and O(m * n * log(n)) worst-case, where the key function is -O(m).

-
Current implementation
-

The current algorithm is based on pattern-defeating quicksort by Orson Peters, -which combines the fast average case of randomized quicksort with the fast worst case of -heapsort, while achieving linear time on slices with certain patterns. It uses some -randomization to avoid degenerate cases, but with a fixed seed to always provide -deterministic behavior.

-

Due to its key calling strategy, sort_unstable_by_key -is likely to be slower than sort_by_cached_key in -cases where the key function is expensive.

-
Examples
-
let mut v = [-5i32, 4, 1, -3, 2];
-
-v.sort_unstable_by_key(|k| k.abs());
-assert!(v == [1, 2, -3, 4, -5]);
-
1.49.0

pub fn select_nth_unstable( - &mut self, - index: usize -) -> (&mut [T], &mut T, &mut [T])where - T: Ord,

Reorder the slice such that the element at index is at its final sorted position.

-

This reordering has the additional property that any value at position i < index will be -less than or equal to any value at a position j > index. Additionally, this reordering is -unstable (i.e. any number of equal elements may end up at position index), in-place -(i.e. does not allocate), and runs in O(n) time. -This function is also known as “kth element” in other libraries.

-

It returns a triplet of the following from the reordered slice: -the subslice prior to index, the element at index, and the subslice after index; -accordingly, the values in those two subslices will respectively all be less-than-or-equal-to -and greater-than-or-equal-to the value of the element at index.

-
Current implementation
-

The current algorithm is an introselect implementation based on Pattern Defeating Quicksort, which is also -the basis for sort_unstable. The fallback algorithm is Median of Medians using Tukey’s Ninther for -pivot selection, which guarantees linear runtime for all inputs.

-
Panics
-

Panics when index >= len(), meaning it always panics on empty slices.

-
Examples
-
let mut v = [-5i32, 4, 1, -3, 2];
-
-// Find the median
-v.select_nth_unstable(2);
-
-// We are only guaranteed the slice will be one of the following, based on the way we sort
-// about the specified index.
-assert!(v == [-3, -5, 1, 2, 4] ||
-        v == [-5, -3, 1, 2, 4] ||
-        v == [-3, -5, 1, 4, 2] ||
-        v == [-5, -3, 1, 4, 2]);
-
1.49.0

pub fn select_nth_unstable_by<F>( - &mut self, - index: usize, - compare: F -) -> (&mut [T], &mut T, &mut [T])where - F: FnMut(&T, &T) -> Ordering,

Reorder the slice with a comparator function such that the element at index is at its -final sorted position.

-

This reordering has the additional property that any value at position i < index will be -less than or equal to any value at a position j > index using the comparator function. -Additionally, this reordering is unstable (i.e. any number of equal elements may end up at -position index), in-place (i.e. does not allocate), and runs in O(n) time. -This function is also known as “kth element” in other libraries.

-

It returns a triplet of the following from -the slice reordered according to the provided comparator function: the subslice prior to -index, the element at index, and the subslice after index; accordingly, the values in -those two subslices will respectively all be less-than-or-equal-to and greater-than-or-equal-to -the value of the element at index.

-
Current implementation
-

The current algorithm is an introselect implementation based on Pattern Defeating Quicksort, which is also -the basis for sort_unstable. The fallback algorithm is Median of Medians using Tukey’s Ninther for -pivot selection, which guarantees linear runtime for all inputs.

-
Panics
-

Panics when index >= len(), meaning it always panics on empty slices.

-
Examples
-
let mut v = [-5i32, 4, 1, -3, 2];
-
-// Find the median as if the slice were sorted in descending order.
-v.select_nth_unstable_by(2, |a, b| b.cmp(a));
-
-// We are only guaranteed the slice will be one of the following, based on the way we sort
-// about the specified index.
-assert!(v == [2, 4, 1, -5, -3] ||
-        v == [2, 4, 1, -3, -5] ||
-        v == [4, 2, 1, -5, -3] ||
-        v == [4, 2, 1, -3, -5]);
-
1.49.0

pub fn select_nth_unstable_by_key<K, F>( - &mut self, - index: usize, - f: F -) -> (&mut [T], &mut T, &mut [T])where - F: FnMut(&T) -> K, - K: Ord,

Reorder the slice with a key extraction function such that the element at index is at its -final sorted position.

-

This reordering has the additional property that any value at position i < index will be -less than or equal to any value at a position j > index using the key extraction function. -Additionally, this reordering is unstable (i.e. any number of equal elements may end up at -position index), in-place (i.e. does not allocate), and runs in O(n) time. -This function is also known as “kth element” in other libraries.

-

It returns a triplet of the following from -the slice reordered according to the provided key extraction function: the subslice prior to -index, the element at index, and the subslice after index; accordingly, the values in -those two subslices will respectively all be less-than-or-equal-to and greater-than-or-equal-to -the value of the element at index.

-
Current implementation
-

The current algorithm is an introselect implementation based on Pattern Defeating Quicksort, which is also -the basis for sort_unstable. The fallback algorithm is Median of Medians using Tukey’s Ninther for -pivot selection, which guarantees linear runtime for all inputs.

-
Panics
-

Panics when index >= len(), meaning it always panics on empty slices.

-
Examples
-
let mut v = [-5i32, 4, 1, -3, 2];
-
-// Return the median as if the array were sorted according to absolute value.
-v.select_nth_unstable_by_key(2, |a| a.abs());
-
-// We are only guaranteed the slice will be one of the following, based on the way we sort
-// about the specified index.
-assert!(v == [1, 2, -3, 4, -5] ||
-        v == [1, 2, -3, -5, 4] ||
-        v == [2, 1, -3, 4, -5] ||
-        v == [2, 1, -3, -5, 4]);
-

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])where - T: PartialEq<T>,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all consecutive repeated elements to the end of the slice according to the -[PartialEq] trait implementation.

-

Returns two slices. The first contains no consecutive repeated elements. -The second contains all the duplicates in no specified order.

-

If the slice is sorted, the first returned slice contains no duplicates.

-
Examples
-
#![feature(slice_partition_dedup)]
-
-let mut slice = [1, 2, 2, 3, 3, 2, 1, 1];
-
-let (dedup, duplicates) = slice.partition_dedup();
-
-assert_eq!(dedup, [1, 2, 3, 2, 1]);
-assert_eq!(duplicates, [2, 3, 1]);
-

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])where - F: FnMut(&mut T, &mut T) -> bool,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice satisfying -a given equality relation.

-

Returns two slices. The first contains no consecutive repeated elements. -The second contains all the duplicates in no specified order.

-

The same_bucket function is passed references to two elements from the slice and -must determine if the elements compare equal. The elements are passed in opposite order -from their order in the slice, so if same_bucket(a, b) returns true, a is moved -at the end of the slice.

-

If the slice is sorted, the first returned slice contains no duplicates.

-
Examples
-
#![feature(slice_partition_dedup)]
-
-let mut slice = ["foo", "Foo", "BAZ", "Bar", "bar", "baz", "BAZ"];
-
-let (dedup, duplicates) = slice.partition_dedup_by(|a, b| a.eq_ignore_ascii_case(b));
-
-assert_eq!(dedup, ["foo", "BAZ", "Bar", "baz"]);
-assert_eq!(duplicates, ["bar", "Foo", "BAZ"]);
-

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])where - F: FnMut(&mut T) -> K, - K: PartialEq<K>,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice that resolve -to the same key.

-

Returns two slices. The first contains no consecutive repeated elements. -The second contains all the duplicates in no specified order.

-

If the slice is sorted, the first returned slice contains no duplicates.

-
Examples
-
#![feature(slice_partition_dedup)]
-
-let mut slice = [10, 20, 21, 30, 30, 20, 11, 13];
-
-let (dedup, duplicates) = slice.partition_dedup_by_key(|i| *i / 10);
-
-assert_eq!(dedup, [10, 20, 30, 20, 11]);
-assert_eq!(duplicates, [21, 30, 13]);
-
1.26.0

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the -slice move to the end while the last self.len() - mid elements move to -the front. After calling rotate_left, the element previously at index -mid will become the first element in the slice.

-
Panics
-

This function will panic if mid is greater than the length of the -slice. Note that mid == self.len() does not panic and is a no-op -rotation.

-
Complexity
-

Takes linear (in self.len()) time.

-
Examples
-
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
-a.rotate_left(2);
-assert_eq!(a, ['c', 'd', 'e', 'f', 'a', 'b']);
-

Rotating a subslice:

- -
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
-a[1..5].rotate_left(1);
-assert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']);
-
1.26.0

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k -elements of the slice move to the end while the last k elements move -to the front. After calling rotate_right, the element previously at -index self.len() - k will become the first element in the slice.

-
Panics
-

This function will panic if k is greater than the length of the -slice. Note that k == self.len() does not panic and is a no-op -rotation.

-
Complexity
-

Takes linear (in self.len()) time.

-
Examples
-
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
-a.rotate_right(2);
-assert_eq!(a, ['e', 'f', 'a', 'b', 'c', 'd']);
-

Rotate a subslice:

- -
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
-a[1..5].rotate_right(1);
-assert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']);
-
1.50.0

pub fn fill(&mut self, value: T)where - T: Clone,

Fills self with elements by cloning value.

-
Examples
-
let mut buf = vec![0; 10];
-buf.fill(1);
-assert_eq!(buf, vec![1; 10]);
-
1.51.0

pub fn fill_with<F>(&mut self, f: F)where - F: FnMut() -> T,

Fills self with elements returned by calling a closure repeatedly.

-

This method uses a closure to create new values. If you’d rather -[Clone] a given value, use fill. If you want to use the [Default] -trait to generate values, you can pass [Default::default] as the -argument.

-
Examples
-
let mut buf = vec![1; 10];
-buf.fill_with(Default::default);
-assert_eq!(buf, vec![0; 10]);
-
1.7.0

pub fn clone_from_slice(&mut self, src: &[T])where - T: Clone,

Copies the elements from src into self.

-

The length of src must be the same as self.

-
Panics
-

This function will panic if the two slices have different lengths.

-
Examples
-

Cloning two elements from a slice into another:

- -
let src = [1, 2, 3, 4];
-let mut dst = [0, 0];
-
-// Because the slices have to be the same length,
-// we slice the source slice from four elements
-// to two. It will panic if we don't do this.
-dst.clone_from_slice(&src[2..]);
-
-assert_eq!(src, [1, 2, 3, 4]);
-assert_eq!(dst, [3, 4]);
-

Rust enforces that there can only be one mutable reference with no -immutable references to a particular piece of data in a particular -scope. Because of this, attempting to use clone_from_slice on a -single slice will result in a compile failure:

- -
let mut slice = [1, 2, 3, 4, 5];
-
-slice[..2].clone_from_slice(&slice[3..]); // compile fail!
-

To work around this, we can use split_at_mut to create two distinct -sub-slices from a slice:

- -
let mut slice = [1, 2, 3, 4, 5];
-
-{
-    let (left, right) = slice.split_at_mut(2);
-    left.clone_from_slice(&right[1..]);
-}
-
-assert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.9.0

pub fn copy_from_slice(&mut self, src: &[T])where - T: Copy,

Copies all elements from src into self, using a memcpy.

-

The length of src must be the same as self.

-

If T does not implement Copy, use clone_from_slice.

-
Panics
-

This function will panic if the two slices have different lengths.

-
Examples
-

Copying two elements from a slice into another:

- -
let src = [1, 2, 3, 4];
-let mut dst = [0, 0];
-
-// Because the slices have to be the same length,
-// we slice the source slice from four elements
-// to two. It will panic if we don't do this.
-dst.copy_from_slice(&src[2..]);
-
-assert_eq!(src, [1, 2, 3, 4]);
-assert_eq!(dst, [3, 4]);
-

Rust enforces that there can only be one mutable reference with no -immutable references to a particular piece of data in a particular -scope. Because of this, attempting to use copy_from_slice on a -single slice will result in a compile failure:

- -
let mut slice = [1, 2, 3, 4, 5];
-
-slice[..2].copy_from_slice(&slice[3..]); // compile fail!
-

To work around this, we can use split_at_mut to create two distinct -sub-slices from a slice:

- -
let mut slice = [1, 2, 3, 4, 5];
-
-{
-    let (left, right) = slice.split_at_mut(2);
-    left.copy_from_slice(&right[1..]);
-}
-
-assert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.37.0

pub fn copy_within<R>(&mut self, src: R, dest: usize)where - R: RangeBounds<usize>, - T: Copy,

Copies elements from one part of the slice to another part of itself, -using a memmove.

-

src is the range within self to copy from. dest is the starting -index of the range within self to copy to, which will have the same -length as src. The two ranges may overlap. The ends of the two ranges -must be less than or equal to self.len().

-
Panics
-

This function will panic if either range exceeds the end of the slice, -or if the end of src is before the start.

-
Examples
-

Copying four bytes within a slice:

- -
let mut bytes = *b"Hello, World!";
-
-bytes.copy_within(1..5, 8);
-
-assert_eq!(&bytes, b"Hello, Wello!");
-
1.27.0

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

-

The length of other must be the same as self.

-
Panics
-

This function will panic if the two slices have different lengths.

-
Example
-

Swapping two elements across slices:

- -
let mut slice1 = [0, 0];
-let mut slice2 = [1, 2, 3, 4];
-
-slice1.swap_with_slice(&mut slice2[2..]);
-
-assert_eq!(slice1, [3, 4]);
-assert_eq!(slice2, [1, 2, 0, 0]);
-

Rust enforces that there can only be one mutable reference to a -particular piece of data in a particular scope. Because of this, -attempting to use swap_with_slice on a single slice will result in -a compile failure:

- -
let mut slice = [1, 2, 3, 4, 5];
-slice[..2].swap_with_slice(&mut slice[3..]); // compile fail!
-

To work around this, we can use split_at_mut to create two distinct -mutable sub-slices from a slice:

- -
let mut slice = [1, 2, 3, 4, 5];
-
-{
-    let (left, right) = slice.split_at_mut(2);
-    left.swap_with_slice(&mut right[1..]);
-}
-
-assert_eq!(slice, [4, 5, 3, 1, 2]);
-
1.30.0

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmute the slice to a slice of another type, ensuring alignment of the types is -maintained.

-

This method splits the slice into three distinct slices: prefix, correctly aligned middle -slice of a new type, and the suffix slice. How exactly the slice is split up is not -specified; the middle part may be smaller than necessary. However, if this fails to return a -maximal middle part, that is because code is running in a context where performance does not -matter, such as a sanitizer attempting to find alignment bugs. Regular code running -in a default (debug or release) execution will return a maximal middle part.

-

This method has no purpose when either input element T or output element U are -zero-sized and will return the original slice without splitting anything.

-
Safety
-

This method is essentially a transmute with respect to the elements in the returned -middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

-
Examples
-

Basic usage:

- -
unsafe {
-    let bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];
-    let (prefix, shorts, suffix) = bytes.align_to::<u16>();
-    // less_efficient_algorithm_for_bytes(prefix);
-    // more_efficient_algorithm_for_aligned_shorts(shorts);
-    // less_efficient_algorithm_for_bytes(suffix);
-}
-
1.30.0

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmute the mutable slice to a mutable slice of another type, ensuring alignment of the -types is maintained.

-

This method splits the slice into three distinct slices: prefix, correctly aligned middle -slice of a new type, and the suffix slice. How exactly the slice is split up is not -specified; the middle part may be smaller than necessary. However, if this fails to return a -maximal middle part, that is because code is running in a context where performance does not -matter, such as a sanitizer attempting to find alignment bugs. Regular code running -in a default (debug or release) execution will return a maximal middle part.

-

This method has no purpose when either input element T or output element U are -zero-sized and will return the original slice without splitting anything.

-
Safety
-

This method is essentially a transmute with respect to the elements in the returned -middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

-
Examples
-

Basic usage:

- -
unsafe {
-    let mut bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];
-    let (prefix, shorts, suffix) = bytes.align_to_mut::<u16>();
-    // less_efficient_algorithm_for_bytes(prefix);
-    // more_efficient_algorithm_for_aligned_shorts(shorts);
-    // less_efficient_algorithm_for_bytes(suffix);
-}
-

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])where - Simd<T, LANES>: AsRef<[T; LANES]>, - T: SimdElement, - LaneCount<LANES>: SupportedLaneCount,

🔬This is a nightly-only experimental API. (portable_simd)

Split a slice into a prefix, a middle of aligned SIMD types, and a suffix.

-

This is a safe wrapper around [slice::align_to], so has the same weak -postconditions as that method. You’re only assured that -self.len() == prefix.len() + middle.len() * LANES + suffix.len().

-

Notably, all of the following are possible:

-
    -
  • prefix.len() >= LANES.
  • -
  • middle.is_empty() despite self.len() >= 3 * LANES.
  • -
  • suffix.len() >= LANES.
  • -
-

That said, this is a safe method, so if you’re only writing safe code, -then this can at most cause incorrect logic, not unsoundness.

-
Panics
-

This will panic if the size of the SIMD type is different from -LANES times that of the scalar.

-

At the time of writing, the trait restrictions on Simd<T, LANES> keeps -that from ever happening, as only power-of-two numbers of lanes are -supported. It’s possible that, in the future, those restrictions might -be lifted in a way that would make it possible to see panics from this -method for something like LANES == 3.

-
Examples
-
#![feature(portable_simd)]
-use core::simd::SimdFloat;
-
-let short = &[1, 2, 3];
-let (prefix, middle, suffix) = short.as_simd::<4>();
-assert_eq!(middle, []); // Not enough elements for anything in the middle
-
-// They might be split in any possible way between prefix and suffix
-let it = prefix.iter().chain(suffix).copied();
-assert_eq!(it.collect::<Vec<_>>(), vec![1, 2, 3]);
-
-fn basic_simd_sum(x: &[f32]) -> f32 {
-    use std::ops::Add;
-    use std::simd::f32x4;
-    let (prefix, middle, suffix) = x.as_simd();
-    let sums = f32x4::from_array([
-        prefix.iter().copied().sum(),
-        0.0,
-        0.0,
-        suffix.iter().copied().sum(),
-    ]);
-    let sums = middle.iter().copied().fold(sums, f32x4::add);
-    sums.reduce_sum()
-}
-
-let numbers: Vec<f32> = (1..101).map(|x| x as _).collect();
-assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0);
-

pub fn as_simd_mut<const LANES: usize>( - &mut self -) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T])where - Simd<T, LANES>: AsMut<[T; LANES]>, - T: SimdElement, - LaneCount<LANES>: SupportedLaneCount,

🔬This is a nightly-only experimental API. (portable_simd)

Split a mutable slice into a mutable prefix, a middle of aligned SIMD types, -and a mutable suffix.

-

This is a safe wrapper around [slice::align_to_mut], so has the same weak -postconditions as that method. You’re only assured that -self.len() == prefix.len() + middle.len() * LANES + suffix.len().

-

Notably, all of the following are possible:

-
    -
  • prefix.len() >= LANES.
  • -
  • middle.is_empty() despite self.len() >= 3 * LANES.
  • -
  • suffix.len() >= LANES.
  • -
-

That said, this is a safe method, so if you’re only writing safe code, -then this can at most cause incorrect logic, not unsoundness.

-

This is the mutable version of [slice::as_simd]; see that for examples.

-
Panics
-

This will panic if the size of the SIMD type is different from -LANES times that of the scalar.

-

At the time of writing, the trait restrictions on Simd<T, LANES> keeps -that from ever happening, as only power-of-two numbers of lanes are -supported. It’s possible that, in the future, those restrictions might -be lifted in a way that would make it possible to see panics from this -method for something like LANES == 3.

-

pub fn is_sorted(&self) -> boolwhere - T: PartialOrd<T>,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted.

-

That is, for each element a and its following element b, a <= b must hold. If the -slice yields exactly zero or one element, true is returned.

-

Note that if Self::Item is only PartialOrd, but not Ord, the above definition -implies that this function returns false if any two consecutive items are not -comparable.

-
Examples
-
#![feature(is_sorted)]
-let empty: [i32; 0] = [];
-
-assert!([1, 2, 2, 9].is_sorted());
-assert!(![1, 3, 2, 4].is_sorted());
-assert!([0].is_sorted());
-assert!(empty.is_sorted());
-assert!(![0.0, 1.0, f32::NAN].is_sorted());
-

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> boolwhere - F: FnMut(&'a T, &'a T) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given comparator function.

-

Instead of using PartialOrd::partial_cmp, this function uses the given compare -function to determine the ordering of two elements. Apart from that, it’s equivalent to -is_sorted; see its documentation for more information.

-

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> boolwhere - F: FnMut(&'a T) -> K, - K: PartialOrd<K>,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given key extraction function.

-

Instead of comparing the slice’s elements directly, this function compares the keys of the -elements, as determined by f. Apart from that, it’s equivalent to is_sorted; see its -documentation for more information.

-
Examples
-
#![feature(is_sorted)]
-
-assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
-assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
-
1.52.0

pub fn partition_point<P>(&self, pred: P) -> usizewhere - P: FnMut(&T) -> bool,

Returns the index of the partition point according to the given predicate -(the index of the first element of the second partition).

-

The slice is assumed to be partitioned according to the given predicate. -This means that all elements for which the predicate returns true are at the start of the slice -and all elements for which the predicate returns false are at the end. -For example, [7, 15, 3, 5, 4, 12, 6] is partitioned under the predicate x % 2 != 0 -(all odd numbers are at the start, all even at the end).

-

If this slice is not partitioned, the returned result is unspecified and meaningless, -as this method performs a kind of binary search.

-

See also binary_search, binary_search_by, and binary_search_by_key.

-
Examples
-
let v = [1, 2, 3, 3, 5, 6, 7];
-let i = v.partition_point(|&x| x < 5);
-
-assert_eq!(i, 4);
-assert!(v[..i].iter().all(|&x| x < 5));
-assert!(v[i..].iter().all(|&x| !(x < 5)));
-

If all elements of the slice match the predicate, including if the slice -is empty, then the length of the slice will be returned:

- -
let a = [2, 4, 8];
-assert_eq!(a.partition_point(|x| x < &100), a.len());
-let a: [i32; 0] = [];
-assert_eq!(a.partition_point(|x| x < &100), 0);
-

If you want to insert an item to a sorted vector, while maintaining -sort order:

- -
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-let num = 42;
-let idx = s.partition_point(|&x| x < num);
-s.insert(idx, num);
-assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-

pub fn take<R, 'a>(self: &mut &'a [T], range: R) -> Option<&'a [T]>where - R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range -and returns a reference to it.

-

Returns None and does not modify the slice if the given -range is out of bounds.

-

Note that this method only accepts one-sided ranges such as -2.. or ..6, but not 2..6.

-
Examples
-

Taking the first three elements of a slice:

- -
#![feature(slice_take)]
-
-let mut slice: &[_] = &['a', 'b', 'c', 'd'];
-let mut first_three = slice.take(..3).unwrap();
-
-assert_eq!(slice, &['d']);
-assert_eq!(first_three, &['a', 'b', 'c']);
-

Taking the last two elements of a slice:

- -
#![feature(slice_take)]
-
-let mut slice: &[_] = &['a', 'b', 'c', 'd'];
-let mut tail = slice.take(2..).unwrap();
-
-assert_eq!(slice, &['a', 'b']);
-assert_eq!(tail, &['c', 'd']);
-

Getting None when range is out of bounds:

- -
#![feature(slice_take)]
-
-let mut slice: &[_] = &['a', 'b', 'c', 'd'];
-
-assert_eq!(None, slice.take(5..));
-assert_eq!(None, slice.take(..5));
-assert_eq!(None, slice.take(..=4));
-let expected: &[char] = &['a', 'b', 'c', 'd'];
-assert_eq!(Some(expected), slice.take(..4));
-

pub fn take_mut<R, 'a>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>where - R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range -and returns a mutable reference to it.

-

Returns None and does not modify the slice if the given -range is out of bounds.

-

Note that this method only accepts one-sided ranges such as -2.. or ..6, but not 2..6.

-
Examples
-

Taking the first three elements of a slice:

- -
#![feature(slice_take)]
-
-let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
-let mut first_three = slice.take_mut(..3).unwrap();
-
-assert_eq!(slice, &mut ['d']);
-assert_eq!(first_three, &mut ['a', 'b', 'c']);
-

Taking the last two elements of a slice:

- -
#![feature(slice_take)]
-
-let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
-let mut tail = slice.take_mut(2..).unwrap();
-
-assert_eq!(slice, &mut ['a', 'b']);
-assert_eq!(tail, &mut ['c', 'd']);
-

Getting None when range is out of bounds:

- -
#![feature(slice_take)]
-
-let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
-
-assert_eq!(None, slice.take_mut(5..));
-assert_eq!(None, slice.take_mut(..5));
-assert_eq!(None, slice.take_mut(..=4));
-let expected: &mut [_] = &mut ['a', 'b', 'c', 'd'];
-assert_eq!(Some(expected), slice.take_mut(..4));
-

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference -to it.

-

Returns None if the slice is empty.

-
Examples
-
#![feature(slice_take)]
-
-let mut slice: &[_] = &['a', 'b', 'c'];
-let first = slice.take_first().unwrap();
-
-assert_eq!(slice, &['b', 'c']);
-assert_eq!(first, &'a');
-

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable -reference to it.

-

Returns None if the slice is empty.

-
Examples
-
#![feature(slice_take)]
-
-let mut slice: &mut [_] = &mut ['a', 'b', 'c'];
-let first = slice.take_first_mut().unwrap();
-*first = 'd';
-
-assert_eq!(slice, &['b', 'c']);
-assert_eq!(first, &'d');
-

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference -to it.

-

Returns None if the slice is empty.

-
Examples
-
#![feature(slice_take)]
-
-let mut slice: &[_] = &['a', 'b', 'c'];
-let last = slice.take_last().unwrap();
-
-assert_eq!(slice, &['a', 'b']);
-assert_eq!(last, &'c');
-

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable -reference to it.

-

Returns None if the slice is empty.

-
Examples
-
#![feature(slice_take)]
-
-let mut slice: &mut [_] = &mut ['a', 'b', 'c'];
-let last = slice.take_last_mut().unwrap();
-*last = 'd';
-
-assert_eq!(slice, &['a', 'b']);
-assert_eq!(last, &'d');
-

pub unsafe fn get_many_unchecked_mut<const N: usize>( - &mut self, - indices: [usize; N] -) -> [&mut T; N]

🔬This is a nightly-only experimental API. (get_many_mut)

Returns mutable references to many indices at once, without doing any checks.

-

For a safe alternative see get_many_mut.

-
Safety
-

Calling this method with overlapping or out-of-bounds indices is undefined behavior -even if the resulting references are not used.

-
Examples
-
#![feature(get_many_mut)]
-
-let x = &mut [1, 2, 4];
-
-unsafe {
-    let [a, b] = x.get_many_unchecked_mut([0, 2]);
-    *a *= 10;
-    *b *= 100;
-}
-assert_eq!(x, &[10, 2, 400]);
-

pub fn get_many_mut<const N: usize>( - &mut self, - indices: [usize; N] -) -> Result<[&mut T; N], GetManyMutError<N>>

🔬This is a nightly-only experimental API. (get_many_mut)

Returns mutable references to many indices at once.

-

Returns an error if any index is out-of-bounds, or if the same index was -passed more than once.

-
Examples
-
#![feature(get_many_mut)]
-
-let v = &mut [1, 2, 3];
-if let Ok([a, b]) = v.get_many_mut([0, 2]) {
-    *a = 413;
-    *b = 612;
-}
-assert_eq!(v, &[413, 2, 612]);
-

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

-

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses -the ordering defined by [f64::total_cmp].

-
Current implementation
-

This uses the same sorting algorithm as sort_unstable_by.

-
Examples
-
#![feature(sort_floats)]
-let mut v = [2.6, -5e-8, f64::NAN, 8.29, f64::INFINITY, -1.0, 0.0, -f64::INFINITY, -0.0];
-
-v.sort_floats();
-let sorted = [-f64::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f64::INFINITY, f64::NAN];
-assert_eq!(&v[..8], &sorted[..8]);
-assert!(v[8].is_nan());
-

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

-

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses -the ordering defined by [f32::total_cmp].

-
Current implementation
-

This uses the same sorting algorithm as sort_unstable_by.

-
Examples
-
#![feature(sort_floats)]
-let mut v = [2.6, -5e-8, f32::NAN, 8.29, f32::INFINITY, -1.0, 0.0, -f32::INFINITY, -0.0];
-
-v.sort_floats();
-let sorted = [-f32::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f32::INFINITY, f32::NAN];
-assert_eq!(&v[..8], &sorted[..8]);
-assert!(v[8].is_nan());
-

Trait Implementations§

source§

impl<T, const N: usize> AsMut<[T]> for Vec<T, N>

source§

fn as_mut(&mut self) -> &mut [T]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T, const N: usize> AsMut<Vec<T, N>> for Vec<T, N>

source§

fn as_mut(&mut self) -> &mut Vec<T, N>

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T, const N: usize> AsRef<[T]> for Vec<T, N>

source§

fn as_ref(&self) -> &[T]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T, const N: usize> AsRef<Vec<T, N>> for Vec<T, N>

source§

fn as_ref(&self) -> &Vec<T, N>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T, const N: usize> Clone for Vec<T, N>where - T: Clone,

source§

fn clone(&self) -> Vec<T, N>

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, const N: usize> Debug for Vec<T, N>where - T: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<T, const N: usize> Default for Vec<T, N>

source§

fn default() -> Vec<T, N>

Returns the “default value” for a type. Read more
source§

impl<T, const N: usize> Deref for Vec<T, N>

§

type Target = [T]

The resulting type after dereferencing.
source§

fn deref(&self) -> &[T]

Dereferences the value.
source§

impl<T, const N: usize> DerefMut for Vec<T, N>

source§

fn deref_mut(&mut self) -> &mut [T]

Mutably dereferences the value.
source§

impl<T, const N: usize> Drop for Vec<T, N>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'a, T, const N: usize> Extend<&'a T> for Vec<T, N>where - T: 'a + Copy,

source§

fn extend<I>(&mut self, iter: I)where - I: IntoIterator<Item = &'a T>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, const N: usize> Extend<T> for Vec<T, N>

source§

fn extend<I>(&mut self, iter: I)where - I: IntoIterator<Item = T>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, const N: usize> FromIterator<T> for Vec<T, N>

source§

fn from_iter<I>(iter: I) -> Vec<T, N>where - I: IntoIterator<Item = T>,

Creates a value from an iterator. Read more
source§

impl<T, const N: usize> Hash for Vec<T, N>where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl<T, const N: usize> Hash for Vec<T, N>where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

Feeds this value into the given Hasher.
source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher.
source§

impl<'a, T, const N: usize> IntoIterator for &'a Vec<T, N>

§

type Item = &'a T

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <&'a Vec<T, N> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, T, const N: usize> IntoIterator for &'a mut Vec<T, N>

§

type Item = &'a mut T

The type of the elements being iterated over.
§

type IntoIter = IterMut<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <&'a mut Vec<T, N> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, const N: usize> IntoIterator for Vec<T, N>

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T, N>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> <Vec<T, N> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, const N: usize> Ord for Vec<T, N>where - T: Ord,

source§

fn cmp(&self, other: &Vec<T, N>) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<A, B, const N: usize> PartialEq<&[B]> for Vec<A, N>where - A: PartialEq<B>,

source§

fn eq(&self, other: &&[B]) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize, const M: usize> PartialEq<&[B; M]> for Vec<A, N>where - A: PartialEq<B>,

source§

fn eq(&self, other: &&[B; M]) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<&mut [B]> for Vec<A, N>where - A: PartialEq<B>,

source§

fn eq(&self, other: &&mut [B]) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<[B]> for Vec<A, N>where - A: PartialEq<B>,

source§

fn eq(&self, other: &[B]) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize, const M: usize> PartialEq<[B; M]> for Vec<A, N>where - A: PartialEq<B>,

source§

fn eq(&self, other: &[B; M]) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<Vec<A, N>> for &[B]where - A: PartialEq<B>,

source§

fn eq(&self, other: &Vec<A, N>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<Vec<A, N>> for &mut [B]where - A: PartialEq<B>,

source§

fn eq(&self, other: &Vec<A, N>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<Vec<A, N>> for [B]where - A: PartialEq<B>,

source§

fn eq(&self, other: &Vec<A, N>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N1: usize, const N2: usize> PartialEq<Vec<B, N2>> for Vec<A, N1>where - A: PartialEq<B>,

source§

fn eq(&self, other: &Vec<B, N2>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<T, const N1: usize, const N2: usize> PartialOrd<Vec<T, N2>> for Vec<T, N1>where - T: PartialOrd<T>,

source§

fn partial_cmp(&self, other: &Vec<T, N2>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl<'a, T, const N: usize> TryFrom<&'a [T]> for Vec<T, N>where - T: Clone,

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from( - slice: &'a [T] -) -> Result<Vec<T, N>, <Vec<T, N> as TryFrom<&'a [T]>>::Error>

Performs the conversion.
source§

impl<const N: usize> Write for Vec<u8, N>

source§

fn write_str(&mut self, s: &str) -> Result<(), Error>

Writes a string slice into this writer, returning whether the write -succeeded. Read more
1.1.0§

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a [char] into this writer, returning whether the write succeeded. Read more
1.0.0§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the [write!] macro with implementors of this trait. Read more
source§

impl<T, const N: usize> Eq for Vec<T, N>where - T: Eq,

Auto Trait Implementations§

§

impl<T, const N: usize> RefUnwindSafe for Vec<T, N>where - T: RefUnwindSafe,

§

impl<T, const N: usize> Send for Vec<T, N>where - T: Send,

§

impl<T, const N: usize> Sync for Vec<T, N>where - T: Sync,

§

impl<T, const N: usize> Unpin for Vec<T, N>where - T: Unpin,

§

impl<T, const N: usize> UnwindSafe for Vec<T, N>where - T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/trait.Printable.html b/docs/doc/arduboy_rust/prelude/trait.Printable.html deleted file mode 100644 index 3169cdf..0000000 --- a/docs/doc/arduboy_rust/prelude/trait.Printable.html +++ /dev/null @@ -1,11 +0,0 @@ -Printable in arduboy_rust::prelude - Rust
pub trait Printablewhere
-    Self: Sized,{
-    type Parameters;
-
-    // Required methods
-    fn print_2(self, params: Self::Parameters);
-    fn default_parameters() -> Self::Parameters;
-
-    // Provided method
-    fn print(self) { ... }
-}

Required Associated Types§

Required Methods§

source

fn print_2(self, params: Self::Parameters)

source

fn default_parameters() -> Self::Parameters

Provided Methods§

source

fn print(self)

Implementations on Foreign Types§

source§

impl Printable for u32

source§

impl Printable for i32

source§

impl Printable for &[u8]

§

type Parameters = ()

source§

fn print_2(self, _params: Self::Parameters)

source§

fn default_parameters() -> Self::Parameters

source§

impl Printable for &str

§

type Parameters = ()

source§

fn print_2(self, _params: Self::Parameters)

source§

fn default_parameters() -> Self::Parameters

source§

impl Printable for u16

source§

impl Printable for i16

Implementors§

source§

impl<const N: usize> Printable for String<N>

§

type Parameters = ()

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/type.c_char.html b/docs/doc/arduboy_rust/prelude/type.c_char.html deleted file mode 100644 index e133d82..0000000 --- a/docs/doc/arduboy_rust/prelude/type.c_char.html +++ /dev/null @@ -1,4 +0,0 @@ -c_char in arduboy_rust::prelude - Rust

Type Alias arduboy_rust::prelude::c_char

1.64.0 ·
pub type c_char = i8;
Expand description

Equivalent to C’s char type.

-

C’s char type is completely unlike Rust’s char type; while Rust’s type represents a unicode scalar value, C’s char type is just an ordinary integer. On modern architectures this type will always be either [i8] or [u8], as they use byte-addresses memory with 8-bit bytes.

-

C chars are most commonly used to make C strings. Unlike Rust, where the length of a string is included alongside the string, C strings mark the end of a string with the character '\0'. See CStr for more information.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/type.c_double.html b/docs/doc/arduboy_rust/prelude/type.c_double.html deleted file mode 100644 index 5a21091..0000000 --- a/docs/doc/arduboy_rust/prelude/type.c_double.html +++ /dev/null @@ -1,3 +0,0 @@ -c_double in arduboy_rust::prelude - Rust

Type Alias arduboy_rust::prelude::c_double

1.64.0 ·
pub type c_double = f64;
Expand description

Equivalent to C’s double type.

-

This type will almost always be [f64], which is guaranteed to be an IEEE 754 double-precision float in Rust. That said, the standard technically only guarantees that it be a floating-point number with at least the precision of a float, and it may be f32 or something entirely different from the IEEE-754 standard.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/type.c_float.html b/docs/doc/arduboy_rust/prelude/type.c_float.html deleted file mode 100644 index 1a67d02..0000000 --- a/docs/doc/arduboy_rust/prelude/type.c_float.html +++ /dev/null @@ -1,3 +0,0 @@ -c_float in arduboy_rust::prelude - Rust

Type Alias arduboy_rust::prelude::c_float

1.64.0 ·
pub type c_float = f32;
Expand description

Equivalent to C’s float type.

-

This type will almost always be [f32], which is guaranteed to be an IEEE 754 single-precision float in Rust. That said, the standard technically only guarantees that it be a floating-point number, and it may have less precision than f32 or not follow the IEEE-754 standard at all.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/type.c_int.html b/docs/doc/arduboy_rust/prelude/type.c_int.html deleted file mode 100644 index 7b289a6..0000000 --- a/docs/doc/arduboy_rust/prelude/type.c_int.html +++ /dev/null @@ -1,3 +0,0 @@ -c_int in arduboy_rust::prelude - Rust

Type Alias arduboy_rust::prelude::c_int

1.64.0 ·
pub type c_int = i16;
Expand description

Equivalent to C’s signed int (int) type.

-

This type will almost always be [i32], but may differ on some esoteric systems. The C standard technically only requires that this type be a signed integer that is at least the size of a short; some systems define it as an [i16], for example.

-

Trait Implementations§

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/type.c_long.html b/docs/doc/arduboy_rust/prelude/type.c_long.html deleted file mode 100644 index 2e42346..0000000 --- a/docs/doc/arduboy_rust/prelude/type.c_long.html +++ /dev/null @@ -1,3 +0,0 @@ -c_long in arduboy_rust::prelude - Rust

Type Alias arduboy_rust::prelude::c_long

1.64.0 ·
pub type c_long = i32;
Expand description

Equivalent to C’s signed long (long) type.

-

This type will always be [i32] or [i64]. Most notably, many Linux-based systems assume an i64, but Windows assumes i32. The C standard technically only requires that this type be a signed integer that is at least 32 bits and at least the size of an int, although in practice, no system would have a long that is neither an i32 nor i64.

-

Trait Implementations§

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/type.c_longlong.html b/docs/doc/arduboy_rust/prelude/type.c_longlong.html deleted file mode 100644 index 23a8728..0000000 --- a/docs/doc/arduboy_rust/prelude/type.c_longlong.html +++ /dev/null @@ -1,3 +0,0 @@ -c_longlong in arduboy_rust::prelude - Rust

Type Alias arduboy_rust::prelude::c_longlong

1.64.0 ·
pub type c_longlong = i64;
Expand description

Equivalent to C’s signed long long (long long) type.

-

This type will almost always be [i64], but may differ on some systems. The C standard technically only requires that this type be a signed integer that is at least 64 bits and at least the size of a long, although in practice, no system would have a long long that is not an i64, as most systems do not have a standardised [i128] type.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/type.c_size_t.html b/docs/doc/arduboy_rust/prelude/type.c_size_t.html deleted file mode 100644 index 917c0aa..0000000 --- a/docs/doc/arduboy_rust/prelude/type.c_size_t.html +++ /dev/null @@ -1,4 +0,0 @@ -c_size_t in arduboy_rust::prelude - Rust

Type Alias arduboy_rust::prelude::c_size_t

pub type c_size_t = usize;
🔬This is a nightly-only experimental API. (c_size_t)
Expand description

Equivalent to C’s size_t type, from stddef.h (or cstddef for C++).

-

This type is currently always [usize], however in the future there may be -platforms where this is not the case.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/type.c_uchar.html b/docs/doc/arduboy_rust/prelude/type.c_uchar.html deleted file mode 100644 index 6966c62..0000000 --- a/docs/doc/arduboy_rust/prelude/type.c_uchar.html +++ /dev/null @@ -1,3 +0,0 @@ -c_uchar in arduboy_rust::prelude - Rust

Type Alias arduboy_rust::prelude::c_uchar

1.64.0 ·
pub type c_uchar = u8;
Expand description

Equivalent to C’s unsigned char type.

-

This type will always be [u8], but is included for completeness. It is defined as being an unsigned integer the same size as a C char.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/type.c_uint.html b/docs/doc/arduboy_rust/prelude/type.c_uint.html deleted file mode 100644 index 3623529..0000000 --- a/docs/doc/arduboy_rust/prelude/type.c_uint.html +++ /dev/null @@ -1,3 +0,0 @@ -c_uint in arduboy_rust::prelude - Rust

Type Alias arduboy_rust::prelude::c_uint

1.64.0 ·
pub type c_uint = u16;
Expand description

Equivalent to C’s unsigned int type.

-

This type will almost always be [u32], but may differ on some esoteric systems. The C standard technically only requires that this type be an unsigned integer with the same size as an int; some systems define it as a [u16], for example.

-

Trait Implementations§

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/type.c_ulong.html b/docs/doc/arduboy_rust/prelude/type.c_ulong.html deleted file mode 100644 index 4b9fab5..0000000 --- a/docs/doc/arduboy_rust/prelude/type.c_ulong.html +++ /dev/null @@ -1,3 +0,0 @@ -c_ulong in arduboy_rust::prelude - Rust

Type Alias arduboy_rust::prelude::c_ulong

1.64.0 ·
pub type c_ulong = u32;
Expand description

Equivalent to C’s unsigned long type.

-

This type will always be [u32] or [u64]. Most notably, many Linux-based systems assume an u64, but Windows assumes u32. The C standard technically only requires that this type be an unsigned integer with the size of a long, although in practice, no system would have a ulong that is neither a u32 nor u64.

-

Trait Implementations§

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/type.c_ulonglong.html b/docs/doc/arduboy_rust/prelude/type.c_ulonglong.html deleted file mode 100644 index 0236b59..0000000 --- a/docs/doc/arduboy_rust/prelude/type.c_ulonglong.html +++ /dev/null @@ -1,3 +0,0 @@ -c_ulonglong in arduboy_rust::prelude - Rust

Type Alias arduboy_rust::prelude::c_ulonglong

1.64.0 ·
pub type c_ulonglong = u64;
Expand description

Equivalent to C’s unsigned long long type.

-

This type will almost always be [u64], but may differ on some systems. The C standard technically only requires that this type be an unsigned integer with the size of a long long, although in practice, no system would have a long long that is not a u64, as most systems do not have a standardised [u128] type.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/print/enum.Base.html b/docs/doc/arduboy_rust/print/enum.Base.html deleted file mode 100644 index 6567505..0000000 --- a/docs/doc/arduboy_rust/print/enum.Base.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../arduboy_rust/prelude/enum.Base.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/print/trait.Printable.html b/docs/doc/arduboy_rust/print/trait.Printable.html deleted file mode 100644 index 82f7093..0000000 --- a/docs/doc/arduboy_rust/print/trait.Printable.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../arduboy_rust/prelude/trait.Printable.html...

- - - \ No newline at end of file diff --git a/docs/doc/arduboy_rust/serial_print/fn.available.html b/docs/doc/arduboy_rust/serial_print/fn.available.html deleted file mode 100644 index 3e00c5b..0000000 --- a/docs/doc/arduboy_rust/serial_print/fn.available.html +++ /dev/null @@ -1,11 +0,0 @@ -available in arduboy_rust::serial_print - Rust
pub fn available() -> i16
Expand description

Get the number of bytes (characters) available for reading from the serial port. This is data that’s already arrived and stored in the serial receive buffer (which holds 64 bytes).

-

Example

-
if (Serial::available() > 0) {
-    // read the incoming byte:
-    incomingByte = Serial::read();
-
-    // say what you got:
-    Serial::print("I received: ");
-    Serial::println(incomingByte);
-}
-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/serial_print/fn.begin.html b/docs/doc/arduboy_rust/serial_print/fn.begin.html deleted file mode 100644 index f792386..0000000 --- a/docs/doc/arduboy_rust/serial_print/fn.begin.html +++ /dev/null @@ -1,4 +0,0 @@ -begin in arduboy_rust::serial_print - Rust
pub fn begin(baud_rates: u32)
Expand description

Sets the data rate in bits per second (baud) for serial data transmission. For communicating with Serial Monitor, make sure to use one of the baud rates listed in the menu at the bottom right corner of its screen. You can, however, specify other rates - for example, to communicate over pins 0 and 1 with a component that requires a particular baud rate.

-

Example

-
serial::begin(9600)
-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/serial_print/fn.end.html b/docs/doc/arduboy_rust/serial_print/fn.end.html deleted file mode 100644 index edd68ef..0000000 --- a/docs/doc/arduboy_rust/serial_print/fn.end.html +++ /dev/null @@ -1,2 +0,0 @@ -end in arduboy_rust::serial_print - Rust

Function arduboy_rust::serial_print::end

source ·
pub fn end()
Expand description

Disables serial communication, allowing the RX and TX pins to be used for general input and output. To re-enable serial communication, call begin().

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/serial_print/fn.print.html b/docs/doc/arduboy_rust/serial_print/fn.print.html deleted file mode 100644 index 14979bc..0000000 --- a/docs/doc/arduboy_rust/serial_print/fn.print.html +++ /dev/null @@ -1,13 +0,0 @@ -print in arduboy_rust::serial_print - Rust
pub fn print(x: impl Serialprintable)
Expand description

The Arduino Serial Print class is available for writing text to the screen buffer.

-

In the same manner as the Arduino arduboy.print(), etc., functions.

-

Example

- -
let value: i16 = 42;
-
-serial::print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the
-                                       // text cursor to the start of the next line
-serial::print(f!(b"Hello World\n")); // Prints "Hello World" but does not use the 2kb ram
-serial::print(value); // Prints "42"
-serial::print("\n\0"); // Sets the text cursor to the start of the next line
-serial::print("hello world") // Prints normal [&str]
-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/serial_print/fn.println.html b/docs/doc/arduboy_rust/serial_print/fn.println.html deleted file mode 100644 index 5896a9a..0000000 --- a/docs/doc/arduboy_rust/serial_print/fn.println.html +++ /dev/null @@ -1,13 +0,0 @@ -println in arduboy_rust::serial_print - Rust
pub fn println(x: impl Serialprintlnable)
Expand description

The Arduino Serial Print class is available for writing text to the screen buffer.

-

In the same manner as the Arduino arduboy.print(), etc., functions.

-

Example

- -
let value: i16 = 42;
-
-serial::print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the
-                                       // text cursor to the start of the next line
-serial::print(f!(b"Hello World\n")); // Prints "Hello World" but does not use the 2kb ram
-serial::print(value); // Prints "42"
-serial::print("\n\0"); // Sets the text cursor to the start of the next line
-serial::print("hello world") // Prints normal [&str]
-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/serial_print/fn.read.html b/docs/doc/arduboy_rust/serial_print/fn.read.html deleted file mode 100644 index 04696cd..0000000 --- a/docs/doc/arduboy_rust/serial_print/fn.read.html +++ /dev/null @@ -1,14 +0,0 @@ -read in arduboy_rust::serial_print - Rust
pub fn read() -> i16
Expand description

Reads incoming serial data. -Use only inside of available():

- -
if (serial::available() > 0) {
-    // read the incoming byte:
-    let incoming_byte: i16 = Serial::read();
-
-    // say what you got:
-    serial::print("I received: ");
-    serial::println(incoming_byte);
-}
-

Returns

-

The first byte of incoming serial data available (or -1 if no data is available). Data type: int.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/serial_print/fn.read_as_utf8_str.html b/docs/doc/arduboy_rust/serial_print/fn.read_as_utf8_str.html deleted file mode 100644 index b688aaa..0000000 --- a/docs/doc/arduboy_rust/serial_print/fn.read_as_utf8_str.html +++ /dev/null @@ -1,14 +0,0 @@ -read_as_utf8_str in arduboy_rust::serial_print - Rust
pub fn read_as_utf8_str() -> &'static str
Expand description

Reads incoming serial data.

-

Use only inside of available():

- -
if (Serial::available() > 0) {
-    // read the incoming byte:
-    let incomingByte: &str = Serial::read_as_utf8_str();
-
-    // say what you got:
-    Serial::print("I received: ");
-    Serial::println(incomingByte);
-}
-

Returns

-

The first byte of incoming serial data available (or -1 if no data is available). Data type: &str.

-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/serial_print/index.html b/docs/doc/arduboy_rust/serial_print/index.html deleted file mode 100644 index bd1aab3..0000000 --- a/docs/doc/arduboy_rust/serial_print/index.html +++ /dev/null @@ -1,4 +0,0 @@ -arduboy_rust::serial_print - Rust
Expand description

This is the Module to interact in a save way with the Arduino Serial C++ library.

-

You will need to uncomment the Arduino_Serial_Library in the import_config.h file.

-

Traits

Functions

  • Get the number of bytes (characters) available for reading from the serial port. This is data that’s already arrived and stored in the serial receive buffer (which holds 64 bytes).
  • Sets the data rate in bits per second (baud) for serial data transmission. For communicating with Serial Monitor, make sure to use one of the baud rates listed in the menu at the bottom right corner of its screen. You can, however, specify other rates - for example, to communicate over pins 0 and 1 with a component that requires a particular baud rate.
  • Disables serial communication, allowing the RX and TX pins to be used for general input and output. To re-enable serial communication, call begin().
  • The Arduino Serial Print class is available for writing text to the screen buffer.
  • The Arduino Serial Print class is available for writing text to the screen buffer.
  • Reads incoming serial data. -Use only inside of available():
  • Reads incoming serial data.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/serial_print/sidebar-items.js b/docs/doc/arduboy_rust/serial_print/sidebar-items.js deleted file mode 100644 index 93f9623..0000000 --- a/docs/doc/arduboy_rust/serial_print/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["available","begin","end","print","println","read","read_as_utf8_str"],"trait":["Serialprintable","Serialprintlnable"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/serial_print/trait.Serialprintable.html b/docs/doc/arduboy_rust/serial_print/trait.Serialprintable.html deleted file mode 100644 index 0a2949e..0000000 --- a/docs/doc/arduboy_rust/serial_print/trait.Serialprintable.html +++ /dev/null @@ -1,11 +0,0 @@ -Serialprintable in arduboy_rust::serial_print - Rust
pub trait Serialprintablewhere
-    Self: Sized,{
-    type Parameters;
-
-    // Required methods
-    fn print_2(self, params: Self::Parameters);
-    fn default_parameters() -> Self::Parameters;
-
-    // Provided method
-    fn print(self) { ... }
-}

Required Associated Types§

Required Methods§

source

fn print_2(self, params: Self::Parameters)

source

fn default_parameters() -> Self::Parameters

Provided Methods§

source

fn print(self)

Implementations on Foreign Types§

source§

impl Serialprintable for &[u8]

§

type Parameters = ()

source§

fn print_2(self, _params: Self::Parameters)

source§

fn default_parameters() -> Self::Parameters

source§

impl Serialprintable for i32

source§

impl Serialprintable for &str

§

type Parameters = ()

source§

fn print_2(self, _params: Self::Parameters)

source§

fn default_parameters() -> Self::Parameters

source§

impl Serialprintable for i16

source§

impl Serialprintable for u16

source§

impl Serialprintable for u32

Implementors§

source§

impl<const N: usize> Serialprintable for String<N>

§

type Parameters = ()

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/serial_print/trait.Serialprintlnable.html b/docs/doc/arduboy_rust/serial_print/trait.Serialprintlnable.html deleted file mode 100644 index 3a93ef7..0000000 --- a/docs/doc/arduboy_rust/serial_print/trait.Serialprintlnable.html +++ /dev/null @@ -1,11 +0,0 @@ -Serialprintlnable in arduboy_rust::serial_print - Rust
pub trait Serialprintlnablewhere
-    Self: Sized,{
-    type Parameters;
-
-    // Required methods
-    fn println_2(self, params: Self::Parameters);
-    fn default_parameters() -> Self::Parameters;
-
-    // Provided method
-    fn println(self) { ... }
-}

Required Associated Types§

Required Methods§

source

fn println_2(self, params: Self::Parameters)

source

fn default_parameters() -> Self::Parameters

Provided Methods§

source

fn println(self)

Implementations on Foreign Types§

source§

impl Serialprintlnable for &[u8]

§

type Parameters = ()

source§

fn println_2(self, _params: Self::Parameters)

source§

fn default_parameters() -> Self::Parameters

source§

impl Serialprintlnable for u16

source§

impl Serialprintlnable for u32

source§

impl Serialprintlnable for i32

source§

impl Serialprintlnable for i16

source§

impl Serialprintlnable for &str

§

type Parameters = ()

source§

fn println_2(self, _params: Self::Parameters)

source§

fn default_parameters() -> Self::Parameters

Implementors§

source§

impl<const N: usize> Serialprintlnable for String<N>

§

type Parameters = ()

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/sidebar-items.js b/docs/doc/arduboy_rust/sidebar-items.js deleted file mode 100644 index af87394..0000000 --- a/docs/doc/arduboy_rust/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["FONT_SIZE","HEIGHT","WIDTH"],"enum":["Color"],"macro":["f","get_ardvoice_tone_addr","get_sprite_addr","get_string_addr","get_tones_addr","progmem"],"mod":["arduboy2","arduboy_tone","arduino","ardvoice","c","hardware","heapless","prelude","serial_print","sprites"],"struct":["ArdVoice","Arduboy2","ArduboyTones","EEPROM","EEPROMBYTE"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/sprites/fn.draw_erase.html b/docs/doc/arduboy_rust/sprites/fn.draw_erase.html deleted file mode 100644 index 616c921..0000000 --- a/docs/doc/arduboy_rust/sprites/fn.draw_erase.html +++ /dev/null @@ -1,24 +0,0 @@ -draw_erase in arduboy_rust::sprites - Rust
pub fn draw_erase(x: i16, y: i16, bitmap: *const u8, frame: u8)
Expand description

“Erase” a sprite.

-

Parameters

-
    -
  • x,y The coordinates of the top left pixel location.
  • -
  • bitmap A pointer to the array containing the image frames.
  • -
  • frame The frame number of the image to erase.
  • -
-

The data from the specified frame in the array is used to erase a sprite. To “erase” a sprite, bits set to 1 in the frame will set the corresponding pixel in the buffer to 0. Frame bits set to 0 will remain unchanged in the buffer.

-
 image  before  after  (# = 1, - = 0)
-
- -----  -----   -----
- --#--  -----   -----
- ##-##  -----   -----
- --#--  -----   -----
- -----  -----   -----
-
- image  before  after
-
- -----  #####   #####
- --#--  #####   ##-##
- ##-##  #####   --#--
- --#--  #####   ##-##
- -----  #####   #####
-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/sprites/fn.draw_external_mask.html b/docs/doc/arduboy_rust/sprites/fn.draw_external_mask.html deleted file mode 100644 index cabd143..0000000 --- a/docs/doc/arduboy_rust/sprites/fn.draw_external_mask.html +++ /dev/null @@ -1,35 +0,0 @@ -draw_external_mask in arduboy_rust::sprites - Rust
pub fn draw_external_mask(
-    x: i16,
-    y: i16,
-    bitmap: *const u8,
-    mask: *const u8,
-    frame: u8,
-    mask_frame: u8
-)
Expand description

Draw a sprite using a separate image and mask array.

-

Parameters

-
    -
  • x,y The coordinates of the top left pixel location.
  • -
  • bitmap A pointer to the array containing the image frames.
  • -
  • mask A pointer to the array containing the mask frames.
  • -
  • frame The frame number of the image to draw.
  • -
  • mask_frame The frame number for the mask to use (can be different from the image frame number).
  • -
-

An array containing the image frames, and another array containing corresponding mask frames, are used to draw a sprite.

-

For the mask array, the width and height are not included but must contain data of the same dimensions as the corresponding image array.

-

Bits set to 1 in the mask indicate that the pixel will be set to the value of the corresponding image bit. Bits set to 0 in the mask will be left unchanged.

-
 image  mask   before  after  (# = 1, - = 0)
-
- -----  -###-  -----   -----
- --#--  #####  -----   --#--
- ##-##  ##-##  -----   ##-##
- --#--  #####  -----   --#--
- -----  -###-  -----   -----
-
- image  mask   before  after
-
- -----  -###-  #####   #---#
- --#--  #####  #####   --#--
- ##-##  #####  #####   ##-##
- --#--  #####  #####   --#--
- -----  -###-  #####   #---#
-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/sprites/fn.draw_override.html b/docs/doc/arduboy_rust/sprites/fn.draw_override.html deleted file mode 100644 index 64ca699..0000000 --- a/docs/doc/arduboy_rust/sprites/fn.draw_override.html +++ /dev/null @@ -1,24 +0,0 @@ -draw_override in arduboy_rust::sprites - Rust
pub fn draw_override(x: i16, y: i16, bitmap: *const u8, frame: u8)
Expand description

Draw a sprite by replacing the existing content completely.

-

Parameters

-
    -
  • x,y The coordinates of the top left pixel location.
  • -
  • bitmap A pointer to the array containing the image frames.
  • -
  • frame The frame number of the image to draw.
  • -
-

A sprite is drawn by overwriting the pixels in the buffer with the data from the specified frame in the array. No masking is done. A bit set to 1 in the frame will set the pixel to 1 in the buffer, and a 0 in the array will set a 0 in the buffer.

-
 image  before  after  (# = 1, - = 0)
-
- -----  -----   -----
- --#--  -----   --#--
- ##-##  -----   ##-##
- --#--  -----   --#--
- -----  -----   -----
-
- image  before  after
-
- -----  #####   -----
- --#--  #####   --#--
- ##-##  #####   ##-##
- --#--  #####   --#--
- -----  #####   -----
-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/sprites/fn.draw_plus_mask.html b/docs/doc/arduboy_rust/sprites/fn.draw_plus_mask.html deleted file mode 100644 index 421e12b..0000000 --- a/docs/doc/arduboy_rust/sprites/fn.draw_plus_mask.html +++ /dev/null @@ -1,24 +0,0 @@ -draw_plus_mask in arduboy_rust::sprites - Rust
pub fn draw_plus_mask(x: i16, y: i16, bitmap: *const u8, frame: u8)
Expand description

Draw a sprite using an array containing both image and mask values.

-

Parameters

-
    -
  • x,y The coordinates of the top left pixel location.
  • -
  • bitmap A pointer to the array containing the image/mask frames.
  • -
  • frame The frame number of the image to draw.
  • -
-

An array containing combined image and mask data is used to draw a sprite. Bytes are given in pairs with the first byte representing the image pixels and the second byte specifying the corresponding mask. The width given in the array still specifies the image width, so each row of image and mask bytes will be twice the width value.

-

Bits set to 1 in the mask indicate that the pixel will be set to the value of the corresponding image bit. Bits set to 0 in the mask will be left unchanged.

-

image mask before after (# = 1, - = 0)

-
 -----  -###-  -----   -----
- --#--  #####  -----   --#--
- ##-##  ##-##  -----   ##-##
- --#--  #####  -----   --#--
- -----  -###-  -----   -----
-
- image  mask   before  after
-
- -----  -###-  #####   #---#
- --#--  #####  #####   --#--
- ##-##  #####  #####   ##-##
- --#--  #####  #####   --#--
- -----  -###-  #####   #---#
-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/sprites/fn.draw_self_masked.html b/docs/doc/arduboy_rust/sprites/fn.draw_self_masked.html deleted file mode 100644 index 1a9916c..0000000 --- a/docs/doc/arduboy_rust/sprites/fn.draw_self_masked.html +++ /dev/null @@ -1,24 +0,0 @@ -draw_self_masked in arduboy_rust::sprites - Rust
pub fn draw_self_masked(x: i16, y: i16, bitmap: *const u8, frame: u8)
Expand description

Draw a sprite using only the bits set to 1.

-

Parameters

-
    -
  • x,y The coordinates of the top left pixel location.
  • -
  • bitmap A pointer to the array containing the image frames.
  • -
  • frame The frame number of the image to draw.
  • -
-

Bits set to 1 in the frame will be used to draw the sprite by setting the corresponding pixel in the buffer to 1. Bits set to 0 in the frame will remain unchanged in the buffer.

-
 image  before  after  (# = 1, - = 0)
-
- -----  -----   -----
- --#--  -----   --#--
- ##-##  -----   ##-##
- --#--  -----   --#--
- -----  -----   -----
-
- image  before  after
-
- -----  #####   #####  (no change because all pixels were
- --#--  #####   #####  already white)
- ##-##  #####   #####
- --#--  #####   #####
- -----  #####   #####
-
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/sprites/index.html b/docs/doc/arduboy_rust/sprites/index.html deleted file mode 100644 index ac71c2c..0000000 --- a/docs/doc/arduboy_rust/sprites/index.html +++ /dev/null @@ -1,2 +0,0 @@ -arduboy_rust::sprites - Rust

Module arduboy_rust::sprites

source ·
Expand description

This is the module to interact in a save way with the Sprites C++ library.

-

Functions

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/sprites/sidebar-items.js b/docs/doc/arduboy_rust/sprites/sidebar-items.js deleted file mode 100644 index 7046e20..0000000 --- a/docs/doc/arduboy_rust/sprites/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["draw_erase","draw_external_mask","draw_override","draw_plus_mask","draw_self_masked"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/struct.ArdVoice.html b/docs/doc/arduboy_rust/struct.ArdVoice.html deleted file mode 100644 index d5d9a87..0000000 --- a/docs/doc/arduboy_rust/struct.ArdVoice.html +++ /dev/null @@ -1,19 +0,0 @@ -ArdVoice in arduboy_rust - Rust

Struct arduboy_rust::ArdVoice

source ·
pub struct ArdVoice {}
Expand description

This is the struct to interact in a save way with the ArdVoice C++ library.

-

You will need to uncomment the ArdVoice_Library in the import_config.h file.

-

Implementations§

source§

impl ArdVoice

source

pub const fn new() -> Self

source

pub fn play_voice(&self, audio: *const u8)

source

pub fn play_voice_complex( - &self, - audio: *const u8, - start_time: u32, - end_time: u32, - speed: f32 -)

source

pub fn stop_voice(&self)

source

pub fn is_voice_playing(&self) -> bool

Auto Trait Implementations§

§

impl RefUnwindSafe for ArdVoice

§

impl Send for ArdVoice

§

impl Sync for ArdVoice

§

impl Unpin for ArdVoice

§

impl UnwindSafe for ArdVoice

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/struct.Arduboy2.html b/docs/doc/arduboy_rust/struct.Arduboy2.html deleted file mode 100644 index 518ca86..0000000 --- a/docs/doc/arduboy_rust/struct.Arduboy2.html +++ /dev/null @@ -1,379 +0,0 @@ -Arduboy2 in arduboy_rust - Rust

Struct arduboy_rust::Arduboy2

source ·
pub struct Arduboy2 {}
Expand description

This is the struct to interact in a save way with the Arduboy2 C++ library.

-

Implementations§

source§

impl Arduboy2

source

pub const fn new() -> Self

gives you a new instance of the Arduboy2

-
Example
-
const arduboy: Arduboy2 = Arduboy2::new();
-
source

pub fn begin(&self)

Initialize the hardware, display the boot logo, provide boot utilities, etc. -This function should be called once near the start of the sketch, usually in setup(), before using any other functions in this class. It initializes the display, displays the boot logo, provides “flashlight” and system control features and initializes audio control.

-
source

pub fn clear(&self)

Clear the display buffer and set the text cursor to location 0, 0.

-
source

pub fn display(&self)

Copy the contents of the display buffer to the display. -The contents of the display buffer in RAM are copied to the display and will appear on the screen.

-
source

pub fn display_and_clear_buffer(&self)

Copy the contents of the display buffer to the display. The display buffer will be cleared to zero.

-

Operation is the same as calling display() without parameters except additionally the display buffer will be cleared.

-
source

pub fn draw_fast_hline(&self, x: i16, y: i16, w: u8, color: Color)

Draw a horizontal line.

-
Parameters:
-
    -
  • x The X coordinate of the left start point.
  • -
  • y The Y coordinate of the left start point.
  • -
  • w The width of the line.
  • -
-

color The color of the line (optional; defaults to WHITE).

-
source

pub fn draw_fast_vline(&self, x: i16, y: i16, h: u8, color: Color)

Draw a vertical line.

-
Parameters:
-
    -
  • x The X coordinate of the left start point.
  • -
  • y The Y coordinate of the left start point.
  • -
  • h The height of the line.
  • -
-

color The color of the line (optional; defaults to WHITE).

-
source

pub fn draw_pixel(&self, x: i16, y: i16, color: Color)

Set a single pixel in the display buffer to the specified color.

-
Parameters
-
    -
  • x The X coordinate of the pixel.
  • -
  • y The Y coordinate of the pixel.
  • -
  • color The color of the pixel (optional; defaults to WHITE).
  • -
-

The single pixel specified location in the display buffer is set to the specified color. The values WHITE or BLACK can be used for the color. If the color parameter isn’t included, the pixel will be set to WHITE.

-
source

pub fn fill_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

Draw a filled-in rectangle of a specified width and height.

-
Parameters
-
    -
  • x The X coordinate of the upper left corner.
  • -
  • y The Y coordinate of the upper left corner.
  • -
  • w The width of the rectangle.
  • -
  • h The height of the rectangle.
  • -
-

color The color of the pixel (optional; defaults to WHITE).

-
source

pub fn draw_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

Draw a rectangle of a specified width and height.

-

Parameters

-
    -
  • x The X coordinate of the upper left corner.
  • -
  • y The Y coordinate of the upper left corner.
  • -
  • w The width of the rectangle.
  • -
  • h The height of the rectangle.
  • -
  • color The color of the pixel (optional; defaults to WHITE).
  • -
-
source

pub fn draw_circle(&self, x: i16, y: i16, r: u8, color: Color)

Draw a circle of a given radius.

-

Parameters

-
    -
  • x0 The X coordinate of the circle’s center.
  • -
  • y0 The Y coordinate of the circle’s center.
  • -
  • r The radius of the circle in pixels.
  • -
  • color The circle’s color (optional; defaults to WHITE).
  • -
-
source

pub fn fill_circle(&self, x: i16, y: i16, r: u8, color: Color)

Draw a filled-in circle of a given radius.

-
Parameters
-
    -
  • x The X coordinate of the circle’s center.
  • -
  • y The Y coordinate of the circle’s center.
  • -
  • r The radius of the circle in pixels.
  • -
-

color The circle’s color (optional; defaults to WHITE).

-
source

pub fn fill_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

Draw a filled-in rectangle with rounded corners.

-

Parameters

-
    -
  • x The X coordinate of the left edge.
  • -
  • y The Y coordinate of the top edge.
  • -
  • w The width of the rectangle.
  • -
  • h The height of the rectangle.
  • -
  • r The radius of the semicircles forming the corners.
  • -
  • color The color of the rectangle (optional; defaults to WHITE).
  • -
-
source

pub fn draw_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

Draw a rectangle with rounded corners.

-

Parameters

-
    -
  • x The X coordinate of the left edge.
  • -
  • y The Y coordinate of the top edge.
  • -
  • w The width of the rectangle.
  • -
  • h The height of the rectangle.
  • -
  • r The radius of the semicircles forming the corners.
  • -
  • color The color of the rectangle (optional; defaults to WHITE).
  • -
-
source

pub fn draw_triangle( - &self, - x0: i16, - y0: i16, - x1: i16, - y1: i16, - x2: i16, - y2: i16, - color: Color -)

Draw a triangle given the coordinates of each corner.

-

Parameters

-
    -
  • x0,x1,x2 The X coordinates of the corners.
  • -
  • y0,y1,y2 The Y coordinates of the corners.
  • -
  • color The triangle’s color (optional; defaults to WHITE).
  • -
-

A triangle is drawn by specifying each of the three corner locations. The corners can be at any position with respect to the others.

-
source

pub fn fill_triangle( - &self, - x0: i16, - y0: i16, - x1: i16, - y1: i16, - x2: i16, - y2: i16, - color: Color -)

Draw a filled-in triangle given the coordinates of each corner.

-

Parameters

-
    -
  • x0,x1,x2 The X coordinates of the corners.
  • -
  • y0,y1,y2 The Y coordinates of the corners.
  • -
  • color The triangle’s color (optional; defaults to WHITE).
  • -
-

A triangle is drawn by specifying each of the three corner locations. The corners can be at any position with respect to the others.

-
source

pub fn get_pixel(&self, x: u8, y: u8) -> Color

Returns the state of the given pixel in the screen buffer.

-
Parameters
-
    -
  • x The X coordinate of the pixel.
  • -
  • y The Y coordinate of the pixel.
  • -
-
Returns
-

WHITE if the pixel is on or BLACK if the pixel is off.

-
source

pub fn init_random_seed(&self)

Seed the random number generator with a random value.

-

The Arduino pseudorandom number generator is seeded with the random value returned from a call to generateRandomSeed().

-
source

pub fn just_pressed(&self, button: ButtonSet) -> bool

Check if a button has just been pressed.

-
Parameters
-
    -
  • button The button to test for. Only one button should be specified.
  • -
-
Returns
-

true if the specified button has just been pressed.

-

Return true if the given button was pressed between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.

-

There is no need to check for the release of the button since it must have been released for this function to return true when pressed again.

-

This function should only be used to test a single button.

-
source

pub fn just_released(&self, button: ButtonSet) -> bool

Check if a button has just been released.

-
Parameters
-
    -
  • button The button to test for. Only one button should be specified.
  • -
-
Returns
-

true if the specified button has just been released.

-

Return true if the given button was released between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.

-

There is no need to check for the released of the button since it must have been pressed for this function to return true when pressed again.

-

This function should only be used to test a single button.

-
source

pub fn not_pressed(&self, button: ButtonSet) -> bool

Test if the specified buttons are not pressed.

-
Parameters
-
    -
  • buttons A bit mask indicating which buttons to test. (Can be a single button)
  • -
-
Returns
-

True if all buttons in the provided mask are currently released.

-

Read the state of the buttons and return true if all the buttons in the specified mask are currently released.

-
source

pub fn next_frame(&self) -> bool

Indicate that it’s time to render the next frame.

-
Returns
-

true if it’s time for the next frame.

-

When this function returns true, the amount of time has elapsed to display the next frame, as specified by setFrameRate() or setFrameDuration().

-

This function will normally be called at the start of the rendering loop which would wait for true to be returned before rendering and displaying the next frame.

-
source

pub fn poll_buttons(&self)

Poll the buttons and track their state over time.

-

Read and save the current state of the buttons and also keep track of the button state when this function was previously called. These states are used by the justPressed() and justReleased() functions to determine if a button has changed state between now and the previous call to pollButtons().

-

This function should be called once at the start of each new frame.

-

The justPressed() and justReleased() functions rely on this function.

-
source

pub fn pressed(&self, button: ButtonSet) -> bool

Test if the all of the specified buttons are pressed.

-
Parameters
-
    -
  • buttons A bit mask indicating which buttons to test. (Can be a single button)
  • -
-
Returns
-

true if all buttons in the provided mask are currently pressed.

-

Read the state of the buttons and return true if all of the buttons in the specified mask are being pressed.

-
source

pub fn print(&self, x: impl Printable)

The Arduino Print class is available for writing text to the screen buffer.

-

For an Arduboy2 class object, functions provided by the Arduino Print class can be used to write text to the screen buffer, in the same manner as the Arduino Serial.print(), etc., functions.

-

Print will use the write() function to actually draw each character in the screen buffer, using the library’s font5x7 font. Two character values are handled specially:

-
    -
  • ASCII newline/line feed (\n, 0x0A, inverse white circle). This will move the text cursor position to the start of the next line, based on the current text size.
  • -
  • ASCII carriage return (\r, 0x0D, musical eighth note). This character will be ignored.
  • -
-

Example

- -
let value: i16 = 42;
-
-arduboy.print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the
-                                       // text cursor to the start of the next line
-arduboy.print(f!(b"Hello World\n")); // Prints "Hello World" but does not use the 2kb ram
-arduboy.print(value); // Prints "42"
-arduboy.print("\n\0"); // Sets the text cursor to the start of the next line
-arduboy.print("hello world") // Prints normal [&str]
-
source

pub fn set_cursor(&self, x: i16, y: i16)

Set the location of the text cursor.

-
Parameters
-
    -
  • -

    x The X (horizontal) coordinate, in pixels, for the new location of the text cursor.

    -
  • -
  • -

    y The Y (vertical) coordinate, in pixels, for the new location of the text cursor.

    -
  • -
-

The location of the text cursor is set the the specified coordinates. The coordinates are in pixels. Since the coordinates can specify any pixel location, the text does not have to be placed on specific rows. As with all drawing functions, location 0, 0 is the top left corner of the display. The cursor location represents the top left corner of the next character written.

-
source

pub fn set_frame_rate(&self, rate: u8)

Set the frame rate used by the frame control functions.

-
Parameters
-
    -
  • rate The desired frame rate in frames per second.
  • -
-

Normally, the frame rate would be set to the desired value once, at the start of the game, but it can be changed at any time to alter the frame update rate.

-
source

pub fn set_text_size(&self, size: u8)

Set the text character size.

-
Parameters
-
    -
  • s The text size multiplier. Must be 1 or higher.
  • -
-

Setting a text size of 1 will result in standard size characters with one pixel for each bit in the bitmap for a character. The value specified is a multiplier. A value of 2 will double the width and height. A value of 3 will triple the dimensions, etc.

-
source

pub fn audio_on(&self)

Turn sound on.

-

The system is configured to generate sound. This function sets the sound mode only until the unit is powered off.

-
source

pub fn audio_off(&self)

Turn sound off (mute).

-

The system is configured to not produce sound (mute). This function sets the sound mode only until the unit is powered off.

-
source

pub fn audio_save_on_off(&self)

Save the current sound state in EEPROM.

-

The current sound state, set by on() or off(), is saved to the reserved system area in EEPROM. This allows the state to carry over between power cycles and after uploading a different sketch.

-

Note -EEPROM is limited in the number of times it can be written to. Sketches should not continuously change and then save the state rapidly.

-
source

pub fn audio_toggle(&self)

Toggle the sound on/off state.

-

If the system is configured for sound on, it will be changed to sound off (mute). If sound is off, it will be changed to on. This function sets the sound mode only until the unit is powered off. To save the current mode use saveOnOff().

-
source

pub fn audio_on_and_save(&self)

Combines the use function of audio_on() and audio_save_on_off()

-
source

pub fn audio_enabled(&self) -> bool

Get the current sound state.

-
Returns
-

true if sound is currently enabled (not muted).

-

This function should be used by code that actually generates sound. If true is returned, sound can be produced. If false is returned, sound should be muted.

-
source

pub fn invert(&self, inverse: bool)

Invert the entire display or set it back to normal.

-
Parameters
-
    -
  • inverse true will invert the display. false will set the display to no-inverted.
  • -
-

Calling this function with a value of true will set the display to inverted mode. A pixel with a value of 0 will be on and a pixel set to 1 will be off.

-

Once in inverted mode, the display will remain this way until it is set back to non-inverted mode by calling this function with false.

-
source

pub fn collide_point(&self, point: Point, rect: Rect) -> bool

Test if a point falls within a rectangle.

-

Parameters

-
    -
  • point A structure describing the location of the point.
  • -
  • rect A structure describing the location and size of the rectangle.
  • -
-

Returns -true if the specified point is within the specified rectangle.

-

This function is intended to detemine if an object, whose boundaries are defined by the given rectangle, is in contact with the given point.

-
source

pub fn collide_rect(&self, rect1: Rect, rect2: Rect) -> bool

Test if a rectangle is intersecting with another rectangle.

-

Parameters

-
    -
  • rect1,rect2 Structures describing the size and locations of the rectangles.
  • -
-

Returns -true if the first rectangle is intersecting the second.

-

This function is intended to detemine if an object, whose boundaries are defined by the given rectangle, is in contact with another rectangular object.

-
source

pub fn digital_write_rgb_single(&self, color: u8, val: u8)

Set one of the RGB LEDs digitally, to either fully on or fully off.

-

Parameters

-
    -
  • color The name of the LED to set. The value given should be one of RED_LED, GREEN_LED or BLUE_LED.
  • -
  • val Indicates whether to turn the specified LED on or off. The value given should be RGB_ON or RGB_OFF.
  • -
-

This 2 parameter version of the function will set a single LED within the RGB LED either fully on or fully off. See the description of the 3 parameter version of this function for more details on the RGB LED.

-
source

pub fn digital_write_rgb(&self, red: u8, green: u8, blue: u8)

Set the RGB LEDs digitally, to either fully on or fully off.

-

Parameters

-
    -
  • red,green,blue Use value RGB_ON or RGB_OFF to set each LED.
  • -
-

The RGB LED is actually individual red, green and blue LEDs placed very close together in a single package. This 3 parameter version of the function will set each LED either on or off, to set the RGB LED to 7 different colors at their highest brightness or turn it off.

-
 The colors are as follows:
- RED LED    GREEN LED    BLUE LED    COLOR
- RGB_OFF    RGB_OFF      RGB_OFF     OFF
- RGB_OFF    RGB_OFF      RGB_ON      Blue
- RGB_OFF    RGB_ON       RGB_OFF     Green
- RGB_OFF    RGB_ON       RGB_ON      Cyan
- RGB_ON     RGB_OFF      RGB_OFF     Red
- RGB_ON     RGB_OFF      RGB_ON      Magenta
- RGB_ON     RGB_ON       RGB_OFF     Yellow
- RGB_ON     RGB_ON       RGB_ON      White
-
source

pub fn set_rgb_led_single(&self, color: u8, val: u8)

Set the brightness of one of the RGB LEDs without affecting the others.

-

Parameters

-
    -
  • color The name of the LED to set. The value given should be one of RED_LED, GREEN_LED or BLUE_LED.
  • -
  • val The brightness value for the LED, from 0 to 255.
  • -
-

Note

-
-

In order to use this function, the 3 parameter version must first be called at least once, in order to initialize the hardware.

-
-

This 2 parameter version of the function will set the brightness of a single LED within the RGB LED without affecting the current brightness of the other two. See the description of the 3 parameter version of this function for more details on the RGB LED.

-
source

pub fn set_rgb_led(&self, red: u8, green: u8, blue: u8)

Set the light output of the RGB LED.

-

Parameters

-
    -
  • red,green,blue The brightness value for each LED.
  • -
-

The RGB LED is actually individual red, green and blue LEDs placed very close together in a single package. By setting the brightness of each LED, the RGB LED can show various colors and intensities. The brightness of each LED can be set to a value from 0 (fully off) to 255 (fully on).

-

Note

-
-

Certain libraries that take control of the hardware timers may interfere with the ability of this function to properly control the RGB LED. ArduboyPlaytune is one such library known to do this. The digital_write_rgb() function will still work properly in this case.

-
-

Note

-
-

Many of the Kickstarter Arduboys were accidentally shipped with the RGB LED installed incorrectly. For these units, the green LED cannot be lit. As long as the green led is set to off, setting the red LED will actually control the blue LED and setting the blue LED will actually control the red LED. If the green LED is turned fully on, none of the LEDs will light.

-
-
source

pub fn every_x_frames(&self, frames: u8) -> bool

Indicate if the specified number of frames has elapsed.

-

Parameters

-
    -
  • frames The desired number of elapsed frames.
  • -
-

Returns -true if the specified number of frames has elapsed.

-

This function should be called with the same value each time for a given event. It will return true if the given number of frames has elapsed since the previous frame in which it returned true.

-
Example
-

If you wanted to fire a shot every 5 frames while the A button is being held down:

- -
if arduboy.everyXFrames(5) {
-    if arduboy.pressed(A_BUTTON) {
-        fireShot();
-    }
-}
-
source

pub fn flip_vertical(&self, flipped: bool)

Flip the display vertically or set it back to normal.

-

Parameters

-
    -
  • flipped true will set vertical flip mode. false will set normal vertical orientation.
  • -
-

Calling this function with a value of true will cause the Y coordinate to start at the bottom edge of the display instead of the top, effectively flipping the display vertically.

-

Once in vertical flip mode, it will remain this way until normal vertical mode is set by calling this function with a value of false.

-
source

pub fn flip_horizontal(&self, flipped: bool)

Flip the display horizontally or set it back to normal.

-

Parameters

-
    -
  • flipped true will set horizontal flip mode. false will set normal horizontal orientation.
  • -
-

Calling this function with a value of true will cause the X coordinate to start at the left edge of the display instead of the right, effectively flipping the display horizontally.

-

Once in horizontal flip mode, it will remain this way until normal horizontal mode is set by calling this function with a value of false.

-
source

pub fn set_text_color(&self, color: Color)

Set the text foreground color.

-

Parameters

-
    -
  • color The color to be used for following text. The values WHITE or BLACK should be used.
  • -
-
source

pub fn set_text_background_color(&self, color: Color)

Set the text background color.

-

Parameters

-
    -
  • color The background color to be used for following text. The values WHITE or BLACK should be used.
  • -
-

The background pixels of following characters will be set to the specified color.

-

However, if the background color is set to be the same as the text color, the background will be transparent. Only the foreground pixels will be drawn. The background pixels will remain as they were before the character was drawn.

-
source

pub fn set_cursor_x(&self, x: i16)

Set the X coordinate of the text cursor location.

-

Parameters

-
    -
  • x The X (horizontal) coordinate, in pixels, for the new location of the text cursor.
  • -
-

The X coordinate for the location of the text cursor is set to the specified value, leaving the Y coordinate unchanged. For more details about the text cursor, see the setCursor() function.

-
source

pub fn set_cursor_y(&self, y: i16)

Set the Y coordinate of the text cursor location.

-

Parameters

-
    -
  • y The Y (vertical) coordinate, in pixels, for the new location of the text cursor.
  • -
-

The Y coordinate for the location of the text cursor is set to the specified value, leaving the X coordinate unchanged. For more details about the text cursor, see the setCursor() function.

-
source

pub fn set_text_wrap(&self, w: bool)

Set or disable text wrap mode.

-

Parameters

-
    -
  • w true enables text wrap mode. false disables it.
  • -
-

Text wrap mode is enabled by specifying true. In wrap mode, if a character to be drawn would end up partially or fully past the right edge of the screen (based on the current text size), it will be placed at the start of the next line. The text cursor will be adjusted accordingly.

-

If wrap mode is disabled, characters will always be written at the current text cursor position. A character near the right edge of the screen may only be partially displayed and characters drawn at a position past the right edge of the screen will remain off screen.

-
source

pub fn idle(&self)

Idle the CPU to save power.

-

This puts the CPU in idle sleep mode. You should call this as often as you can for the best power savings. The timer 0 overflow interrupt will wake up the chip every 1ms, so even at 60 FPS a well written app should be able to sleep maybe half the time in between rendering it’s own frames.

-

Auto Trait Implementations§

§

impl RefUnwindSafe for Arduboy2

§

impl Send for Arduboy2

§

impl Sync for Arduboy2

§

impl Unpin for Arduboy2

§

impl UnwindSafe for Arduboy2

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/struct.ArduboyTones.html b/docs/doc/arduboy_rust/struct.ArduboyTones.html deleted file mode 100644 index d7f5fff..0000000 --- a/docs/doc/arduboy_rust/struct.ArduboyTones.html +++ /dev/null @@ -1,94 +0,0 @@ -ArduboyTones in arduboy_rust - Rust
pub struct ArduboyTones {}
Expand description

This is the struct to interact in a save way with the ArduboyTones C++ library.

-

You will need to uncomment the ArduboyTones_Library in the import_config.h file.

-

Implementations§

source§

impl ArduboyTones

source

pub const fn new() -> ArduboyTones

Get a new instance of ArduboyTones

-
Example
-
const sound: ArduboyTones = ArduboyTones::new();
-
source

pub fn tone(&self, frequency: u16, duration: u32)

Play a single tone.

-
    -
  • freq The frequency of the tone, in hertz.
  • -
  • dur The duration to play the tone for, in 1024ths of a -second (very close to milliseconds). A duration of 0, or if not provided, -means play forever, or until noTone() is called or a new tone or -sequence is started.
  • -
-
source

pub fn tone2( - &self, - frequency1: u16, - duration1: u32, - frequency2: u16, - duration2: u32 -)

Play two tones in sequence.

-
    -
  • freq1,freq2 The frequency of the tone in hertz.
  • -
  • dur1,dur2 The duration to play the tone for, in 1024ths of a -second (very close to milliseconds).
  • -
-
source

pub fn tone3( - &self, - frequency1: u16, - duration1: u32, - frequency2: u16, - duration2: u32, - frequency3: u16, - duration3: u32 -)

Play three tones in sequence.

-
    -
  • freq1,freq2,freq3 The frequency of the tone, in hertz.
  • -
  • dur1,dur2,dur3 The duration to play the tone for, in 1024ths of a -second (very close to milliseconds).
  • -
-
source

pub fn tones(&self, tones: *const u16)

Play a tone sequence from frequency/duration pairs in a PROGMEM array.

-
    -
  • tones A pointer to an array of frequency/duration pairs.
  • -
-

The array must be placed in code space using PROGMEM.

-

See the tone() function for details on the frequency and duration values. -A frequency of 0 for any tone means silence (a musical rest).

-

The last element of the array must be TONES_END or TONES_REPEAT.

-

Example:

- -
progmem!(
-    static sound1:[u8;_]=[220,1000, 0,250, 440,500, 880,2000,TONES_END]
-);
-
-tones(get_tones_addr!(sound1));
-
source

pub fn no_tone(&self)

Stop playing the tone or sequence.

-

If a tone or sequence is playing, it will stop. If nothing -is playing, this function will do nothing.

-
source

pub fn playing(&self) -> bool

Check if a tone or tone sequence is playing.

-
    -
  • return boolean true if playing (even if sound is muted).
  • -
-
source

pub fn tones_in_ram(&self, tones: *mut u32)

Play a tone sequence from frequency/duration pairs in an array in RAM.

-
    -
  • tones A pointer to an array of frequency/duration pairs.
  • -
-

The array must be located in RAM.

-

See the tone() function for details on the frequency and duration values. -A frequency of 0 for any tone means silence (a musical rest).

-

The last element of the array must be TONES_END or TONES_REPEAT.

-

Example:

- -
let sound2: [u16; 9] = [220, 1000, 0, 250, 440, 500, 880, 2000, TONES_END];
-

Using tones(), with the data in PROGMEM, is normally a better -choice. The only reason to use tonesInRAM() would be if dynamically -altering the contents of the array is required.

-
source

pub fn volume_mode(&self, mode: u8)

Set the volume to always normal, always high, or tone controlled.

-

One of the following values should be used:

-
    -
  • VOLUME_IN_TONE The volume of each tone will be specified in the tone -itself.
  • -
  • VOLUME_ALWAYS_NORMAL All tones will play at the normal volume level.
  • -
  • VOLUME_ALWAYS_HIGH All tones will play at the high volume level.
  • -
-

Auto Trait Implementations§

§

impl RefUnwindSafe for ArduboyTones

§

impl Send for ArduboyTones

§

impl Sync for ArduboyTones

§

impl Unpin for ArduboyTones

§

impl UnwindSafe for ArduboyTones

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/struct.EEPROM.html b/docs/doc/arduboy_rust/struct.EEPROM.html deleted file mode 100644 index 45f53da..0000000 --- a/docs/doc/arduboy_rust/struct.EEPROM.html +++ /dev/null @@ -1,25 +0,0 @@ -EEPROM in arduboy_rust - Rust

Struct arduboy_rust::EEPROM

source ·
pub struct EEPROM { /* private fields */ }
Expand description

This is the struct to store and read structs objects to/from eeprom memory.

-

Example

-
static e: EEPROM = EEPROM::new(10);
-struct Scorebord {
-    player1: u16,
-    text: &'static str,
-}
-static mut s: Scorebord = Scorebord {
-    player1: 0,
-    text: "lol\0",
-};
-
-// init inside of the setup function
-e.init(&mut s);
-

Implementations§

source§

impl EEPROM

source

pub const fn new(idx: i16) -> EEPROM

source

pub fn init<T>(&self, your_struct: &mut T)

source

pub fn get<T>(&self, your_struct: &mut T)

source

pub fn get_direct<T>(&self) -> T

source

pub fn put<T>(&self, your_struct: &T)

Auto Trait Implementations§

§

impl RefUnwindSafe for EEPROM

§

impl Send for EEPROM

§

impl Sync for EEPROM

§

impl Unpin for EEPROM

§

impl UnwindSafe for EEPROM

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/struct.EEPROMBYTE.html b/docs/doc/arduboy_rust/struct.EEPROMBYTE.html deleted file mode 100644 index 19cd2a3..0000000 --- a/docs/doc/arduboy_rust/struct.EEPROMBYTE.html +++ /dev/null @@ -1,12 +0,0 @@ -EEPROMBYTE in arduboy_rust - Rust
pub struct EEPROMBYTE { /* private fields */ }
Expand description

Use this struct to store and read single bytes to/from eeprom memory.

-

Implementations§

source§

impl EEPROMBYTE

source

pub const fn new(idx: i16) -> EEPROMBYTE

source

pub fn init(&self)

source

pub fn read(&self) -> u8

source

pub fn update(&self, val: u8)

source

pub fn write(&self, val: u8)

Auto Trait Implementations§

§

impl RefUnwindSafe for EEPROMBYTE

§

impl Send for EEPROMBYTE

§

impl Sync for EEPROMBYTE

§

impl Unpin for EEPROMBYTE

§

impl UnwindSafe for EEPROMBYTE

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/atomic_polyfill/all.html b/docs/doc/atomic_polyfill/all.html deleted file mode 100644 index 1a55347..0000000 --- a/docs/doc/atomic_polyfill/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/docs/doc/atomic_polyfill/constant.ATOMIC_BOOL_INIT.html b/docs/doc/atomic_polyfill/constant.ATOMIC_BOOL_INIT.html deleted file mode 100644 index 1245560..0000000 --- a/docs/doc/atomic_polyfill/constant.ATOMIC_BOOL_INIT.html +++ /dev/null @@ -1,2 +0,0 @@ -ATOMIC_BOOL_INIT in atomic_polyfill - Rust

Constant atomic_polyfill::ATOMIC_BOOL_INIT

1.0.0 ·
pub const ATOMIC_BOOL_INIT: AtomicBool;
👎Deprecated since 1.34.0: the new function is now preferred
Expand description

An AtomicBool initialized to false.

-
\ No newline at end of file diff --git a/docs/doc/atomic_polyfill/enum.Ordering.html b/docs/doc/atomic_polyfill/enum.Ordering.html deleted file mode 100644 index 7dcdf68..0000000 --- a/docs/doc/atomic_polyfill/enum.Ordering.html +++ /dev/null @@ -1,60 +0,0 @@ -Ordering in atomic_polyfill - Rust

Enum atomic_polyfill::Ordering

1.0.0 ·
pub enum Ordering {
-    Relaxed,
-    Release,
-    Acquire,
-    AcqRel,
-    SeqCst,
-}
Expand description

Atomic memory orderings

-

Memory orderings specify the way atomic operations synchronize memory. -In its weakest Ordering::Relaxed, only the memory directly touched by the -operation is synchronized. On the other hand, a store-load pair of Ordering::SeqCst -operations synchronize other memory while additionally preserving a total order of such -operations across all threads.

-

Rust’s memory orderings are the same as those of -C++20.

-

For more information see the nomicon.

-

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Relaxed

No ordering constraints, only atomic operations.

-

Corresponds to memory_order_relaxed in C++20.

-
§

Release

When coupled with a store, all previous operations become ordered -before any load of this value with Acquire (or stronger) ordering. -In particular, all previous writes become visible to all threads -that perform an Acquire (or stronger) load of this value.

-

Notice that using this ordering for an operation that combines loads -and stores leads to a Relaxed load operation!

-

This ordering is only applicable for operations that can perform a store.

-

Corresponds to memory_order_release in C++20.

-
§

Acquire

When coupled with a load, if the loaded value was written by a store operation with -Release (or stronger) ordering, then all subsequent operations -become ordered after that store. In particular, all subsequent loads will see data -written before the store.

-

Notice that using this ordering for an operation that combines loads -and stores leads to a Relaxed store operation!

-

This ordering is only applicable for operations that can perform a load.

-

Corresponds to memory_order_acquire in C++20.

-
§

AcqRel

Has the effects of both Acquire and Release together: -For loads it uses Acquire ordering. For stores it uses the Release ordering.

-

Notice that in the case of compare_and_swap, it is possible that the operation ends up -not performing any store and hence it has just Acquire ordering. However, -AcqRel will never perform Relaxed accesses.

-

This ordering is only applicable for operations that combine both loads and stores.

-

Corresponds to memory_order_acq_rel in C++20.

-
§

SeqCst

Like Acquire/Release/AcqRel (for load, store, and load-with-store -operations, respectively) with the additional guarantee that all threads see all -sequentially consistent operations in the same order.

-

Corresponds to memory_order_seq_cst in C++20.

-

Trait Implementations§

§

impl Clone for Ordering

§

fn clone(&self) -> Ordering

Returns a copy of the value. Read more
§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Ordering

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Hash for Ordering

§

fn hash<__H>(&self, state: &mut __H)where - __H: Hasher,

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
§

impl PartialEq<Ordering> for Ordering

§

fn eq(&self, other: &Ordering) -> bool

This method tests for self and other values to be equal, and is used -by ==.
§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl Copy for Ordering

§

impl Eq for Ordering

§

impl StructuralEq for Ordering

§

impl StructuralPartialEq for Ordering

Auto Trait Implementations§

§

impl RefUnwindSafe for Ordering

§

impl Send for Ordering

§

impl Sync for Ordering

§

impl Unpin for Ordering

§

impl UnwindSafe for Ordering

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/atomic_polyfill/fn.compiler_fence.html b/docs/doc/atomic_polyfill/fn.compiler_fence.html deleted file mode 100644 index c12406f..0000000 --- a/docs/doc/atomic_polyfill/fn.compiler_fence.html +++ /dev/null @@ -1,57 +0,0 @@ -compiler_fence in atomic_polyfill - Rust

Function atomic_polyfill::compiler_fence

1.21.0 ·
pub fn compiler_fence(order: Ordering)
Expand description

A compiler memory fence.

-

compiler_fence does not emit any machine code, but restricts the kinds -of memory re-ordering the compiler is allowed to do. Specifically, depending on -the given Ordering semantics, the compiler may be disallowed from moving reads -or writes from before or after the call to the other side of the call to -compiler_fence. Note that it does not prevent the hardware -from doing such re-ordering. This is not a problem in a single-threaded, -execution context, but when other threads may modify memory at the same -time, stronger synchronization primitives such as fence are required.

-

The re-ordering prevented by the different ordering semantics are:

-
    -
  • with SeqCst, no re-ordering of reads and writes across this point is allowed.
  • -
  • with Release, preceding reads and writes cannot be moved past subsequent writes.
  • -
  • with Acquire, subsequent reads and writes cannot be moved ahead of preceding reads.
  • -
  • with AcqRel, both of the above rules are enforced.
  • -
-

compiler_fence is generally only useful for preventing a thread from -racing with itself. That is, if a given thread is executing one piece -of code, and is then interrupted, and starts executing code elsewhere -(while still in the same thread, and conceptually still on the same -core). In traditional programs, this can only occur when a signal -handler is registered. In more low-level code, such situations can also -arise when handling interrupts, when implementing green threads with -pre-emption, etc. Curious readers are encouraged to read the Linux kernel’s -discussion of memory barriers.

-

Panics

-

Panics if order is Relaxed.

-

Examples

-

Without compiler_fence, the assert_eq! in following code -is not guaranteed to succeed, despite everything happening in a single thread. -To see why, remember that the compiler is free to swap the stores to -IMPORTANT_VARIABLE and IS_READY since they are both -Ordering::Relaxed. If it does, and the signal handler is invoked right -after IS_READY is updated, then the signal handler will see -IS_READY=1, but IMPORTANT_VARIABLE=0. -Using a compiler_fence remedies this situation.

- -
use std::sync::atomic::{AtomicBool, AtomicUsize};
-use std::sync::atomic::Ordering;
-use std::sync::atomic::compiler_fence;
-
-static IMPORTANT_VARIABLE: AtomicUsize = AtomicUsize::new(0);
-static IS_READY: AtomicBool = AtomicBool::new(false);
-
-fn main() {
-    IMPORTANT_VARIABLE.store(42, Ordering::Relaxed);
-    // prevent earlier writes from being moved beyond this point
-    compiler_fence(Ordering::Release);
-    IS_READY.store(true, Ordering::Relaxed);
-}
-
-fn signal_handler() {
-    if IS_READY.load(Ordering::Relaxed) {
-        assert_eq!(IMPORTANT_VARIABLE.load(Ordering::Relaxed), 42);
-    }
-}
-
\ No newline at end of file diff --git a/docs/doc/atomic_polyfill/fn.fence.html b/docs/doc/atomic_polyfill/fn.fence.html deleted file mode 100644 index a018684..0000000 --- a/docs/doc/atomic_polyfill/fn.fence.html +++ /dev/null @@ -1,62 +0,0 @@ -fence in atomic_polyfill - Rust

Function atomic_polyfill::fence

1.0.0 ·
pub fn fence(order: Ordering)
Expand description

An atomic fence.

-

Depending on the specified order, a fence prevents the compiler and CPU from -reordering certain types of memory operations around it. -That creates synchronizes-with relationships between it and atomic operations -or fences in other threads.

-

A fence ‘A’ which has (at least) Release ordering semantics, synchronizes -with a fence ‘B’ with (at least) Acquire semantics, if and only if there -exist operations X and Y, both operating on some atomic object ‘M’ such -that A is sequenced before X, Y is sequenced before B and Y observes -the change to M. This provides a happens-before dependence between A and B.

-
    Thread 1                                          Thread 2
-
-fence(Release);      A --------------
-x.store(3, Relaxed); X ---------    |
-                               |    |
-                               |    |
-                               -------------> Y  if x.load(Relaxed) == 3 {
-                                    |-------> B      fence(Acquire);
-                                                     ...
-                                                 }
-
-

Atomic operations with Release or Acquire semantics can also synchronize -with a fence.

-

A fence which has SeqCst ordering, in addition to having both Acquire -and Release semantics, participates in the global program order of the -other SeqCst operations and/or fences.

-

Accepts Acquire, Release, AcqRel and SeqCst orderings.

-

Panics

-

Panics if order is Relaxed.

-

Examples

-
use std::sync::atomic::AtomicBool;
-use std::sync::atomic::fence;
-use std::sync::atomic::Ordering;
-
-// A mutual exclusion primitive based on spinlock.
-pub struct Mutex {
-    flag: AtomicBool,
-}
-
-impl Mutex {
-    pub fn new() -> Mutex {
-        Mutex {
-            flag: AtomicBool::new(false),
-        }
-    }
-
-    pub fn lock(&self) {
-        // Wait until the old value is `false`.
-        while self
-            .flag
-            .compare_exchange_weak(false, true, Ordering::Relaxed, Ordering::Relaxed)
-            .is_err()
-        {}
-        // This fence synchronizes-with store in `unlock`.
-        fence(Ordering::Acquire);
-    }
-
-    pub fn unlock(&self) {
-        self.flag.store(false, Ordering::Release);
-    }
-}
-
\ No newline at end of file diff --git a/docs/doc/atomic_polyfill/fn.spin_loop_hint.html b/docs/doc/atomic_polyfill/fn.spin_loop_hint.html deleted file mode 100644 index 4d8cd44..0000000 --- a/docs/doc/atomic_polyfill/fn.spin_loop_hint.html +++ /dev/null @@ -1,3 +0,0 @@ -spin_loop_hint in atomic_polyfill - Rust

Function atomic_polyfill::spin_loop_hint

1.24.0 ·
pub fn spin_loop_hint()
👎Deprecated since 1.51.0: use hint::spin_loop instead
Expand description

Signals the processor that it is inside a busy-wait spin-loop (“spin lock”).

-

This function is deprecated in favor of hint::spin_loop.

-
\ No newline at end of file diff --git a/docs/doc/atomic_polyfill/index.html b/docs/doc/atomic_polyfill/index.html deleted file mode 100644 index b7fce95..0000000 --- a/docs/doc/atomic_polyfill/index.html +++ /dev/null @@ -1 +0,0 @@ -atomic_polyfill - Rust

Crate atomic_polyfill

source ·

Structs

  • A boolean type which can be safely shared between threads.
  • An integer type which can be safely shared between threads.
  • An integer type which can be safely shared between threads.

Enums

Constants

Functions

\ No newline at end of file diff --git a/docs/doc/atomic_polyfill/sidebar-items.js b/docs/doc/atomic_polyfill/sidebar-items.js deleted file mode 100644 index 4cf0f31..0000000 --- a/docs/doc/atomic_polyfill/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"constant":["ATOMIC_BOOL_INIT"],"enum":["Ordering"],"fn":["compiler_fence","fence","spin_loop_hint"],"struct":["AtomicBool","AtomicI8","AtomicU8"]}; \ No newline at end of file diff --git a/docs/doc/atomic_polyfill/struct.AtomicBool.html b/docs/doc/atomic_polyfill/struct.AtomicBool.html deleted file mode 100644 index c869006..0000000 --- a/docs/doc/atomic_polyfill/struct.AtomicBool.html +++ /dev/null @@ -1,163 +0,0 @@ -AtomicBool in atomic_polyfill - Rust

Struct atomic_polyfill::AtomicBool

1.0.0 ·
#[repr(C, align(1))]
pub struct AtomicBool { /* private fields */ }
Expand description

A boolean type which can be safely shared between threads.

-

This type has the same in-memory representation as a [bool].

-

Note: This type is only available on platforms that support atomic -loads and stores of u8.

-

Implementations§

§

impl AtomicBool

const: 1.24.0

pub const fn new(v: bool) -> AtomicBool

Creates a new AtomicBool.

-
Examples
-
use std::sync::atomic::AtomicBool;
-
-let atomic_true = AtomicBool::new(true);
-let atomic_false = AtomicBool::new(false);
-
const: unstable

pub unsafe fn from_ptr<'a>(ptr: *mut bool) -> &'a AtomicBool

🔬This is a nightly-only experimental API. (atomic_from_ptr)

Creates a new AtomicBool from a pointer.

-
Examples
-
#![feature(atomic_from_ptr, pointer_is_aligned)]
-use std::sync::atomic::{self, AtomicBool};
-use std::mem::align_of;
-
-// Get a pointer to an allocated value
-let ptr: *mut bool = Box::into_raw(Box::new(false));
-
-assert!(ptr.is_aligned_to(align_of::<AtomicBool>()));
-
-{
-    // Create an atomic view of the allocated value
-    let atomic = unsafe { AtomicBool::from_ptr(ptr) };
-
-    // Use `atomic` for atomic operations, possibly share it with other threads
-    atomic.store(true, atomic::Ordering::Relaxed);
-}
-
-// It's ok to non-atomically access the value behind `ptr`,
-// since the reference to the atomic ended its lifetime in the block above
-assert_eq!(unsafe { *ptr }, true);
-
-// Deallocate the value
-unsafe { drop(Box::from_raw(ptr)) }
-
Safety
-
    -
  • ptr must be aligned to align_of::<AtomicBool>() (note that on some platforms this can be bigger than align_of::<bool>()).
  • -
  • ptr must be valid for both reads and writes for the whole lifetime 'a.
  • -
  • The value behind ptr must not be accessed through non-atomic operations for the whole lifetime 'a.
  • -
-
1.15.0

pub fn get_mut(&mut self) -> &mut bool

Returns a mutable reference to the underlying [bool].

-

This is safe because the mutable reference guarantees that no other threads are -concurrently accessing the atomic data.

-
Examples
-
use std::sync::atomic::{AtomicBool, Ordering};
-
-let mut some_bool = AtomicBool::new(true);
-assert_eq!(*some_bool.get_mut(), true);
-*some_bool.get_mut() = false;
-assert_eq!(some_bool.load(Ordering::SeqCst), false);
-

pub fn from_mut(v: &mut bool) -> &mut AtomicBool

🔬This is a nightly-only experimental API. (atomic_from_mut)

Get atomic access to a &mut bool.

-
Examples
-
#![feature(atomic_from_mut)]
-use std::sync::atomic::{AtomicBool, Ordering};
-
-let mut some_bool = true;
-let a = AtomicBool::from_mut(&mut some_bool);
-a.store(false, Ordering::Relaxed);
-assert_eq!(some_bool, false);
-

pub fn get_mut_slice(this: &mut [AtomicBool]) -> &mut [bool]

🔬This is a nightly-only experimental API. (atomic_from_mut)

Get non-atomic access to a &mut [AtomicBool] slice.

-

This is safe because the mutable reference guarantees that no other threads are -concurrently accessing the atomic data.

-
Examples
-
#![feature(atomic_from_mut, inline_const)]
-use std::sync::atomic::{AtomicBool, Ordering};
-
-let mut some_bools = [const { AtomicBool::new(false) }; 10];
-
-let view: &mut [bool] = AtomicBool::get_mut_slice(&mut some_bools);
-assert_eq!(view, [false; 10]);
-view[..5].copy_from_slice(&[true; 5]);
-
-std::thread::scope(|s| {
-    for t in &some_bools[..5] {
-        s.spawn(move || assert_eq!(t.load(Ordering::Relaxed), true));
-    }
-
-    for f in &some_bools[5..] {
-        s.spawn(move || assert_eq!(f.load(Ordering::Relaxed), false));
-    }
-});
-

pub fn from_mut_slice(v: &mut [bool]) -> &mut [AtomicBool]

🔬This is a nightly-only experimental API. (atomic_from_mut)

Get atomic access to a &mut [bool] slice.

-
Examples
-
#![feature(atomic_from_mut)]
-use std::sync::atomic::{AtomicBool, Ordering};
-
-let mut some_bools = [false; 10];
-let a = &*AtomicBool::from_mut_slice(&mut some_bools);
-std::thread::scope(|s| {
-    for i in 0..a.len() {
-        s.spawn(move || a[i].store(true, Ordering::Relaxed));
-    }
-});
-assert_eq!(some_bools, [true; 10]);
-
1.15.0 (const: unstable)

pub fn into_inner(self) -> bool

Consumes the atomic and returns the contained value.

-

This is safe because passing self by value guarantees that no other threads are -concurrently accessing the atomic data.

-
Examples
-
use std::sync::atomic::AtomicBool;
-
-let some_bool = AtomicBool::new(true);
-assert_eq!(some_bool.into_inner(), true);
-

pub fn load(&self, order: Ordering) -> bool

Loads a value from the bool.

-

load takes an Ordering argument which describes the memory ordering -of this operation. Possible values are SeqCst, Acquire and Relaxed.

-
Panics
-

Panics if order is Release or AcqRel.

-
Examples
-
use std::sync::atomic::{AtomicBool, Ordering};
-
-let some_bool = AtomicBool::new(true);
-
-assert_eq!(some_bool.load(Ordering::Relaxed), true);
-

pub fn store(&self, val: bool, order: Ordering)

Stores a value into the bool.

-

store takes an Ordering argument which describes the memory ordering -of this operation. Possible values are SeqCst, Release and Relaxed.

-
Panics
-

Panics if order is Acquire or AcqRel.

-
Examples
-
use std::sync::atomic::{AtomicBool, Ordering};
-
-let some_bool = AtomicBool::new(true);
-
-some_bool.store(false, Ordering::Relaxed);
-assert_eq!(some_bool.load(Ordering::Relaxed), false);
-
1.70.0 (const: 1.70.0)

pub const fn as_ptr(&self) -> *mut bool

Returns a mutable pointer to the underlying [bool].

-

Doing non-atomic reads and writes on the resulting integer can be a data race. -This method is mostly useful for FFI, where the function signature may use -*mut bool instead of &AtomicBool.

-

Returning an *mut pointer from a shared reference to this atomic is safe because the -atomic types work with interior mutability. All modifications of an atomic change the value -through a shared reference, and can do so safely as long as they use atomic operations. Any -use of the returned raw pointer requires an unsafe block and still has to uphold the same -restriction: operations on it must be atomic.

-
Examples
-
use std::sync::atomic::AtomicBool;
-
-extern "C" {
-    fn my_atomic_op(arg: *mut bool);
-}
-
-let mut atomic = AtomicBool::new(true);
-unsafe {
-    my_atomic_op(atomic.as_ptr());
-}
-

Trait Implementations§

1.3.0§

impl Debug for AtomicBool

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for AtomicBool

§

fn default() -> AtomicBool

Creates an AtomicBool initialized to false.

-
1.24.0§

impl From<bool> for AtomicBool

§

fn from(b: bool) -> AtomicBool

Converts a bool into an AtomicBool.

-
Examples
-
use std::sync::atomic::AtomicBool;
-let atomic_bool = AtomicBool::from(true);
-assert_eq!(format!("{atomic_bool:?}"), "true")
-
1.14.0§

impl RefUnwindSafe for AtomicBool

§

impl Sync for AtomicBool

Auto Trait Implementations§

§

impl Send for AtomicBool

§

impl Unpin for AtomicBool

§

impl UnwindSafe for AtomicBool

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/atomic_polyfill/struct.AtomicI8.html b/docs/doc/atomic_polyfill/struct.AtomicI8.html deleted file mode 100644 index d1fb4ef..0000000 --- a/docs/doc/atomic_polyfill/struct.AtomicI8.html +++ /dev/null @@ -1,167 +0,0 @@ -AtomicI8 in atomic_polyfill - Rust

Struct atomic_polyfill::AtomicI8

1.34.0 ·
#[repr(C, align(1))]
pub struct AtomicI8 { /* private fields */ }
Expand description

An integer type which can be safely shared between threads.

-

This type has the same in-memory representation as the underlying -integer type, [i8]. For more about the differences between atomic types and -non-atomic types as well as information about the portability of -this type, please see the module-level documentation.

-

Note: This type is only available on platforms that support -atomic loads and stores of [i8].

-

Implementations§

§

impl AtomicI8

const: 1.34.0

pub const fn new(v: i8) -> AtomicI8

Creates a new atomic integer.

-
Examples
-
use std::sync::atomic::AtomicI8;
-
-let atomic_forty_two = AtomicI8::new(42);
-
const: unstable

pub unsafe fn from_ptr<'a>(ptr: *mut i8) -> &'a AtomicI8

🔬This is a nightly-only experimental API. (atomic_from_ptr)

Creates a new reference to an atomic integer from a pointer.

-
Examples
-
#![feature(atomic_from_ptr, pointer_is_aligned)]
-use std::sync::atomic::{self, AtomicI8};
-use std::mem::align_of;
-
-// Get a pointer to an allocated value
-let ptr: *mut i8 = Box::into_raw(Box::new(0));
-
-assert!(ptr.is_aligned_to(align_of::<AtomicI8>()));
-
-{
-    // Create an atomic view of the allocated value
-    let atomic = unsafe {AtomicI8::from_ptr(ptr) };
-
-    // Use `atomic` for atomic operations, possibly share it with other threads
-    atomic.store(1, atomic::Ordering::Relaxed);
-}
-
-// It's ok to non-atomically access the value behind `ptr`,
-// since the reference to the atomic ended its lifetime in the block above
-assert_eq!(unsafe { *ptr }, 1);
-
-// Deallocate the value
-unsafe { drop(Box::from_raw(ptr)) }
-
Safety
-
    -
  • ptr must be aligned to align_of::<AtomicBool>() (note that on some platforms this can be bigger than align_of::<bool>()).
  • -
  • ptr must be aligned to align_of::<AtomicI8>() (note that on some platforms this can be bigger than align_of::<i8>()).
  • -
  • ptr must be valid for both reads and writes for the whole lifetime 'a.
  • -
  • The value behind ptr must not be accessed through non-atomic operations for the whole lifetime 'a.
  • -
-

pub fn get_mut(&mut self) -> &mut i8

Returns a mutable reference to the underlying integer.

-

This is safe because the mutable reference guarantees that no other threads are -concurrently accessing the atomic data.

-
Examples
-
use std::sync::atomic::{AtomicI8, Ordering};
-
-let mut some_var = AtomicI8::new(10);
-assert_eq!(*some_var.get_mut(), 10);
-*some_var.get_mut() = 5;
-assert_eq!(some_var.load(Ordering::SeqCst), 5);
-

pub fn from_mut(v: &mut i8) -> &mut AtomicI8

🔬This is a nightly-only experimental API. (atomic_from_mut)

Get atomic access to a &mut i8.

-
Examples
-
#![feature(atomic_from_mut)]
-use std::sync::atomic::{AtomicI8, Ordering};
-
-let mut some_int = 123;
-let a = AtomicI8::from_mut(&mut some_int);
-a.store(100, Ordering::Relaxed);
-assert_eq!(some_int, 100);
-

pub fn get_mut_slice(this: &mut [AtomicI8]) -> &mut [i8]

🔬This is a nightly-only experimental API. (atomic_from_mut)

Get non-atomic access to a &mut [AtomicI8] slice

-

This is safe because the mutable reference guarantees that no other threads are -concurrently accessing the atomic data.

-
Examples
-
#![feature(atomic_from_mut, inline_const)]
-use std::sync::atomic::{AtomicI8, Ordering};
-
-let mut some_ints = [const { AtomicI8::new(0) }; 10];
-
-let view: &mut [i8] = AtomicI8::get_mut_slice(&mut some_ints);
-assert_eq!(view, [0; 10]);
-view
-    .iter_mut()
-    .enumerate()
-    .for_each(|(idx, int)| *int = idx as _);
-
-std::thread::scope(|s| {
-    some_ints
-        .iter()
-        .enumerate()
-        .for_each(|(idx, int)| {
-            s.spawn(move || assert_eq!(int.load(Ordering::Relaxed), idx as _));
-        })
-});
-

pub fn from_mut_slice(v: &mut [i8]) -> &mut [AtomicI8]

🔬This is a nightly-only experimental API. (atomic_from_mut)

Get atomic access to a &mut [i8] slice.

-
Examples
-
#![feature(atomic_from_mut)]
-use std::sync::atomic::{AtomicI8, Ordering};
-
-let mut some_ints = [0; 10];
-let a = &*AtomicI8::from_mut_slice(&mut some_ints);
-std::thread::scope(|s| {
-    for i in 0..a.len() {
-        s.spawn(move || a[i].store(i as _, Ordering::Relaxed));
-    }
-});
-for (i, n) in some_ints.into_iter().enumerate() {
-    assert_eq!(i, n as usize);
-}
-
const: unstable

pub fn into_inner(self) -> i8

Consumes the atomic and returns the contained value.

-

This is safe because passing self by value guarantees that no other threads are -concurrently accessing the atomic data.

-
Examples
-
use std::sync::atomic::AtomicI8;
-
-let some_var = AtomicI8::new(5);
-assert_eq!(some_var.into_inner(), 5);
-

pub fn load(&self, order: Ordering) -> i8

Loads a value from the atomic integer.

-

load takes an Ordering argument which describes the memory ordering of this operation. -Possible values are SeqCst, Acquire and Relaxed.

-
Panics
-

Panics if order is Release or AcqRel.

-
Examples
-
use std::sync::atomic::{AtomicI8, Ordering};
-
-let some_var = AtomicI8::new(5);
-
-assert_eq!(some_var.load(Ordering::Relaxed), 5);
-

pub fn store(&self, val: i8, order: Ordering)

Stores a value into the atomic integer.

-

store takes an Ordering argument which describes the memory ordering of this operation. -Possible values are SeqCst, Release and Relaxed.

-
Panics
-

Panics if order is Acquire or AcqRel.

-
Examples
-
use std::sync::atomic::{AtomicI8, Ordering};
-
-let some_var = AtomicI8::new(5);
-
-some_var.store(10, Ordering::Relaxed);
-assert_eq!(some_var.load(Ordering::Relaxed), 10);
-
1.70.0 (const: 1.70.0)

pub const fn as_ptr(&self) -> *mut i8

Returns a mutable pointer to the underlying integer.

-

Doing non-atomic reads and writes on the resulting integer can be a data race. -This method is mostly useful for FFI, where the function signature may use -*mut i8 instead of &AtomicI8.

-

Returning an *mut pointer from a shared reference to this atomic is safe because the -atomic types work with interior mutability. All modifications of an atomic change the value -through a shared reference, and can do so safely as long as they use atomic operations. Any -use of the returned raw pointer requires an unsafe block and still has to uphold the same -restriction: operations on it must be atomic.

-
Examples
-
use std::sync::atomic::AtomicI8;
-
-extern "C" {
-    fn my_atomic_op(arg: *mut i8);
-}
-
-let atomic = AtomicI8::new(1);
-
-// SAFETY: Safe as long as `my_atomic_op` is atomic.
-unsafe {
-    my_atomic_op(atomic.as_ptr());
-}
-

Trait Implementations§

§

impl Debug for AtomicI8

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for AtomicI8

§

fn default() -> AtomicI8

Returns the “default value” for a type. Read more
§

impl From<i8> for AtomicI8

§

fn from(v: i8) -> AtomicI8

Converts an i8 into an AtomicI8.

-
§

impl RefUnwindSafe for AtomicI8

§

impl Sync for AtomicI8

Auto Trait Implementations§

§

impl Send for AtomicI8

§

impl Unpin for AtomicI8

§

impl UnwindSafe for AtomicI8

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/atomic_polyfill/struct.AtomicU8.html b/docs/doc/atomic_polyfill/struct.AtomicU8.html deleted file mode 100644 index 3307fc3..0000000 --- a/docs/doc/atomic_polyfill/struct.AtomicU8.html +++ /dev/null @@ -1,167 +0,0 @@ -AtomicU8 in atomic_polyfill - Rust

Struct atomic_polyfill::AtomicU8

1.34.0 ·
#[repr(C, align(1))]
pub struct AtomicU8 { /* private fields */ }
Expand description

An integer type which can be safely shared between threads.

-

This type has the same in-memory representation as the underlying -integer type, [u8]. For more about the differences between atomic types and -non-atomic types as well as information about the portability of -this type, please see the module-level documentation.

-

Note: This type is only available on platforms that support -atomic loads and stores of [u8].

-

Implementations§

§

impl AtomicU8

const: 1.34.0

pub const fn new(v: u8) -> AtomicU8

Creates a new atomic integer.

-
Examples
-
use std::sync::atomic::AtomicU8;
-
-let atomic_forty_two = AtomicU8::new(42);
-
const: unstable

pub unsafe fn from_ptr<'a>(ptr: *mut u8) -> &'a AtomicU8

🔬This is a nightly-only experimental API. (atomic_from_ptr)

Creates a new reference to an atomic integer from a pointer.

-
Examples
-
#![feature(atomic_from_ptr, pointer_is_aligned)]
-use std::sync::atomic::{self, AtomicU8};
-use std::mem::align_of;
-
-// Get a pointer to an allocated value
-let ptr: *mut u8 = Box::into_raw(Box::new(0));
-
-assert!(ptr.is_aligned_to(align_of::<AtomicU8>()));
-
-{
-    // Create an atomic view of the allocated value
-    let atomic = unsafe {AtomicU8::from_ptr(ptr) };
-
-    // Use `atomic` for atomic operations, possibly share it with other threads
-    atomic.store(1, atomic::Ordering::Relaxed);
-}
-
-// It's ok to non-atomically access the value behind `ptr`,
-// since the reference to the atomic ended its lifetime in the block above
-assert_eq!(unsafe { *ptr }, 1);
-
-// Deallocate the value
-unsafe { drop(Box::from_raw(ptr)) }
-
Safety
-
    -
  • ptr must be aligned to align_of::<AtomicBool>() (note that on some platforms this can be bigger than align_of::<bool>()).
  • -
  • ptr must be aligned to align_of::<AtomicU8>() (note that on some platforms this can be bigger than align_of::<u8>()).
  • -
  • ptr must be valid for both reads and writes for the whole lifetime 'a.
  • -
  • The value behind ptr must not be accessed through non-atomic operations for the whole lifetime 'a.
  • -
-

pub fn get_mut(&mut self) -> &mut u8

Returns a mutable reference to the underlying integer.

-

This is safe because the mutable reference guarantees that no other threads are -concurrently accessing the atomic data.

-
Examples
-
use std::sync::atomic::{AtomicU8, Ordering};
-
-let mut some_var = AtomicU8::new(10);
-assert_eq!(*some_var.get_mut(), 10);
-*some_var.get_mut() = 5;
-assert_eq!(some_var.load(Ordering::SeqCst), 5);
-

pub fn from_mut(v: &mut u8) -> &mut AtomicU8

🔬This is a nightly-only experimental API. (atomic_from_mut)

Get atomic access to a &mut u8.

-
Examples
-
#![feature(atomic_from_mut)]
-use std::sync::atomic::{AtomicU8, Ordering};
-
-let mut some_int = 123;
-let a = AtomicU8::from_mut(&mut some_int);
-a.store(100, Ordering::Relaxed);
-assert_eq!(some_int, 100);
-

pub fn get_mut_slice(this: &mut [AtomicU8]) -> &mut [u8]

🔬This is a nightly-only experimental API. (atomic_from_mut)

Get non-atomic access to a &mut [AtomicU8] slice

-

This is safe because the mutable reference guarantees that no other threads are -concurrently accessing the atomic data.

-
Examples
-
#![feature(atomic_from_mut, inline_const)]
-use std::sync::atomic::{AtomicU8, Ordering};
-
-let mut some_ints = [const { AtomicU8::new(0) }; 10];
-
-let view: &mut [u8] = AtomicU8::get_mut_slice(&mut some_ints);
-assert_eq!(view, [0; 10]);
-view
-    .iter_mut()
-    .enumerate()
-    .for_each(|(idx, int)| *int = idx as _);
-
-std::thread::scope(|s| {
-    some_ints
-        .iter()
-        .enumerate()
-        .for_each(|(idx, int)| {
-            s.spawn(move || assert_eq!(int.load(Ordering::Relaxed), idx as _));
-        })
-});
-

pub fn from_mut_slice(v: &mut [u8]) -> &mut [AtomicU8]

🔬This is a nightly-only experimental API. (atomic_from_mut)

Get atomic access to a &mut [u8] slice.

-
Examples
-
#![feature(atomic_from_mut)]
-use std::sync::atomic::{AtomicU8, Ordering};
-
-let mut some_ints = [0; 10];
-let a = &*AtomicU8::from_mut_slice(&mut some_ints);
-std::thread::scope(|s| {
-    for i in 0..a.len() {
-        s.spawn(move || a[i].store(i as _, Ordering::Relaxed));
-    }
-});
-for (i, n) in some_ints.into_iter().enumerate() {
-    assert_eq!(i, n as usize);
-}
-
const: unstable

pub fn into_inner(self) -> u8

Consumes the atomic and returns the contained value.

-

This is safe because passing self by value guarantees that no other threads are -concurrently accessing the atomic data.

-
Examples
-
use std::sync::atomic::AtomicU8;
-
-let some_var = AtomicU8::new(5);
-assert_eq!(some_var.into_inner(), 5);
-

pub fn load(&self, order: Ordering) -> u8

Loads a value from the atomic integer.

-

load takes an Ordering argument which describes the memory ordering of this operation. -Possible values are SeqCst, Acquire and Relaxed.

-
Panics
-

Panics if order is Release or AcqRel.

-
Examples
-
use std::sync::atomic::{AtomicU8, Ordering};
-
-let some_var = AtomicU8::new(5);
-
-assert_eq!(some_var.load(Ordering::Relaxed), 5);
-

pub fn store(&self, val: u8, order: Ordering)

Stores a value into the atomic integer.

-

store takes an Ordering argument which describes the memory ordering of this operation. -Possible values are SeqCst, Release and Relaxed.

-
Panics
-

Panics if order is Acquire or AcqRel.

-
Examples
-
use std::sync::atomic::{AtomicU8, Ordering};
-
-let some_var = AtomicU8::new(5);
-
-some_var.store(10, Ordering::Relaxed);
-assert_eq!(some_var.load(Ordering::Relaxed), 10);
-
1.70.0 (const: 1.70.0)

pub const fn as_ptr(&self) -> *mut u8

Returns a mutable pointer to the underlying integer.

-

Doing non-atomic reads and writes on the resulting integer can be a data race. -This method is mostly useful for FFI, where the function signature may use -*mut u8 instead of &AtomicU8.

-

Returning an *mut pointer from a shared reference to this atomic is safe because the -atomic types work with interior mutability. All modifications of an atomic change the value -through a shared reference, and can do so safely as long as they use atomic operations. Any -use of the returned raw pointer requires an unsafe block and still has to uphold the same -restriction: operations on it must be atomic.

-
Examples
-
use std::sync::atomic::AtomicU8;
-
-extern "C" {
-    fn my_atomic_op(arg: *mut u8);
-}
-
-let atomic = AtomicU8::new(1);
-
-// SAFETY: Safe as long as `my_atomic_op` is atomic.
-unsafe {
-    my_atomic_op(atomic.as_ptr());
-}
-

Trait Implementations§

§

impl Debug for AtomicU8

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for AtomicU8

§

fn default() -> AtomicU8

Returns the “default value” for a type. Read more
§

impl From<u8> for AtomicU8

§

fn from(v: u8) -> AtomicU8

Converts an u8 into an AtomicU8.

-
§

impl RefUnwindSafe for AtomicU8

§

impl Sync for AtomicU8

Auto Trait Implementations§

§

impl Send for AtomicU8

§

impl Unpin for AtomicU8

§

impl UnwindSafe for AtomicU8

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/byteorder/all.html b/docs/doc/byteorder/all.html deleted file mode 100644 index 8fa5df4..0000000 --- a/docs/doc/byteorder/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Enums

Traits

Type Aliases

\ No newline at end of file diff --git a/docs/doc/byteorder/enum.BigEndian.html b/docs/doc/byteorder/enum.BigEndian.html deleted file mode 100644 index fe2b908..0000000 --- a/docs/doc/byteorder/enum.BigEndian.html +++ /dev/null @@ -1,45 +0,0 @@ -BigEndian in byteorder - Rust

Enum byteorder::BigEndian

source ·
pub enum BigEndian {}
Expand description

Defines big-endian serialization.

-

Note that this type has no value constructor. It is used purely at the -type level.

-

Examples

-

Write and read u32 numbers in big endian order:

- -
use byteorder::{ByteOrder, BigEndian};
-
-let mut buf = [0; 4];
-BigEndian::write_u32(&mut buf, 1_000_000);
-assert_eq!(1_000_000, BigEndian::read_u32(&buf));
-

Trait Implementations§

source§

impl ByteOrder for BigEndian

source§

fn read_u16(buf: &[u8]) -> u16

Reads an unsigned 16 bit integer from buf. Read more
source§

fn read_u32(buf: &[u8]) -> u32

Reads an unsigned 32 bit integer from buf. Read more
source§

fn read_u64(buf: &[u8]) -> u64

Reads an unsigned 64 bit integer from buf. Read more
source§

fn read_u128(buf: &[u8]) -> u128

Reads an unsigned 128 bit integer from buf. Read more
source§

fn read_uint(buf: &[u8], nbytes: usize) -> u64

Reads an unsigned n-bytes integer from buf. Read more
source§

fn read_uint128(buf: &[u8], nbytes: usize) -> u128

Reads an unsigned n-bytes integer from buf. Read more
source§

fn write_u16(buf: &mut [u8], n: u16)

Writes an unsigned 16 bit integer n to buf. Read more
source§

fn write_u32(buf: &mut [u8], n: u32)

Writes an unsigned 32 bit integer n to buf. Read more
source§

fn write_u64(buf: &mut [u8], n: u64)

Writes an unsigned 64 bit integer n to buf. Read more
source§

fn write_u128(buf: &mut [u8], n: u128)

Writes an unsigned 128 bit integer n to buf. Read more
source§

fn write_uint(buf: &mut [u8], n: u64, nbytes: usize)

Writes an unsigned integer n to buf using only nbytes. Read more
source§

fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize)

Writes an unsigned integer n to buf using only nbytes. Read more
source§

fn read_u16_into(src: &[u8], dst: &mut [u16])

Reads unsigned 16 bit integers from src into dst. Read more
source§

fn read_u32_into(src: &[u8], dst: &mut [u32])

Reads unsigned 32 bit integers from src into dst. Read more
source§

fn read_u64_into(src: &[u8], dst: &mut [u64])

Reads unsigned 64 bit integers from src into dst. Read more
source§

fn read_u128_into(src: &[u8], dst: &mut [u128])

Reads unsigned 128 bit integers from src into dst. Read more
source§

fn write_u16_into(src: &[u16], dst: &mut [u8])

Writes unsigned 16 bit integers from src into dst. Read more
source§

fn write_u32_into(src: &[u32], dst: &mut [u8])

Writes unsigned 32 bit integers from src into dst. Read more
source§

fn write_u64_into(src: &[u64], dst: &mut [u8])

Writes unsigned 64 bit integers from src into dst. Read more
source§

fn write_u128_into(src: &[u128], dst: &mut [u8])

Writes unsigned 128 bit integers from src into dst. Read more
source§

fn from_slice_u16(numbers: &mut [u16])

Converts the given slice of unsigned 16 bit integers to a particular -endianness. Read more
source§

fn from_slice_u32(numbers: &mut [u32])

Converts the given slice of unsigned 32 bit integers to a particular -endianness. Read more
source§

fn from_slice_u64(numbers: &mut [u64])

Converts the given slice of unsigned 64 bit integers to a particular -endianness. Read more
source§

fn from_slice_u128(numbers: &mut [u128])

Converts the given slice of unsigned 128 bit integers to a particular -endianness. Read more
source§

fn from_slice_f32(numbers: &mut [f32])

Converts the given slice of IEEE754 single-precision (4 bytes) floating -point numbers to a particular endianness. Read more
source§

fn from_slice_f64(numbers: &mut [f64])

Converts the given slice of IEEE754 double-precision (8 bytes) floating -point numbers to a particular endianness. Read more
source§

fn read_u24(buf: &[u8]) -> u32

Reads an unsigned 24 bit integer from buf, stored in u32. Read more
source§

fn read_u48(buf: &[u8]) -> u64

Reads an unsigned 48 bit integer from buf, stored in u64. Read more
source§

fn write_u24(buf: &mut [u8], n: u32)

Writes an unsigned 24 bit integer n to buf, stored in u32. Read more
source§

fn write_u48(buf: &mut [u8], n: u64)

Writes an unsigned 48 bit integer n to buf, stored in u64. Read more
source§

fn read_i16(buf: &[u8]) -> i16

Reads a signed 16 bit integer from buf. Read more
source§

fn read_i24(buf: &[u8]) -> i32

Reads a signed 24 bit integer from buf, stored in i32. Read more
source§

fn read_i32(buf: &[u8]) -> i32

Reads a signed 32 bit integer from buf. Read more
source§

fn read_i48(buf: &[u8]) -> i64

Reads a signed 48 bit integer from buf, stored in i64. Read more
source§

fn read_i64(buf: &[u8]) -> i64

Reads a signed 64 bit integer from buf. Read more
source§

fn read_i128(buf: &[u8]) -> i128

Reads a signed 128 bit integer from buf. Read more
source§

fn read_int(buf: &[u8], nbytes: usize) -> i64

Reads a signed n-bytes integer from buf. Read more
source§

fn read_int128(buf: &[u8], nbytes: usize) -> i128

Reads a signed n-bytes integer from buf. Read more
source§

fn read_f32(buf: &[u8]) -> f32

Reads a IEEE754 single-precision (4 bytes) floating point number. Read more
source§

fn read_f64(buf: &[u8]) -> f64

Reads a IEEE754 double-precision (8 bytes) floating point number. Read more
source§

fn write_i16(buf: &mut [u8], n: i16)

Writes a signed 16 bit integer n to buf. Read more
source§

fn write_i24(buf: &mut [u8], n: i32)

Writes a signed 24 bit integer n to buf, stored in i32. Read more
source§

fn write_i32(buf: &mut [u8], n: i32)

Writes a signed 32 bit integer n to buf. Read more
source§

fn write_i48(buf: &mut [u8], n: i64)

Writes a signed 48 bit integer n to buf, stored in i64. Read more
source§

fn write_i64(buf: &mut [u8], n: i64)

Writes a signed 64 bit integer n to buf. Read more
source§

fn write_i128(buf: &mut [u8], n: i128)

Writes a signed 128 bit integer n to buf. Read more
source§

fn write_int(buf: &mut [u8], n: i64, nbytes: usize)

Writes a signed integer n to buf using only nbytes. Read more
source§

fn write_int128(buf: &mut [u8], n: i128, nbytes: usize)

Writes a signed integer n to buf using only nbytes. Read more
source§

fn write_f32(buf: &mut [u8], n: f32)

Writes a IEEE754 single-precision (4 bytes) floating point number. Read more
source§

fn write_f64(buf: &mut [u8], n: f64)

Writes a IEEE754 double-precision (8 bytes) floating point number. Read more
source§

fn read_i16_into(src: &[u8], dst: &mut [i16])

Reads signed 16 bit integers from src to dst. Read more
source§

fn read_i32_into(src: &[u8], dst: &mut [i32])

Reads signed 32 bit integers from src into dst. Read more
source§

fn read_i64_into(src: &[u8], dst: &mut [i64])

Reads signed 64 bit integers from src into dst. Read more
source§

fn read_i128_into(src: &[u8], dst: &mut [i128])

Reads signed 128 bit integers from src into dst. Read more
source§

fn read_f32_into(src: &[u8], dst: &mut [f32])

Reads IEEE754 single-precision (4 bytes) floating point numbers from -src into dst. Read more
source§

fn read_f32_into_unchecked(src: &[u8], dst: &mut [f32])

👎Deprecated since 1.3.0: please use read_f32_into instead
DEPRECATED. Read more
source§

fn read_f64_into(src: &[u8], dst: &mut [f64])

Reads IEEE754 single-precision (4 bytes) floating point numbers from -src into dst. Read more
source§

fn read_f64_into_unchecked(src: &[u8], dst: &mut [f64])

👎Deprecated since 1.3.0: please use read_f64_into instead
DEPRECATED. Read more
source§

fn write_i8_into(src: &[i8], dst: &mut [u8])

Writes signed 8 bit integers from src into dst. Read more
source§

fn write_i16_into(src: &[i16], dst: &mut [u8])

Writes signed 16 bit integers from src into dst. Read more
source§

fn write_i32_into(src: &[i32], dst: &mut [u8])

Writes signed 32 bit integers from src into dst. Read more
source§

fn write_i64_into(src: &[i64], dst: &mut [u8])

Writes signed 64 bit integers from src into dst. Read more
source§

fn write_i128_into(src: &[i128], dst: &mut [u8])

Writes signed 128 bit integers from src into dst. Read more
source§

fn write_f32_into(src: &[f32], dst: &mut [u8])

Writes IEEE754 single-precision (4 bytes) floating point numbers from -src into dst. Read more
source§

fn write_f64_into(src: &[f64], dst: &mut [u8])

Writes IEEE754 double-precision (8 bytes) floating point numbers from -src into dst. Read more
source§

fn from_slice_i16(src: &mut [i16])

Converts the given slice of signed 16 bit integers to a particular -endianness. Read more
source§

fn from_slice_i32(src: &mut [i32])

Converts the given slice of signed 32 bit integers to a particular -endianness. Read more
source§

fn from_slice_i64(src: &mut [i64])

Converts the given slice of signed 64 bit integers to a particular -endianness. Read more
source§

fn from_slice_i128(src: &mut [i128])

Converts the given slice of signed 128 bit integers to a particular -endianness. Read more
source§

impl Clone for BigEndian

source§

fn clone(&self) -> BigEndian

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BigEndian

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for BigEndian

source§

fn default() -> BigEndian

Returns the “default value” for a type. Read more
source§

impl Hash for BigEndian

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl Ord for BigEndian

source§

fn cmp(&self, other: &BigEndian) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<BigEndian> for BigEndian

source§

fn eq(&self, other: &BigEndian) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<BigEndian> for BigEndian

source§

fn partial_cmp(&self, other: &BigEndian) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for BigEndian

source§

impl Eq for BigEndian

source§

impl StructuralEq for BigEndian

source§

impl StructuralPartialEq for BigEndian

Auto Trait Implementations§

§

impl RefUnwindSafe for BigEndian

§

impl Send for BigEndian

§

impl Sync for BigEndian

§

impl Unpin for BigEndian

§

impl UnwindSafe for BigEndian

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/byteorder/enum.LittleEndian.html b/docs/doc/byteorder/enum.LittleEndian.html deleted file mode 100644 index 3167ddd..0000000 --- a/docs/doc/byteorder/enum.LittleEndian.html +++ /dev/null @@ -1,45 +0,0 @@ -LittleEndian in byteorder - Rust
pub enum LittleEndian {}
Expand description

Defines little-endian serialization.

-

Note that this type has no value constructor. It is used purely at the -type level.

-

Examples

-

Write and read u32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 4];
-LittleEndian::write_u32(&mut buf, 1_000_000);
-assert_eq!(1_000_000, LittleEndian::read_u32(&buf));
-

Trait Implementations§

source§

impl ByteOrder for LittleEndian

source§

fn read_u16(buf: &[u8]) -> u16

Reads an unsigned 16 bit integer from buf. Read more
source§

fn read_u32(buf: &[u8]) -> u32

Reads an unsigned 32 bit integer from buf. Read more
source§

fn read_u64(buf: &[u8]) -> u64

Reads an unsigned 64 bit integer from buf. Read more
source§

fn read_u128(buf: &[u8]) -> u128

Reads an unsigned 128 bit integer from buf. Read more
source§

fn read_uint(buf: &[u8], nbytes: usize) -> u64

Reads an unsigned n-bytes integer from buf. Read more
source§

fn read_uint128(buf: &[u8], nbytes: usize) -> u128

Reads an unsigned n-bytes integer from buf. Read more
source§

fn write_u16(buf: &mut [u8], n: u16)

Writes an unsigned 16 bit integer n to buf. Read more
source§

fn write_u32(buf: &mut [u8], n: u32)

Writes an unsigned 32 bit integer n to buf. Read more
source§

fn write_u64(buf: &mut [u8], n: u64)

Writes an unsigned 64 bit integer n to buf. Read more
source§

fn write_u128(buf: &mut [u8], n: u128)

Writes an unsigned 128 bit integer n to buf. Read more
source§

fn write_uint(buf: &mut [u8], n: u64, nbytes: usize)

Writes an unsigned integer n to buf using only nbytes. Read more
source§

fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize)

Writes an unsigned integer n to buf using only nbytes. Read more
source§

fn read_u16_into(src: &[u8], dst: &mut [u16])

Reads unsigned 16 bit integers from src into dst. Read more
source§

fn read_u32_into(src: &[u8], dst: &mut [u32])

Reads unsigned 32 bit integers from src into dst. Read more
source§

fn read_u64_into(src: &[u8], dst: &mut [u64])

Reads unsigned 64 bit integers from src into dst. Read more
source§

fn read_u128_into(src: &[u8], dst: &mut [u128])

Reads unsigned 128 bit integers from src into dst. Read more
source§

fn write_u16_into(src: &[u16], dst: &mut [u8])

Writes unsigned 16 bit integers from src into dst. Read more
source§

fn write_u32_into(src: &[u32], dst: &mut [u8])

Writes unsigned 32 bit integers from src into dst. Read more
source§

fn write_u64_into(src: &[u64], dst: &mut [u8])

Writes unsigned 64 bit integers from src into dst. Read more
source§

fn write_u128_into(src: &[u128], dst: &mut [u8])

Writes unsigned 128 bit integers from src into dst. Read more
source§

fn from_slice_u16(numbers: &mut [u16])

Converts the given slice of unsigned 16 bit integers to a particular -endianness. Read more
source§

fn from_slice_u32(numbers: &mut [u32])

Converts the given slice of unsigned 32 bit integers to a particular -endianness. Read more
source§

fn from_slice_u64(numbers: &mut [u64])

Converts the given slice of unsigned 64 bit integers to a particular -endianness. Read more
source§

fn from_slice_u128(numbers: &mut [u128])

Converts the given slice of unsigned 128 bit integers to a particular -endianness. Read more
source§

fn from_slice_f32(numbers: &mut [f32])

Converts the given slice of IEEE754 single-precision (4 bytes) floating -point numbers to a particular endianness. Read more
source§

fn from_slice_f64(numbers: &mut [f64])

Converts the given slice of IEEE754 double-precision (8 bytes) floating -point numbers to a particular endianness. Read more
source§

fn read_u24(buf: &[u8]) -> u32

Reads an unsigned 24 bit integer from buf, stored in u32. Read more
source§

fn read_u48(buf: &[u8]) -> u64

Reads an unsigned 48 bit integer from buf, stored in u64. Read more
source§

fn write_u24(buf: &mut [u8], n: u32)

Writes an unsigned 24 bit integer n to buf, stored in u32. Read more
source§

fn write_u48(buf: &mut [u8], n: u64)

Writes an unsigned 48 bit integer n to buf, stored in u64. Read more
source§

fn read_i16(buf: &[u8]) -> i16

Reads a signed 16 bit integer from buf. Read more
source§

fn read_i24(buf: &[u8]) -> i32

Reads a signed 24 bit integer from buf, stored in i32. Read more
source§

fn read_i32(buf: &[u8]) -> i32

Reads a signed 32 bit integer from buf. Read more
source§

fn read_i48(buf: &[u8]) -> i64

Reads a signed 48 bit integer from buf, stored in i64. Read more
source§

fn read_i64(buf: &[u8]) -> i64

Reads a signed 64 bit integer from buf. Read more
source§

fn read_i128(buf: &[u8]) -> i128

Reads a signed 128 bit integer from buf. Read more
source§

fn read_int(buf: &[u8], nbytes: usize) -> i64

Reads a signed n-bytes integer from buf. Read more
source§

fn read_int128(buf: &[u8], nbytes: usize) -> i128

Reads a signed n-bytes integer from buf. Read more
source§

fn read_f32(buf: &[u8]) -> f32

Reads a IEEE754 single-precision (4 bytes) floating point number. Read more
source§

fn read_f64(buf: &[u8]) -> f64

Reads a IEEE754 double-precision (8 bytes) floating point number. Read more
source§

fn write_i16(buf: &mut [u8], n: i16)

Writes a signed 16 bit integer n to buf. Read more
source§

fn write_i24(buf: &mut [u8], n: i32)

Writes a signed 24 bit integer n to buf, stored in i32. Read more
source§

fn write_i32(buf: &mut [u8], n: i32)

Writes a signed 32 bit integer n to buf. Read more
source§

fn write_i48(buf: &mut [u8], n: i64)

Writes a signed 48 bit integer n to buf, stored in i64. Read more
source§

fn write_i64(buf: &mut [u8], n: i64)

Writes a signed 64 bit integer n to buf. Read more
source§

fn write_i128(buf: &mut [u8], n: i128)

Writes a signed 128 bit integer n to buf. Read more
source§

fn write_int(buf: &mut [u8], n: i64, nbytes: usize)

Writes a signed integer n to buf using only nbytes. Read more
source§

fn write_int128(buf: &mut [u8], n: i128, nbytes: usize)

Writes a signed integer n to buf using only nbytes. Read more
source§

fn write_f32(buf: &mut [u8], n: f32)

Writes a IEEE754 single-precision (4 bytes) floating point number. Read more
source§

fn write_f64(buf: &mut [u8], n: f64)

Writes a IEEE754 double-precision (8 bytes) floating point number. Read more
source§

fn read_i16_into(src: &[u8], dst: &mut [i16])

Reads signed 16 bit integers from src to dst. Read more
source§

fn read_i32_into(src: &[u8], dst: &mut [i32])

Reads signed 32 bit integers from src into dst. Read more
source§

fn read_i64_into(src: &[u8], dst: &mut [i64])

Reads signed 64 bit integers from src into dst. Read more
source§

fn read_i128_into(src: &[u8], dst: &mut [i128])

Reads signed 128 bit integers from src into dst. Read more
source§

fn read_f32_into(src: &[u8], dst: &mut [f32])

Reads IEEE754 single-precision (4 bytes) floating point numbers from -src into dst. Read more
source§

fn read_f32_into_unchecked(src: &[u8], dst: &mut [f32])

👎Deprecated since 1.3.0: please use read_f32_into instead
DEPRECATED. Read more
source§

fn read_f64_into(src: &[u8], dst: &mut [f64])

Reads IEEE754 single-precision (4 bytes) floating point numbers from -src into dst. Read more
source§

fn read_f64_into_unchecked(src: &[u8], dst: &mut [f64])

👎Deprecated since 1.3.0: please use read_f64_into instead
DEPRECATED. Read more
source§

fn write_i8_into(src: &[i8], dst: &mut [u8])

Writes signed 8 bit integers from src into dst. Read more
source§

fn write_i16_into(src: &[i16], dst: &mut [u8])

Writes signed 16 bit integers from src into dst. Read more
source§

fn write_i32_into(src: &[i32], dst: &mut [u8])

Writes signed 32 bit integers from src into dst. Read more
source§

fn write_i64_into(src: &[i64], dst: &mut [u8])

Writes signed 64 bit integers from src into dst. Read more
source§

fn write_i128_into(src: &[i128], dst: &mut [u8])

Writes signed 128 bit integers from src into dst. Read more
source§

fn write_f32_into(src: &[f32], dst: &mut [u8])

Writes IEEE754 single-precision (4 bytes) floating point numbers from -src into dst. Read more
source§

fn write_f64_into(src: &[f64], dst: &mut [u8])

Writes IEEE754 double-precision (8 bytes) floating point numbers from -src into dst. Read more
source§

fn from_slice_i16(src: &mut [i16])

Converts the given slice of signed 16 bit integers to a particular -endianness. Read more
source§

fn from_slice_i32(src: &mut [i32])

Converts the given slice of signed 32 bit integers to a particular -endianness. Read more
source§

fn from_slice_i64(src: &mut [i64])

Converts the given slice of signed 64 bit integers to a particular -endianness. Read more
source§

fn from_slice_i128(src: &mut [i128])

Converts the given slice of signed 128 bit integers to a particular -endianness. Read more
source§

impl Clone for LittleEndian

source§

fn clone(&self) -> LittleEndian

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LittleEndian

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for LittleEndian

source§

fn default() -> LittleEndian

Returns the “default value” for a type. Read more
source§

impl Hash for LittleEndian

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl Ord for LittleEndian

source§

fn cmp(&self, other: &LittleEndian) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<LittleEndian> for LittleEndian

source§

fn eq(&self, other: &LittleEndian) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<LittleEndian> for LittleEndian

source§

fn partial_cmp(&self, other: &LittleEndian) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for LittleEndian

source§

impl Eq for LittleEndian

source§

impl StructuralEq for LittleEndian

source§

impl StructuralPartialEq for LittleEndian

Auto Trait Implementations§

§

impl RefUnwindSafe for LittleEndian

§

impl Send for LittleEndian

§

impl Sync for LittleEndian

§

impl Unpin for LittleEndian

§

impl UnwindSafe for LittleEndian

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/byteorder/index.html b/docs/doc/byteorder/index.html deleted file mode 100644 index 41717dc..0000000 --- a/docs/doc/byteorder/index.html +++ /dev/null @@ -1,41 +0,0 @@ -byteorder - Rust

Crate byteorder

source ·
Expand description

This crate provides convenience methods for encoding and decoding numbers in -either big-endian or little-endian order.

-

The organization of the crate is pretty simple. A trait, ByteOrder, specifies -byte conversion methods for each type of number in Rust (sans numbers that have -a platform dependent size like usize and isize). Two types, BigEndian -and LittleEndian implement these methods. Finally, ReadBytesExt and -WriteBytesExt provide convenience methods available to all types that -implement Read and Write.

-

An alias, NetworkEndian, for BigEndian is provided to help improve -code clarity.

-

An additional alias, NativeEndian, is provided for the endianness of the -local platform. This is convenient when serializing data for use and -conversions are not desired.

-

Examples

-

Read unsigned 16 bit big-endian integers from a Read type:

- -
use std::io::Cursor;
-use byteorder::{BigEndian, ReadBytesExt};
-
-let mut rdr = Cursor::new(vec![2, 5, 3, 0]);
-// Note that we use type parameters to indicate which kind of byte order
-// we want!
-assert_eq!(517, rdr.read_u16::<BigEndian>().unwrap());
-assert_eq!(768, rdr.read_u16::<BigEndian>().unwrap());
-

Write unsigned 16 bit little-endian integers to a Write type:

- -
use byteorder::{LittleEndian, WriteBytesExt};
-
-let mut wtr = vec![];
-wtr.write_u16::<LittleEndian>(517).unwrap();
-wtr.write_u16::<LittleEndian>(768).unwrap();
-assert_eq!(wtr, vec![5, 2, 0, 3]);
-

Optional Features

-

This crate optionally provides support for 128 bit values (i128 and u128) -when built with the i128 feature enabled.

-

This crate can also be used without the standard library.

-

Alternatives

-

Note that as of Rust 1.32, the standard numeric types provide built-in methods -like to_le_bytes and from_le_bytes, which support some of the same use -cases.

-

Enums

Traits

  • ByteOrder describes types that can serialize integers as bytes.

Type Aliases

\ No newline at end of file diff --git a/docs/doc/byteorder/sidebar-items.js b/docs/doc/byteorder/sidebar-items.js deleted file mode 100644 index 7c062a3..0000000 --- a/docs/doc/byteorder/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["BigEndian","LittleEndian"],"trait":["ByteOrder"],"type":["BE","LE","NativeEndian","NetworkEndian"]}; \ No newline at end of file diff --git a/docs/doc/byteorder/trait.ByteOrder.html b/docs/doc/byteorder/trait.ByteOrder.html deleted file mode 100644 index fd0372b..0000000 --- a/docs/doc/byteorder/trait.ByteOrder.html +++ /dev/null @@ -1,961 +0,0 @@ -ByteOrder in byteorder - Rust

Trait byteorder::ByteOrder

source ·
pub trait ByteOrder: Clone + Copy + Debug + Default + Eq + Hash + Ord + PartialEq + PartialOrd + Sealed {
-
Show 69 methods // Required methods - fn read_u16(buf: &[u8]) -> u16; - fn read_u32(buf: &[u8]) -> u32; - fn read_u64(buf: &[u8]) -> u64; - fn read_u128(buf: &[u8]) -> u128; - fn read_uint(buf: &[u8], nbytes: usize) -> u64; - fn read_uint128(buf: &[u8], nbytes: usize) -> u128; - fn write_u16(buf: &mut [u8], n: u16); - fn write_u32(buf: &mut [u8], n: u32); - fn write_u64(buf: &mut [u8], n: u64); - fn write_u128(buf: &mut [u8], n: u128); - fn write_uint(buf: &mut [u8], n: u64, nbytes: usize); - fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize); - fn read_u16_into(src: &[u8], dst: &mut [u16]); - fn read_u32_into(src: &[u8], dst: &mut [u32]); - fn read_u64_into(src: &[u8], dst: &mut [u64]); - fn read_u128_into(src: &[u8], dst: &mut [u128]); - fn write_u16_into(src: &[u16], dst: &mut [u8]); - fn write_u32_into(src: &[u32], dst: &mut [u8]); - fn write_u64_into(src: &[u64], dst: &mut [u8]); - fn write_u128_into(src: &[u128], dst: &mut [u8]); - fn from_slice_u16(numbers: &mut [u16]); - fn from_slice_u32(numbers: &mut [u32]); - fn from_slice_u64(numbers: &mut [u64]); - fn from_slice_u128(numbers: &mut [u128]); - fn from_slice_f32(numbers: &mut [f32]); - fn from_slice_f64(numbers: &mut [f64]); - - // Provided methods - fn read_u24(buf: &[u8]) -> u32 { ... } - fn read_u48(buf: &[u8]) -> u64 { ... } - fn write_u24(buf: &mut [u8], n: u32) { ... } - fn write_u48(buf: &mut [u8], n: u64) { ... } - fn read_i16(buf: &[u8]) -> i16 { ... } - fn read_i24(buf: &[u8]) -> i32 { ... } - fn read_i32(buf: &[u8]) -> i32 { ... } - fn read_i48(buf: &[u8]) -> i64 { ... } - fn read_i64(buf: &[u8]) -> i64 { ... } - fn read_i128(buf: &[u8]) -> i128 { ... } - fn read_int(buf: &[u8], nbytes: usize) -> i64 { ... } - fn read_int128(buf: &[u8], nbytes: usize) -> i128 { ... } - fn read_f32(buf: &[u8]) -> f32 { ... } - fn read_f64(buf: &[u8]) -> f64 { ... } - fn write_i16(buf: &mut [u8], n: i16) { ... } - fn write_i24(buf: &mut [u8], n: i32) { ... } - fn write_i32(buf: &mut [u8], n: i32) { ... } - fn write_i48(buf: &mut [u8], n: i64) { ... } - fn write_i64(buf: &mut [u8], n: i64) { ... } - fn write_i128(buf: &mut [u8], n: i128) { ... } - fn write_int(buf: &mut [u8], n: i64, nbytes: usize) { ... } - fn write_int128(buf: &mut [u8], n: i128, nbytes: usize) { ... } - fn write_f32(buf: &mut [u8], n: f32) { ... } - fn write_f64(buf: &mut [u8], n: f64) { ... } - fn read_i16_into(src: &[u8], dst: &mut [i16]) { ... } - fn read_i32_into(src: &[u8], dst: &mut [i32]) { ... } - fn read_i64_into(src: &[u8], dst: &mut [i64]) { ... } - fn read_i128_into(src: &[u8], dst: &mut [i128]) { ... } - fn read_f32_into(src: &[u8], dst: &mut [f32]) { ... } - fn read_f32_into_unchecked(src: &[u8], dst: &mut [f32]) { ... } - fn read_f64_into(src: &[u8], dst: &mut [f64]) { ... } - fn read_f64_into_unchecked(src: &[u8], dst: &mut [f64]) { ... } - fn write_i8_into(src: &[i8], dst: &mut [u8]) { ... } - fn write_i16_into(src: &[i16], dst: &mut [u8]) { ... } - fn write_i32_into(src: &[i32], dst: &mut [u8]) { ... } - fn write_i64_into(src: &[i64], dst: &mut [u8]) { ... } - fn write_i128_into(src: &[i128], dst: &mut [u8]) { ... } - fn write_f32_into(src: &[f32], dst: &mut [u8]) { ... } - fn write_f64_into(src: &[f64], dst: &mut [u8]) { ... } - fn from_slice_i16(src: &mut [i16]) { ... } - fn from_slice_i32(src: &mut [i32]) { ... } - fn from_slice_i64(src: &mut [i64]) { ... } - fn from_slice_i128(src: &mut [i128]) { ... } -
}
Expand description

ByteOrder describes types that can serialize integers as bytes.

-

Note that Self does not appear anywhere in this trait’s definition! -Therefore, in order to use it, you’ll need to use syntax like -T::read_u16(&[0, 1]) where T implements ByteOrder.

-

This crate provides two types that implement ByteOrder: BigEndian -and LittleEndian. -This trait is sealed and cannot be implemented for callers to avoid -breaking backwards compatibility when adding new derived traits.

-

Examples

-

Write and read u32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 4];
-LittleEndian::write_u32(&mut buf, 1_000_000);
-assert_eq!(1_000_000, LittleEndian::read_u32(&buf));
-

Write and read i16 numbers in big endian order:

- -
use byteorder::{ByteOrder, BigEndian};
-
-let mut buf = [0; 2];
-BigEndian::write_i16(&mut buf, -5_000);
-assert_eq!(-5_000, BigEndian::read_i16(&buf));
-

Required Methods§

source

fn read_u16(buf: &[u8]) -> u16

Reads an unsigned 16 bit integer from buf.

-
Panics
-

Panics when buf.len() < 2.

-
source

fn read_u32(buf: &[u8]) -> u32

Reads an unsigned 32 bit integer from buf.

-
Panics
-

Panics when buf.len() < 4.

-
Examples
-

Write and read u32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 4];
-LittleEndian::write_u32(&mut buf, 1_000_000);
-assert_eq!(1_000_000, LittleEndian::read_u32(&buf));
-
source

fn read_u64(buf: &[u8]) -> u64

Reads an unsigned 64 bit integer from buf.

-
Panics
-

Panics when buf.len() < 8.

-
Examples
-

Write and read u64 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 8];
-LittleEndian::write_u64(&mut buf, 1_000_000);
-assert_eq!(1_000_000, LittleEndian::read_u64(&buf));
-
source

fn read_u128(buf: &[u8]) -> u128

Reads an unsigned 128 bit integer from buf.

-
Panics
-

Panics when buf.len() < 16.

-
Examples
-

Write and read u128 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 16];
-LittleEndian::write_u128(&mut buf, 1_000_000);
-assert_eq!(1_000_000, LittleEndian::read_u128(&buf));
-
source

fn read_uint(buf: &[u8], nbytes: usize) -> u64

Reads an unsigned n-bytes integer from buf.

-
Panics
-

Panics when nbytes < 1 or nbytes > 8 or -buf.len() < nbytes

-
Examples
-

Write and read an n-byte number in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 3];
-LittleEndian::write_uint(&mut buf, 1_000_000, 3);
-assert_eq!(1_000_000, LittleEndian::read_uint(&buf, 3));
-
source

fn read_uint128(buf: &[u8], nbytes: usize) -> u128

Reads an unsigned n-bytes integer from buf.

-
Panics
-

Panics when nbytes < 1 or nbytes > 16 or -buf.len() < nbytes

-
Examples
-

Write and read an n-byte number in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 3];
-LittleEndian::write_uint128(&mut buf, 1_000_000, 3);
-assert_eq!(1_000_000, LittleEndian::read_uint128(&buf, 3));
-
source

fn write_u16(buf: &mut [u8], n: u16)

Writes an unsigned 16 bit integer n to buf.

-
Panics
-

Panics when buf.len() < 2.

-
Examples
-

Write and read u16 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 2];
-LittleEndian::write_u16(&mut buf, 1_000);
-assert_eq!(1_000, LittleEndian::read_u16(&buf));
-
source

fn write_u32(buf: &mut [u8], n: u32)

Writes an unsigned 32 bit integer n to buf.

-
Panics
-

Panics when buf.len() < 4.

-
Examples
-

Write and read u32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 4];
-LittleEndian::write_u32(&mut buf, 1_000_000);
-assert_eq!(1_000_000, LittleEndian::read_u32(&buf));
-
source

fn write_u64(buf: &mut [u8], n: u64)

Writes an unsigned 64 bit integer n to buf.

-
Panics
-

Panics when buf.len() < 8.

-
Examples
-

Write and read u64 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 8];
-LittleEndian::write_u64(&mut buf, 1_000_000);
-assert_eq!(1_000_000, LittleEndian::read_u64(&buf));
-
source

fn write_u128(buf: &mut [u8], n: u128)

Writes an unsigned 128 bit integer n to buf.

-
Panics
-

Panics when buf.len() < 16.

-
Examples
-

Write and read u128 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 16];
-LittleEndian::write_u128(&mut buf, 1_000_000);
-assert_eq!(1_000_000, LittleEndian::read_u128(&buf));
-
source

fn write_uint(buf: &mut [u8], n: u64, nbytes: usize)

Writes an unsigned integer n to buf using only nbytes.

-
Panics
-

If n is not representable in nbytes, or if nbytes is > 8, then -this method panics.

-
Examples
-

Write and read an n-byte number in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 3];
-LittleEndian::write_uint(&mut buf, 1_000_000, 3);
-assert_eq!(1_000_000, LittleEndian::read_uint(&buf, 3));
-
source

fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize)

Writes an unsigned integer n to buf using only nbytes.

-
Panics
-

If n is not representable in nbytes, or if nbytes is > 16, then -this method panics.

-
Examples
-

Write and read an n-byte number in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 3];
-LittleEndian::write_uint128(&mut buf, 1_000_000, 3);
-assert_eq!(1_000_000, LittleEndian::read_uint128(&buf, 3));
-
source

fn read_u16_into(src: &[u8], dst: &mut [u16])

Reads unsigned 16 bit integers from src into dst.

-
Panics
-

Panics when src.len() != 2*dst.len().

-
Examples
-

Write and read u16 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 8];
-let numbers_given = [1, 2, 0xf00f, 0xffee];
-LittleEndian::write_u16_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0; 4];
-LittleEndian::read_u16_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn read_u32_into(src: &[u8], dst: &mut [u32])

Reads unsigned 32 bit integers from src into dst.

-
Panics
-

Panics when src.len() != 4*dst.len().

-
Examples
-

Write and read u32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 16];
-let numbers_given = [1, 2, 0xf00f, 0xffee];
-LittleEndian::write_u32_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0; 4];
-LittleEndian::read_u32_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn read_u64_into(src: &[u8], dst: &mut [u64])

Reads unsigned 64 bit integers from src into dst.

-
Panics
-

Panics when src.len() != 8*dst.len().

-
Examples
-

Write and read u64 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 32];
-let numbers_given = [1, 2, 0xf00f, 0xffee];
-LittleEndian::write_u64_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0; 4];
-LittleEndian::read_u64_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn read_u128_into(src: &[u8], dst: &mut [u128])

Reads unsigned 128 bit integers from src into dst.

-
Panics
-

Panics when src.len() != 16*dst.len().

-
Examples
-

Write and read u128 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 64];
-let numbers_given = [1, 2, 0xf00f, 0xffee];
-LittleEndian::write_u128_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0; 4];
-LittleEndian::read_u128_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn write_u16_into(src: &[u16], dst: &mut [u8])

Writes unsigned 16 bit integers from src into dst.

-
Panics
-

Panics when dst.len() != 2*src.len().

-
Examples
-

Write and read u16 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 8];
-let numbers_given = [1, 2, 0xf00f, 0xffee];
-LittleEndian::write_u16_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0; 4];
-LittleEndian::read_u16_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn write_u32_into(src: &[u32], dst: &mut [u8])

Writes unsigned 32 bit integers from src into dst.

-
Panics
-

Panics when dst.len() != 4*src.len().

-
Examples
-

Write and read u32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 16];
-let numbers_given = [1, 2, 0xf00f, 0xffee];
-LittleEndian::write_u32_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0; 4];
-LittleEndian::read_u32_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn write_u64_into(src: &[u64], dst: &mut [u8])

Writes unsigned 64 bit integers from src into dst.

-
Panics
-

Panics when dst.len() != 8*src.len().

-
Examples
-

Write and read u64 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 32];
-let numbers_given = [1, 2, 0xf00f, 0xffee];
-LittleEndian::write_u64_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0; 4];
-LittleEndian::read_u64_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn write_u128_into(src: &[u128], dst: &mut [u8])

Writes unsigned 128 bit integers from src into dst.

-
Panics
-

Panics when dst.len() != 16*src.len().

-
Examples
-

Write and read u128 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 64];
-let numbers_given = [1, 2, 0xf00f, 0xffee];
-LittleEndian::write_u128_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0; 4];
-LittleEndian::read_u128_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn from_slice_u16(numbers: &mut [u16])

Converts the given slice of unsigned 16 bit integers to a particular -endianness.

-

If the endianness matches the endianness of the host platform, then -this is a no-op.

-
Examples
-

Convert the host platform’s endianness to big-endian:

- -
use byteorder::{ByteOrder, BigEndian};
-
-let mut numbers = [5, 65000];
-BigEndian::from_slice_u16(&mut numbers);
-assert_eq!(numbers, [5u16.to_be(), 65000u16.to_be()]);
-
source

fn from_slice_u32(numbers: &mut [u32])

Converts the given slice of unsigned 32 bit integers to a particular -endianness.

-

If the endianness matches the endianness of the host platform, then -this is a no-op.

-
Examples
-

Convert the host platform’s endianness to big-endian:

- -
use byteorder::{ByteOrder, BigEndian};
-
-let mut numbers = [5, 65000];
-BigEndian::from_slice_u32(&mut numbers);
-assert_eq!(numbers, [5u32.to_be(), 65000u32.to_be()]);
-
source

fn from_slice_u64(numbers: &mut [u64])

Converts the given slice of unsigned 64 bit integers to a particular -endianness.

-

If the endianness matches the endianness of the host platform, then -this is a no-op.

-
Examples
-

Convert the host platform’s endianness to big-endian:

- -
use byteorder::{ByteOrder, BigEndian};
-
-let mut numbers = [5, 65000];
-BigEndian::from_slice_u64(&mut numbers);
-assert_eq!(numbers, [5u64.to_be(), 65000u64.to_be()]);
-
source

fn from_slice_u128(numbers: &mut [u128])

Converts the given slice of unsigned 128 bit integers to a particular -endianness.

-

If the endianness matches the endianness of the host platform, then -this is a no-op.

-
Examples
-

Convert the host platform’s endianness to big-endian:

- -
use byteorder::{ByteOrder, BigEndian};
-
-let mut numbers = [5, 65000];
-BigEndian::from_slice_u128(&mut numbers);
-assert_eq!(numbers, [5u128.to_be(), 65000u128.to_be()]);
-
source

fn from_slice_f32(numbers: &mut [f32])

Converts the given slice of IEEE754 single-precision (4 bytes) floating -point numbers to a particular endianness.

-

If the endianness matches the endianness of the host platform, then -this is a no-op.

-
source

fn from_slice_f64(numbers: &mut [f64])

Converts the given slice of IEEE754 double-precision (8 bytes) floating -point numbers to a particular endianness.

-

If the endianness matches the endianness of the host platform, then -this is a no-op.

-

Provided Methods§

source

fn read_u24(buf: &[u8]) -> u32

Reads an unsigned 24 bit integer from buf, stored in u32.

-
Panics
-

Panics when buf.len() < 3.

-
Examples
-

Write and read 24 bit u32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 3];
-LittleEndian::write_u24(&mut buf, 1_000_000);
-assert_eq!(1_000_000, LittleEndian::read_u24(&buf));
-
source

fn read_u48(buf: &[u8]) -> u64

Reads an unsigned 48 bit integer from buf, stored in u64.

-
Panics
-

Panics when buf.len() < 6.

-
Examples
-

Write and read 48 bit u64 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 6];
-LittleEndian::write_u48(&mut buf, 1_000_000_000_000);
-assert_eq!(1_000_000_000_000, LittleEndian::read_u48(&buf));
-
source

fn write_u24(buf: &mut [u8], n: u32)

Writes an unsigned 24 bit integer n to buf, stored in u32.

-
Panics
-

Panics when buf.len() < 3.

-
Examples
-

Write and read 24 bit u32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 3];
-LittleEndian::write_u24(&mut buf, 1_000_000);
-assert_eq!(1_000_000, LittleEndian::read_u24(&buf));
-
source

fn write_u48(buf: &mut [u8], n: u64)

Writes an unsigned 48 bit integer n to buf, stored in u64.

-
Panics
-

Panics when buf.len() < 6.

-
Examples
-

Write and read 48 bit u64 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 6];
-LittleEndian::write_u48(&mut buf, 1_000_000_000_000);
-assert_eq!(1_000_000_000_000, LittleEndian::read_u48(&buf));
-
source

fn read_i16(buf: &[u8]) -> i16

Reads a signed 16 bit integer from buf.

-
Panics
-

Panics when buf.len() < 2.

-
Examples
-

Write and read i16 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 2];
-LittleEndian::write_i16(&mut buf, -1_000);
-assert_eq!(-1_000, LittleEndian::read_i16(&buf));
-
source

fn read_i24(buf: &[u8]) -> i32

Reads a signed 24 bit integer from buf, stored in i32.

-
Panics
-

Panics when buf.len() < 3.

-
Examples
-

Write and read 24 bit i32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 3];
-LittleEndian::write_i24(&mut buf, -1_000_000);
-assert_eq!(-1_000_000, LittleEndian::read_i24(&buf));
-
source

fn read_i32(buf: &[u8]) -> i32

Reads a signed 32 bit integer from buf.

-
Panics
-

Panics when buf.len() < 4.

-
Examples
-

Write and read i32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 4];
-LittleEndian::write_i32(&mut buf, -1_000_000);
-assert_eq!(-1_000_000, LittleEndian::read_i32(&buf));
-
source

fn read_i48(buf: &[u8]) -> i64

Reads a signed 48 bit integer from buf, stored in i64.

-
Panics
-

Panics when buf.len() < 6.

-
Examples
-

Write and read 48 bit i64 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 6];
-LittleEndian::write_i48(&mut buf, -1_000_000_000_000);
-assert_eq!(-1_000_000_000_000, LittleEndian::read_i48(&buf));
-
source

fn read_i64(buf: &[u8]) -> i64

Reads a signed 64 bit integer from buf.

-
Panics
-

Panics when buf.len() < 8.

-
Examples
-

Write and read i64 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 8];
-LittleEndian::write_i64(&mut buf, -1_000_000_000);
-assert_eq!(-1_000_000_000, LittleEndian::read_i64(&buf));
-
source

fn read_i128(buf: &[u8]) -> i128

Reads a signed 128 bit integer from buf.

-
Panics
-

Panics when buf.len() < 16.

-
Examples
-

Write and read i128 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 16];
-LittleEndian::write_i128(&mut buf, -1_000_000_000);
-assert_eq!(-1_000_000_000, LittleEndian::read_i128(&buf));
-
source

fn read_int(buf: &[u8], nbytes: usize) -> i64

Reads a signed n-bytes integer from buf.

-
Panics
-

Panics when nbytes < 1 or nbytes > 8 or -buf.len() < nbytes

-
Examples
-

Write and read n-length signed numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 3];
-LittleEndian::write_int(&mut buf, -1_000, 3);
-assert_eq!(-1_000, LittleEndian::read_int(&buf, 3));
-
source

fn read_int128(buf: &[u8], nbytes: usize) -> i128

Reads a signed n-bytes integer from buf.

-
Panics
-

Panics when nbytes < 1 or nbytes > 16 or -buf.len() < nbytes

-
Examples
-

Write and read n-length signed numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 3];
-LittleEndian::write_int128(&mut buf, -1_000, 3);
-assert_eq!(-1_000, LittleEndian::read_int128(&buf, 3));
-
source

fn read_f32(buf: &[u8]) -> f32

Reads a IEEE754 single-precision (4 bytes) floating point number.

-
Panics
-

Panics when buf.len() < 4.

-
Examples
-

Write and read f32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let e = 2.71828;
-let mut buf = [0; 4];
-LittleEndian::write_f32(&mut buf, e);
-assert_eq!(e, LittleEndian::read_f32(&buf));
-
source

fn read_f64(buf: &[u8]) -> f64

Reads a IEEE754 double-precision (8 bytes) floating point number.

-
Panics
-

Panics when buf.len() < 8.

-
Examples
-

Write and read f64 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let phi = 1.6180339887;
-let mut buf = [0; 8];
-LittleEndian::write_f64(&mut buf, phi);
-assert_eq!(phi, LittleEndian::read_f64(&buf));
-
source

fn write_i16(buf: &mut [u8], n: i16)

Writes a signed 16 bit integer n to buf.

-
Panics
-

Panics when buf.len() < 2.

-
Examples
-

Write and read i16 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 2];
-LittleEndian::write_i16(&mut buf, -1_000);
-assert_eq!(-1_000, LittleEndian::read_i16(&buf));
-
source

fn write_i24(buf: &mut [u8], n: i32)

Writes a signed 24 bit integer n to buf, stored in i32.

-
Panics
-

Panics when buf.len() < 3.

-
Examples
-

Write and read 24 bit i32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 3];
-LittleEndian::write_i24(&mut buf, -1_000_000);
-assert_eq!(-1_000_000, LittleEndian::read_i24(&buf));
-
source

fn write_i32(buf: &mut [u8], n: i32)

Writes a signed 32 bit integer n to buf.

-
Panics
-

Panics when buf.len() < 4.

-
Examples
-

Write and read i32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 4];
-LittleEndian::write_i32(&mut buf, -1_000_000);
-assert_eq!(-1_000_000, LittleEndian::read_i32(&buf));
-
source

fn write_i48(buf: &mut [u8], n: i64)

Writes a signed 48 bit integer n to buf, stored in i64.

-
Panics
-

Panics when buf.len() < 6.

-
Examples
-

Write and read 48 bit i64 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 6];
-LittleEndian::write_i48(&mut buf, -1_000_000_000_000);
-assert_eq!(-1_000_000_000_000, LittleEndian::read_i48(&buf));
-
source

fn write_i64(buf: &mut [u8], n: i64)

Writes a signed 64 bit integer n to buf.

-
Panics
-

Panics when buf.len() < 8.

-
Examples
-

Write and read i64 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 8];
-LittleEndian::write_i64(&mut buf, -1_000_000_000);
-assert_eq!(-1_000_000_000, LittleEndian::read_i64(&buf));
-
source

fn write_i128(buf: &mut [u8], n: i128)

Writes a signed 128 bit integer n to buf.

-
Panics
-

Panics when buf.len() < 16.

-
Examples
-

Write and read n-byte i128 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 16];
-LittleEndian::write_i128(&mut buf, -1_000_000_000);
-assert_eq!(-1_000_000_000, LittleEndian::read_i128(&buf));
-
source

fn write_int(buf: &mut [u8], n: i64, nbytes: usize)

Writes a signed integer n to buf using only nbytes.

-
Panics
-

If n is not representable in nbytes, or if nbytes is > 8, then -this method panics.

-
Examples
-

Write and read an n-byte number in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 3];
-LittleEndian::write_int(&mut buf, -1_000, 3);
-assert_eq!(-1_000, LittleEndian::read_int(&buf, 3));
-
source

fn write_int128(buf: &mut [u8], n: i128, nbytes: usize)

Writes a signed integer n to buf using only nbytes.

-
Panics
-

If n is not representable in nbytes, or if nbytes is > 16, then -this method panics.

-
Examples
-

Write and read n-length signed numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut buf = [0; 3];
-LittleEndian::write_int128(&mut buf, -1_000, 3);
-assert_eq!(-1_000, LittleEndian::read_int128(&buf, 3));
-
source

fn write_f32(buf: &mut [u8], n: f32)

Writes a IEEE754 single-precision (4 bytes) floating point number.

-
Panics
-

Panics when buf.len() < 4.

-
Examples
-

Write and read f32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let e = 2.71828;
-let mut buf = [0; 4];
-LittleEndian::write_f32(&mut buf, e);
-assert_eq!(e, LittleEndian::read_f32(&buf));
-
source

fn write_f64(buf: &mut [u8], n: f64)

Writes a IEEE754 double-precision (8 bytes) floating point number.

-
Panics
-

Panics when buf.len() < 8.

-
Examples
-

Write and read f64 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let phi = 1.6180339887;
-let mut buf = [0; 8];
-LittleEndian::write_f64(&mut buf, phi);
-assert_eq!(phi, LittleEndian::read_f64(&buf));
-
source

fn read_i16_into(src: &[u8], dst: &mut [i16])

Reads signed 16 bit integers from src to dst.

-
Panics
-

Panics when buf.len() != 2*dst.len().

-
Examples
-

Write and read i16 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 8];
-let numbers_given = [1, 2, 0x0f, 0xee];
-LittleEndian::write_i16_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0; 4];
-LittleEndian::read_i16_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn read_i32_into(src: &[u8], dst: &mut [i32])

Reads signed 32 bit integers from src into dst.

-
Panics
-

Panics when src.len() != 4*dst.len().

-
Examples
-

Write and read i32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 16];
-let numbers_given = [1, 2, 0xf00f, 0xffee];
-LittleEndian::write_i32_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0; 4];
-LittleEndian::read_i32_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn read_i64_into(src: &[u8], dst: &mut [i64])

Reads signed 64 bit integers from src into dst.

-
Panics
-

Panics when src.len() != 8*dst.len().

-
Examples
-

Write and read i64 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 32];
-let numbers_given = [1, 2, 0xf00f, 0xffee];
-LittleEndian::write_i64_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0; 4];
-LittleEndian::read_i64_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn read_i128_into(src: &[u8], dst: &mut [i128])

Reads signed 128 bit integers from src into dst.

-
Panics
-

Panics when src.len() != 16*dst.len().

-
Examples
-

Write and read i128 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 64];
-let numbers_given = [1, 2, 0xf00f, 0xffee];
-LittleEndian::write_i128_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0; 4];
-LittleEndian::read_i128_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn read_f32_into(src: &[u8], dst: &mut [f32])

Reads IEEE754 single-precision (4 bytes) floating point numbers from -src into dst.

-
Panics
-

Panics when src.len() != 4*dst.len().

-
Examples
-

Write and read f32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 16];
-let numbers_given = [1.0, 2.0, 31.312e31, -11.32e19];
-LittleEndian::write_f32_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0.0; 4];
-LittleEndian::read_f32_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn read_f32_into_unchecked(src: &[u8], dst: &mut [f32])

👎Deprecated since 1.3.0: please use read_f32_into instead

DEPRECATED.

-

This method is deprecated. Use read_f32_into instead. -Reads IEEE754 single-precision (4 bytes) floating point numbers from -src into dst.

-
Panics
-

Panics when src.len() != 4*dst.len().

-
Examples
-

Write and read f32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 16];
-let numbers_given = [1.0, 2.0, 31.312e31, -11.32e19];
-LittleEndian::write_f32_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0.0; 4];
-LittleEndian::read_f32_into_unchecked(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn read_f64_into(src: &[u8], dst: &mut [f64])

Reads IEEE754 single-precision (4 bytes) floating point numbers from -src into dst.

-
Panics
-

Panics when src.len() != 8*dst.len().

-
Examples
-

Write and read f64 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 32];
-let numbers_given = [1.0, 2.0, 31.312e211, -11.32e91];
-LittleEndian::write_f64_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0.0; 4];
-LittleEndian::read_f64_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn read_f64_into_unchecked(src: &[u8], dst: &mut [f64])

👎Deprecated since 1.3.0: please use read_f64_into instead

DEPRECATED.

-

This method is deprecated. Use read_f64_into instead.

-

Reads IEEE754 single-precision (4 bytes) floating point numbers from -src into dst.

-
Panics
-

Panics when src.len() != 8*dst.len().

-
Examples
-

Write and read f64 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 32];
-let numbers_given = [1.0, 2.0, 31.312e211, -11.32e91];
-LittleEndian::write_f64_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0.0; 4];
-LittleEndian::read_f64_into_unchecked(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn write_i8_into(src: &[i8], dst: &mut [u8])

Writes signed 8 bit integers from src into dst.

-

Note that since each i8 is a single byte, no byte order conversions -are used. This method is included because it provides a safe, simple -way for the caller to write from a &[i8] buffer. (Without this -method, the caller would have to either use unsafe code or convert -each byte to u8 individually.)

-
Panics
-

Panics when buf.len() != src.len().

-
Examples
-

Write and read i8 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian, ReadBytesExt};
-
-let mut bytes = [0; 4];
-let numbers_given = [1, 2, 0xf, 0xe];
-LittleEndian::write_i8_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0; 4];
-bytes.as_ref().read_i8_into(&mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn write_i16_into(src: &[i16], dst: &mut [u8])

Writes signed 16 bit integers from src into dst.

-
Panics
-

Panics when buf.len() != 2*src.len().

-
Examples
-

Write and read i16 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 8];
-let numbers_given = [1, 2, 0x0f, 0xee];
-LittleEndian::write_i16_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0; 4];
-LittleEndian::read_i16_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn write_i32_into(src: &[i32], dst: &mut [u8])

Writes signed 32 bit integers from src into dst.

-
Panics
-

Panics when dst.len() != 4*src.len().

-
Examples
-

Write and read i32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 16];
-let numbers_given = [1, 2, 0xf00f, 0xffee];
-LittleEndian::write_i32_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0; 4];
-LittleEndian::read_i32_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn write_i64_into(src: &[i64], dst: &mut [u8])

Writes signed 64 bit integers from src into dst.

-
Panics
-

Panics when dst.len() != 8*src.len().

-
Examples
-

Write and read i64 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 32];
-let numbers_given = [1, 2, 0xf00f, 0xffee];
-LittleEndian::write_i64_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0; 4];
-LittleEndian::read_i64_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn write_i128_into(src: &[i128], dst: &mut [u8])

Writes signed 128 bit integers from src into dst.

-
Panics
-

Panics when dst.len() != 16*src.len().

-
Examples
-

Write and read i128 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 64];
-let numbers_given = [1, 2, 0xf00f, 0xffee];
-LittleEndian::write_i128_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0; 4];
-LittleEndian::read_i128_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn write_f32_into(src: &[f32], dst: &mut [u8])

Writes IEEE754 single-precision (4 bytes) floating point numbers from -src into dst.

-
Panics
-

Panics when src.len() != 4*dst.len().

-
Examples
-

Write and read f32 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 16];
-let numbers_given = [1.0, 2.0, 31.312e31, -11.32e19];
-LittleEndian::write_f32_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0.0; 4];
-LittleEndian::read_f32_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn write_f64_into(src: &[f64], dst: &mut [u8])

Writes IEEE754 double-precision (8 bytes) floating point numbers from -src into dst.

-
Panics
-

Panics when src.len() != 8*dst.len().

-
Examples
-

Write and read f64 numbers in little endian order:

- -
use byteorder::{ByteOrder, LittleEndian};
-
-let mut bytes = [0; 32];
-let numbers_given = [1.0, 2.0, 31.312e211, -11.32e91];
-LittleEndian::write_f64_into(&numbers_given, &mut bytes);
-
-let mut numbers_got = [0.0; 4];
-LittleEndian::read_f64_into(&bytes, &mut numbers_got);
-assert_eq!(numbers_given, numbers_got);
-
source

fn from_slice_i16(src: &mut [i16])

Converts the given slice of signed 16 bit integers to a particular -endianness.

-

If the endianness matches the endianness of the host platform, then -this is a no-op.

-
Examples
-

Convert the host platform’s endianness to big-endian:

- -
use byteorder::{ByteOrder, BigEndian};
-
-let mut numbers = [5, 6500];
-BigEndian::from_slice_i16(&mut numbers);
-assert_eq!(numbers, [5i16.to_be(), 6500i16.to_be()]);
-
source

fn from_slice_i32(src: &mut [i32])

Converts the given slice of signed 32 bit integers to a particular -endianness.

-

If the endianness matches the endianness of the host platform, then -this is a no-op.

-
Examples
-

Convert the host platform’s endianness to big-endian:

- -
use byteorder::{ByteOrder, BigEndian};
-
-let mut numbers = [5, 65000];
-BigEndian::from_slice_i32(&mut numbers);
-assert_eq!(numbers, [5i32.to_be(), 65000i32.to_be()]);
-
source

fn from_slice_i64(src: &mut [i64])

Converts the given slice of signed 64 bit integers to a particular -endianness.

-

If the endianness matches the endianness of the host platform, then -this is a no-op.

-
Examples
-

Convert the host platform’s endianness to big-endian:

- -
use byteorder::{ByteOrder, BigEndian};
-
-let mut numbers = [5, 65000];
-BigEndian::from_slice_i64(&mut numbers);
-assert_eq!(numbers, [5i64.to_be(), 65000i64.to_be()]);
-
source

fn from_slice_i128(src: &mut [i128])

Converts the given slice of signed 128 bit integers to a particular -endianness.

-

If the endianness matches the endianness of the host platform, then -this is a no-op.

-
Examples
-

Convert the host platform’s endianness to big-endian:

- -
use byteorder::{ByteOrder, BigEndian};
-
-let mut numbers = [5, 65000];
-BigEndian::from_slice_i128(&mut numbers);
-assert_eq!(numbers, [5i128.to_be(), 65000i128.to_be()]);
-

Implementors§

\ No newline at end of file diff --git a/docs/doc/byteorder/type.BE.html b/docs/doc/byteorder/type.BE.html deleted file mode 100644 index a2da622..0000000 --- a/docs/doc/byteorder/type.BE.html +++ /dev/null @@ -1,25 +0,0 @@ -BE in byteorder - Rust

Type Alias byteorder::BE

source ·
pub type BE = BigEndian;
Expand description

A type alias for BigEndian.

-

Aliased Type§

enum BE {}

Variants§

Trait Implementations§

source§

impl ByteOrder for BigEndian

source§

fn read_u16(buf: &[u8]) -> u16

Reads an unsigned 16 bit integer from buf. Read more
source§

fn read_u32(buf: &[u8]) -> u32

Reads an unsigned 32 bit integer from buf. Read more
source§

fn read_u64(buf: &[u8]) -> u64

Reads an unsigned 64 bit integer from buf. Read more
source§

fn read_u128(buf: &[u8]) -> u128

Reads an unsigned 128 bit integer from buf. Read more
source§

fn read_uint(buf: &[u8], nbytes: usize) -> u64

Reads an unsigned n-bytes integer from buf. Read more
source§

fn read_uint128(buf: &[u8], nbytes: usize) -> u128

Reads an unsigned n-bytes integer from buf. Read more
source§

fn write_u16(buf: &mut [u8], n: u16)

Writes an unsigned 16 bit integer n to buf. Read more
source§

fn write_u32(buf: &mut [u8], n: u32)

Writes an unsigned 32 bit integer n to buf. Read more
source§

fn write_u64(buf: &mut [u8], n: u64)

Writes an unsigned 64 bit integer n to buf. Read more
source§

fn write_u128(buf: &mut [u8], n: u128)

Writes an unsigned 128 bit integer n to buf. Read more
source§

fn write_uint(buf: &mut [u8], n: u64, nbytes: usize)

Writes an unsigned integer n to buf using only nbytes. Read more
source§

fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize)

Writes an unsigned integer n to buf using only nbytes. Read more
source§

fn read_u16_into(src: &[u8], dst: &mut [u16])

Reads unsigned 16 bit integers from src into dst. Read more
source§

fn read_u32_into(src: &[u8], dst: &mut [u32])

Reads unsigned 32 bit integers from src into dst. Read more
source§

fn read_u64_into(src: &[u8], dst: &mut [u64])

Reads unsigned 64 bit integers from src into dst. Read more
source§

fn read_u128_into(src: &[u8], dst: &mut [u128])

Reads unsigned 128 bit integers from src into dst. Read more
source§

fn write_u16_into(src: &[u16], dst: &mut [u8])

Writes unsigned 16 bit integers from src into dst. Read more
source§

fn write_u32_into(src: &[u32], dst: &mut [u8])

Writes unsigned 32 bit integers from src into dst. Read more
source§

fn write_u64_into(src: &[u64], dst: &mut [u8])

Writes unsigned 64 bit integers from src into dst. Read more
source§

fn write_u128_into(src: &[u128], dst: &mut [u8])

Writes unsigned 128 bit integers from src into dst. Read more
source§

fn from_slice_u16(numbers: &mut [u16])

Converts the given slice of unsigned 16 bit integers to a particular -endianness. Read more
source§

fn from_slice_u32(numbers: &mut [u32])

Converts the given slice of unsigned 32 bit integers to a particular -endianness. Read more
source§

fn from_slice_u64(numbers: &mut [u64])

Converts the given slice of unsigned 64 bit integers to a particular -endianness. Read more
source§

fn from_slice_u128(numbers: &mut [u128])

Converts the given slice of unsigned 128 bit integers to a particular -endianness. Read more
source§

fn from_slice_f32(numbers: &mut [f32])

Converts the given slice of IEEE754 single-precision (4 bytes) floating -point numbers to a particular endianness. Read more
source§

fn from_slice_f64(numbers: &mut [f64])

Converts the given slice of IEEE754 double-precision (8 bytes) floating -point numbers to a particular endianness. Read more
source§

fn read_u24(buf: &[u8]) -> u32

Reads an unsigned 24 bit integer from buf, stored in u32. Read more
source§

fn read_u48(buf: &[u8]) -> u64

Reads an unsigned 48 bit integer from buf, stored in u64. Read more
source§

fn write_u24(buf: &mut [u8], n: u32)

Writes an unsigned 24 bit integer n to buf, stored in u32. Read more
source§

fn write_u48(buf: &mut [u8], n: u64)

Writes an unsigned 48 bit integer n to buf, stored in u64. Read more
source§

fn read_i16(buf: &[u8]) -> i16

Reads a signed 16 bit integer from buf. Read more
source§

fn read_i24(buf: &[u8]) -> i32

Reads a signed 24 bit integer from buf, stored in i32. Read more
source§

fn read_i32(buf: &[u8]) -> i32

Reads a signed 32 bit integer from buf. Read more
source§

fn read_i48(buf: &[u8]) -> i64

Reads a signed 48 bit integer from buf, stored in i64. Read more
source§

fn read_i64(buf: &[u8]) -> i64

Reads a signed 64 bit integer from buf. Read more
source§

fn read_i128(buf: &[u8]) -> i128

Reads a signed 128 bit integer from buf. Read more
source§

fn read_int(buf: &[u8], nbytes: usize) -> i64

Reads a signed n-bytes integer from buf. Read more
source§

fn read_int128(buf: &[u8], nbytes: usize) -> i128

Reads a signed n-bytes integer from buf. Read more
source§

fn read_f32(buf: &[u8]) -> f32

Reads a IEEE754 single-precision (4 bytes) floating point number. Read more
source§

fn read_f64(buf: &[u8]) -> f64

Reads a IEEE754 double-precision (8 bytes) floating point number. Read more
source§

fn write_i16(buf: &mut [u8], n: i16)

Writes a signed 16 bit integer n to buf. Read more
source§

fn write_i24(buf: &mut [u8], n: i32)

Writes a signed 24 bit integer n to buf, stored in i32. Read more
source§

fn write_i32(buf: &mut [u8], n: i32)

Writes a signed 32 bit integer n to buf. Read more
source§

fn write_i48(buf: &mut [u8], n: i64)

Writes a signed 48 bit integer n to buf, stored in i64. Read more
source§

fn write_i64(buf: &mut [u8], n: i64)

Writes a signed 64 bit integer n to buf. Read more
source§

fn write_i128(buf: &mut [u8], n: i128)

Writes a signed 128 bit integer n to buf. Read more
source§

fn write_int(buf: &mut [u8], n: i64, nbytes: usize)

Writes a signed integer n to buf using only nbytes. Read more
source§

fn write_int128(buf: &mut [u8], n: i128, nbytes: usize)

Writes a signed integer n to buf using only nbytes. Read more
source§

fn write_f32(buf: &mut [u8], n: f32)

Writes a IEEE754 single-precision (4 bytes) floating point number. Read more
source§

fn write_f64(buf: &mut [u8], n: f64)

Writes a IEEE754 double-precision (8 bytes) floating point number. Read more
source§

fn read_i16_into(src: &[u8], dst: &mut [i16])

Reads signed 16 bit integers from src to dst. Read more
source§

fn read_i32_into(src: &[u8], dst: &mut [i32])

Reads signed 32 bit integers from src into dst. Read more
source§

fn read_i64_into(src: &[u8], dst: &mut [i64])

Reads signed 64 bit integers from src into dst. Read more
source§

fn read_i128_into(src: &[u8], dst: &mut [i128])

Reads signed 128 bit integers from src into dst. Read more
source§

fn read_f32_into(src: &[u8], dst: &mut [f32])

Reads IEEE754 single-precision (4 bytes) floating point numbers from -src into dst. Read more
source§

fn read_f32_into_unchecked(src: &[u8], dst: &mut [f32])

👎Deprecated since 1.3.0: please use read_f32_into instead
DEPRECATED. Read more
source§

fn read_f64_into(src: &[u8], dst: &mut [f64])

Reads IEEE754 single-precision (4 bytes) floating point numbers from -src into dst. Read more
source§

fn read_f64_into_unchecked(src: &[u8], dst: &mut [f64])

👎Deprecated since 1.3.0: please use read_f64_into instead
DEPRECATED. Read more
source§

fn write_i8_into(src: &[i8], dst: &mut [u8])

Writes signed 8 bit integers from src into dst. Read more
source§

fn write_i16_into(src: &[i16], dst: &mut [u8])

Writes signed 16 bit integers from src into dst. Read more
source§

fn write_i32_into(src: &[i32], dst: &mut [u8])

Writes signed 32 bit integers from src into dst. Read more
source§

fn write_i64_into(src: &[i64], dst: &mut [u8])

Writes signed 64 bit integers from src into dst. Read more
source§

fn write_i128_into(src: &[i128], dst: &mut [u8])

Writes signed 128 bit integers from src into dst. Read more
source§

fn write_f32_into(src: &[f32], dst: &mut [u8])

Writes IEEE754 single-precision (4 bytes) floating point numbers from -src into dst. Read more
source§

fn write_f64_into(src: &[f64], dst: &mut [u8])

Writes IEEE754 double-precision (8 bytes) floating point numbers from -src into dst. Read more
source§

fn from_slice_i16(src: &mut [i16])

Converts the given slice of signed 16 bit integers to a particular -endianness. Read more
source§

fn from_slice_i32(src: &mut [i32])

Converts the given slice of signed 32 bit integers to a particular -endianness. Read more
source§

fn from_slice_i64(src: &mut [i64])

Converts the given slice of signed 64 bit integers to a particular -endianness. Read more
source§

fn from_slice_i128(src: &mut [i128])

Converts the given slice of signed 128 bit integers to a particular -endianness. Read more
source§

impl Clone for BigEndian

source§

fn clone(&self) -> BigEndian

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BigEndian

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for BigEndian

source§

fn default() -> BigEndian

Returns the “default value” for a type. Read more
source§

impl Hash for BigEndian

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl Ord for BigEndian

source§

fn cmp(&self, other: &BigEndian) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<BigEndian> for BigEndian

source§

fn eq(&self, other: &BigEndian) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<BigEndian> for BigEndian

source§

fn partial_cmp(&self, other: &BigEndian) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for BigEndian

source§

impl Eq for BigEndian

source§

impl StructuralEq for BigEndian

source§

impl StructuralPartialEq for BigEndian

\ No newline at end of file diff --git a/docs/doc/byteorder/type.LE.html b/docs/doc/byteorder/type.LE.html deleted file mode 100644 index e987909..0000000 --- a/docs/doc/byteorder/type.LE.html +++ /dev/null @@ -1,25 +0,0 @@ -LE in byteorder - Rust

Type Alias byteorder::LE

source ·
pub type LE = LittleEndian;
Expand description

A type alias for LittleEndian.

-

Aliased Type§

enum LE {}

Variants§

Trait Implementations§

source§

impl ByteOrder for LittleEndian

source§

fn read_u16(buf: &[u8]) -> u16

Reads an unsigned 16 bit integer from buf. Read more
source§

fn read_u32(buf: &[u8]) -> u32

Reads an unsigned 32 bit integer from buf. Read more
source§

fn read_u64(buf: &[u8]) -> u64

Reads an unsigned 64 bit integer from buf. Read more
source§

fn read_u128(buf: &[u8]) -> u128

Reads an unsigned 128 bit integer from buf. Read more
source§

fn read_uint(buf: &[u8], nbytes: usize) -> u64

Reads an unsigned n-bytes integer from buf. Read more
source§

fn read_uint128(buf: &[u8], nbytes: usize) -> u128

Reads an unsigned n-bytes integer from buf. Read more
source§

fn write_u16(buf: &mut [u8], n: u16)

Writes an unsigned 16 bit integer n to buf. Read more
source§

fn write_u32(buf: &mut [u8], n: u32)

Writes an unsigned 32 bit integer n to buf. Read more
source§

fn write_u64(buf: &mut [u8], n: u64)

Writes an unsigned 64 bit integer n to buf. Read more
source§

fn write_u128(buf: &mut [u8], n: u128)

Writes an unsigned 128 bit integer n to buf. Read more
source§

fn write_uint(buf: &mut [u8], n: u64, nbytes: usize)

Writes an unsigned integer n to buf using only nbytes. Read more
source§

fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize)

Writes an unsigned integer n to buf using only nbytes. Read more
source§

fn read_u16_into(src: &[u8], dst: &mut [u16])

Reads unsigned 16 bit integers from src into dst. Read more
source§

fn read_u32_into(src: &[u8], dst: &mut [u32])

Reads unsigned 32 bit integers from src into dst. Read more
source§

fn read_u64_into(src: &[u8], dst: &mut [u64])

Reads unsigned 64 bit integers from src into dst. Read more
source§

fn read_u128_into(src: &[u8], dst: &mut [u128])

Reads unsigned 128 bit integers from src into dst. Read more
source§

fn write_u16_into(src: &[u16], dst: &mut [u8])

Writes unsigned 16 bit integers from src into dst. Read more
source§

fn write_u32_into(src: &[u32], dst: &mut [u8])

Writes unsigned 32 bit integers from src into dst. Read more
source§

fn write_u64_into(src: &[u64], dst: &mut [u8])

Writes unsigned 64 bit integers from src into dst. Read more
source§

fn write_u128_into(src: &[u128], dst: &mut [u8])

Writes unsigned 128 bit integers from src into dst. Read more
source§

fn from_slice_u16(numbers: &mut [u16])

Converts the given slice of unsigned 16 bit integers to a particular -endianness. Read more
source§

fn from_slice_u32(numbers: &mut [u32])

Converts the given slice of unsigned 32 bit integers to a particular -endianness. Read more
source§

fn from_slice_u64(numbers: &mut [u64])

Converts the given slice of unsigned 64 bit integers to a particular -endianness. Read more
source§

fn from_slice_u128(numbers: &mut [u128])

Converts the given slice of unsigned 128 bit integers to a particular -endianness. Read more
source§

fn from_slice_f32(numbers: &mut [f32])

Converts the given slice of IEEE754 single-precision (4 bytes) floating -point numbers to a particular endianness. Read more
source§

fn from_slice_f64(numbers: &mut [f64])

Converts the given slice of IEEE754 double-precision (8 bytes) floating -point numbers to a particular endianness. Read more
source§

fn read_u24(buf: &[u8]) -> u32

Reads an unsigned 24 bit integer from buf, stored in u32. Read more
source§

fn read_u48(buf: &[u8]) -> u64

Reads an unsigned 48 bit integer from buf, stored in u64. Read more
source§

fn write_u24(buf: &mut [u8], n: u32)

Writes an unsigned 24 bit integer n to buf, stored in u32. Read more
source§

fn write_u48(buf: &mut [u8], n: u64)

Writes an unsigned 48 bit integer n to buf, stored in u64. Read more
source§

fn read_i16(buf: &[u8]) -> i16

Reads a signed 16 bit integer from buf. Read more
source§

fn read_i24(buf: &[u8]) -> i32

Reads a signed 24 bit integer from buf, stored in i32. Read more
source§

fn read_i32(buf: &[u8]) -> i32

Reads a signed 32 bit integer from buf. Read more
source§

fn read_i48(buf: &[u8]) -> i64

Reads a signed 48 bit integer from buf, stored in i64. Read more
source§

fn read_i64(buf: &[u8]) -> i64

Reads a signed 64 bit integer from buf. Read more
source§

fn read_i128(buf: &[u8]) -> i128

Reads a signed 128 bit integer from buf. Read more
source§

fn read_int(buf: &[u8], nbytes: usize) -> i64

Reads a signed n-bytes integer from buf. Read more
source§

fn read_int128(buf: &[u8], nbytes: usize) -> i128

Reads a signed n-bytes integer from buf. Read more
source§

fn read_f32(buf: &[u8]) -> f32

Reads a IEEE754 single-precision (4 bytes) floating point number. Read more
source§

fn read_f64(buf: &[u8]) -> f64

Reads a IEEE754 double-precision (8 bytes) floating point number. Read more
source§

fn write_i16(buf: &mut [u8], n: i16)

Writes a signed 16 bit integer n to buf. Read more
source§

fn write_i24(buf: &mut [u8], n: i32)

Writes a signed 24 bit integer n to buf, stored in i32. Read more
source§

fn write_i32(buf: &mut [u8], n: i32)

Writes a signed 32 bit integer n to buf. Read more
source§

fn write_i48(buf: &mut [u8], n: i64)

Writes a signed 48 bit integer n to buf, stored in i64. Read more
source§

fn write_i64(buf: &mut [u8], n: i64)

Writes a signed 64 bit integer n to buf. Read more
source§

fn write_i128(buf: &mut [u8], n: i128)

Writes a signed 128 bit integer n to buf. Read more
source§

fn write_int(buf: &mut [u8], n: i64, nbytes: usize)

Writes a signed integer n to buf using only nbytes. Read more
source§

fn write_int128(buf: &mut [u8], n: i128, nbytes: usize)

Writes a signed integer n to buf using only nbytes. Read more
source§

fn write_f32(buf: &mut [u8], n: f32)

Writes a IEEE754 single-precision (4 bytes) floating point number. Read more
source§

fn write_f64(buf: &mut [u8], n: f64)

Writes a IEEE754 double-precision (8 bytes) floating point number. Read more
source§

fn read_i16_into(src: &[u8], dst: &mut [i16])

Reads signed 16 bit integers from src to dst. Read more
source§

fn read_i32_into(src: &[u8], dst: &mut [i32])

Reads signed 32 bit integers from src into dst. Read more
source§

fn read_i64_into(src: &[u8], dst: &mut [i64])

Reads signed 64 bit integers from src into dst. Read more
source§

fn read_i128_into(src: &[u8], dst: &mut [i128])

Reads signed 128 bit integers from src into dst. Read more
source§

fn read_f32_into(src: &[u8], dst: &mut [f32])

Reads IEEE754 single-precision (4 bytes) floating point numbers from -src into dst. Read more
source§

fn read_f32_into_unchecked(src: &[u8], dst: &mut [f32])

👎Deprecated since 1.3.0: please use read_f32_into instead
DEPRECATED. Read more
source§

fn read_f64_into(src: &[u8], dst: &mut [f64])

Reads IEEE754 single-precision (4 bytes) floating point numbers from -src into dst. Read more
source§

fn read_f64_into_unchecked(src: &[u8], dst: &mut [f64])

👎Deprecated since 1.3.0: please use read_f64_into instead
DEPRECATED. Read more
source§

fn write_i8_into(src: &[i8], dst: &mut [u8])

Writes signed 8 bit integers from src into dst. Read more
source§

fn write_i16_into(src: &[i16], dst: &mut [u8])

Writes signed 16 bit integers from src into dst. Read more
source§

fn write_i32_into(src: &[i32], dst: &mut [u8])

Writes signed 32 bit integers from src into dst. Read more
source§

fn write_i64_into(src: &[i64], dst: &mut [u8])

Writes signed 64 bit integers from src into dst. Read more
source§

fn write_i128_into(src: &[i128], dst: &mut [u8])

Writes signed 128 bit integers from src into dst. Read more
source§

fn write_f32_into(src: &[f32], dst: &mut [u8])

Writes IEEE754 single-precision (4 bytes) floating point numbers from -src into dst. Read more
source§

fn write_f64_into(src: &[f64], dst: &mut [u8])

Writes IEEE754 double-precision (8 bytes) floating point numbers from -src into dst. Read more
source§

fn from_slice_i16(src: &mut [i16])

Converts the given slice of signed 16 bit integers to a particular -endianness. Read more
source§

fn from_slice_i32(src: &mut [i32])

Converts the given slice of signed 32 bit integers to a particular -endianness. Read more
source§

fn from_slice_i64(src: &mut [i64])

Converts the given slice of signed 64 bit integers to a particular -endianness. Read more
source§

fn from_slice_i128(src: &mut [i128])

Converts the given slice of signed 128 bit integers to a particular -endianness. Read more
source§

impl Clone for LittleEndian

source§

fn clone(&self) -> LittleEndian

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LittleEndian

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for LittleEndian

source§

fn default() -> LittleEndian

Returns the “default value” for a type. Read more
source§

impl Hash for LittleEndian

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl Ord for LittleEndian

source§

fn cmp(&self, other: &LittleEndian) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<LittleEndian> for LittleEndian

source§

fn eq(&self, other: &LittleEndian) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<LittleEndian> for LittleEndian

source§

fn partial_cmp(&self, other: &LittleEndian) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for LittleEndian

source§

impl Eq for LittleEndian

source§

impl StructuralEq for LittleEndian

source§

impl StructuralPartialEq for LittleEndian

\ No newline at end of file diff --git a/docs/doc/byteorder/type.NativeEndian.html b/docs/doc/byteorder/type.NativeEndian.html deleted file mode 100644 index b9fe0a1..0000000 --- a/docs/doc/byteorder/type.NativeEndian.html +++ /dev/null @@ -1,28 +0,0 @@ -NativeEndian in byteorder - Rust

Type Alias byteorder::NativeEndian

source ·
pub type NativeEndian = LittleEndian;
Expand description

Defines system native-endian serialization.

-

Note that this type has no value constructor. It is used purely at the -type level.

-

On this platform, this is an alias for LittleEndian.

-

Aliased Type§

enum NativeEndian {}

Variants§

Trait Implementations§

source§

impl ByteOrder for LittleEndian

source§

fn read_u16(buf: &[u8]) -> u16

Reads an unsigned 16 bit integer from buf. Read more
source§

fn read_u32(buf: &[u8]) -> u32

Reads an unsigned 32 bit integer from buf. Read more
source§

fn read_u64(buf: &[u8]) -> u64

Reads an unsigned 64 bit integer from buf. Read more
source§

fn read_u128(buf: &[u8]) -> u128

Reads an unsigned 128 bit integer from buf. Read more
source§

fn read_uint(buf: &[u8], nbytes: usize) -> u64

Reads an unsigned n-bytes integer from buf. Read more
source§

fn read_uint128(buf: &[u8], nbytes: usize) -> u128

Reads an unsigned n-bytes integer from buf. Read more
source§

fn write_u16(buf: &mut [u8], n: u16)

Writes an unsigned 16 bit integer n to buf. Read more
source§

fn write_u32(buf: &mut [u8], n: u32)

Writes an unsigned 32 bit integer n to buf. Read more
source§

fn write_u64(buf: &mut [u8], n: u64)

Writes an unsigned 64 bit integer n to buf. Read more
source§

fn write_u128(buf: &mut [u8], n: u128)

Writes an unsigned 128 bit integer n to buf. Read more
source§

fn write_uint(buf: &mut [u8], n: u64, nbytes: usize)

Writes an unsigned integer n to buf using only nbytes. Read more
source§

fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize)

Writes an unsigned integer n to buf using only nbytes. Read more
source§

fn read_u16_into(src: &[u8], dst: &mut [u16])

Reads unsigned 16 bit integers from src into dst. Read more
source§

fn read_u32_into(src: &[u8], dst: &mut [u32])

Reads unsigned 32 bit integers from src into dst. Read more
source§

fn read_u64_into(src: &[u8], dst: &mut [u64])

Reads unsigned 64 bit integers from src into dst. Read more
source§

fn read_u128_into(src: &[u8], dst: &mut [u128])

Reads unsigned 128 bit integers from src into dst. Read more
source§

fn write_u16_into(src: &[u16], dst: &mut [u8])

Writes unsigned 16 bit integers from src into dst. Read more
source§

fn write_u32_into(src: &[u32], dst: &mut [u8])

Writes unsigned 32 bit integers from src into dst. Read more
source§

fn write_u64_into(src: &[u64], dst: &mut [u8])

Writes unsigned 64 bit integers from src into dst. Read more
source§

fn write_u128_into(src: &[u128], dst: &mut [u8])

Writes unsigned 128 bit integers from src into dst. Read more
source§

fn from_slice_u16(numbers: &mut [u16])

Converts the given slice of unsigned 16 bit integers to a particular -endianness. Read more
source§

fn from_slice_u32(numbers: &mut [u32])

Converts the given slice of unsigned 32 bit integers to a particular -endianness. Read more
source§

fn from_slice_u64(numbers: &mut [u64])

Converts the given slice of unsigned 64 bit integers to a particular -endianness. Read more
source§

fn from_slice_u128(numbers: &mut [u128])

Converts the given slice of unsigned 128 bit integers to a particular -endianness. Read more
source§

fn from_slice_f32(numbers: &mut [f32])

Converts the given slice of IEEE754 single-precision (4 bytes) floating -point numbers to a particular endianness. Read more
source§

fn from_slice_f64(numbers: &mut [f64])

Converts the given slice of IEEE754 double-precision (8 bytes) floating -point numbers to a particular endianness. Read more
source§

fn read_u24(buf: &[u8]) -> u32

Reads an unsigned 24 bit integer from buf, stored in u32. Read more
source§

fn read_u48(buf: &[u8]) -> u64

Reads an unsigned 48 bit integer from buf, stored in u64. Read more
source§

fn write_u24(buf: &mut [u8], n: u32)

Writes an unsigned 24 bit integer n to buf, stored in u32. Read more
source§

fn write_u48(buf: &mut [u8], n: u64)

Writes an unsigned 48 bit integer n to buf, stored in u64. Read more
source§

fn read_i16(buf: &[u8]) -> i16

Reads a signed 16 bit integer from buf. Read more
source§

fn read_i24(buf: &[u8]) -> i32

Reads a signed 24 bit integer from buf, stored in i32. Read more
source§

fn read_i32(buf: &[u8]) -> i32

Reads a signed 32 bit integer from buf. Read more
source§

fn read_i48(buf: &[u8]) -> i64

Reads a signed 48 bit integer from buf, stored in i64. Read more
source§

fn read_i64(buf: &[u8]) -> i64

Reads a signed 64 bit integer from buf. Read more
source§

fn read_i128(buf: &[u8]) -> i128

Reads a signed 128 bit integer from buf. Read more
source§

fn read_int(buf: &[u8], nbytes: usize) -> i64

Reads a signed n-bytes integer from buf. Read more
source§

fn read_int128(buf: &[u8], nbytes: usize) -> i128

Reads a signed n-bytes integer from buf. Read more
source§

fn read_f32(buf: &[u8]) -> f32

Reads a IEEE754 single-precision (4 bytes) floating point number. Read more
source§

fn read_f64(buf: &[u8]) -> f64

Reads a IEEE754 double-precision (8 bytes) floating point number. Read more
source§

fn write_i16(buf: &mut [u8], n: i16)

Writes a signed 16 bit integer n to buf. Read more
source§

fn write_i24(buf: &mut [u8], n: i32)

Writes a signed 24 bit integer n to buf, stored in i32. Read more
source§

fn write_i32(buf: &mut [u8], n: i32)

Writes a signed 32 bit integer n to buf. Read more
source§

fn write_i48(buf: &mut [u8], n: i64)

Writes a signed 48 bit integer n to buf, stored in i64. Read more
source§

fn write_i64(buf: &mut [u8], n: i64)

Writes a signed 64 bit integer n to buf. Read more
source§

fn write_i128(buf: &mut [u8], n: i128)

Writes a signed 128 bit integer n to buf. Read more
source§

fn write_int(buf: &mut [u8], n: i64, nbytes: usize)

Writes a signed integer n to buf using only nbytes. Read more
source§

fn write_int128(buf: &mut [u8], n: i128, nbytes: usize)

Writes a signed integer n to buf using only nbytes. Read more
source§

fn write_f32(buf: &mut [u8], n: f32)

Writes a IEEE754 single-precision (4 bytes) floating point number. Read more
source§

fn write_f64(buf: &mut [u8], n: f64)

Writes a IEEE754 double-precision (8 bytes) floating point number. Read more
source§

fn read_i16_into(src: &[u8], dst: &mut [i16])

Reads signed 16 bit integers from src to dst. Read more
source§

fn read_i32_into(src: &[u8], dst: &mut [i32])

Reads signed 32 bit integers from src into dst. Read more
source§

fn read_i64_into(src: &[u8], dst: &mut [i64])

Reads signed 64 bit integers from src into dst. Read more
source§

fn read_i128_into(src: &[u8], dst: &mut [i128])

Reads signed 128 bit integers from src into dst. Read more
source§

fn read_f32_into(src: &[u8], dst: &mut [f32])

Reads IEEE754 single-precision (4 bytes) floating point numbers from -src into dst. Read more
source§

fn read_f32_into_unchecked(src: &[u8], dst: &mut [f32])

👎Deprecated since 1.3.0: please use read_f32_into instead
DEPRECATED. Read more
source§

fn read_f64_into(src: &[u8], dst: &mut [f64])

Reads IEEE754 single-precision (4 bytes) floating point numbers from -src into dst. Read more
source§

fn read_f64_into_unchecked(src: &[u8], dst: &mut [f64])

👎Deprecated since 1.3.0: please use read_f64_into instead
DEPRECATED. Read more
source§

fn write_i8_into(src: &[i8], dst: &mut [u8])

Writes signed 8 bit integers from src into dst. Read more
source§

fn write_i16_into(src: &[i16], dst: &mut [u8])

Writes signed 16 bit integers from src into dst. Read more
source§

fn write_i32_into(src: &[i32], dst: &mut [u8])

Writes signed 32 bit integers from src into dst. Read more
source§

fn write_i64_into(src: &[i64], dst: &mut [u8])

Writes signed 64 bit integers from src into dst. Read more
source§

fn write_i128_into(src: &[i128], dst: &mut [u8])

Writes signed 128 bit integers from src into dst. Read more
source§

fn write_f32_into(src: &[f32], dst: &mut [u8])

Writes IEEE754 single-precision (4 bytes) floating point numbers from -src into dst. Read more
source§

fn write_f64_into(src: &[f64], dst: &mut [u8])

Writes IEEE754 double-precision (8 bytes) floating point numbers from -src into dst. Read more
source§

fn from_slice_i16(src: &mut [i16])

Converts the given slice of signed 16 bit integers to a particular -endianness. Read more
source§

fn from_slice_i32(src: &mut [i32])

Converts the given slice of signed 32 bit integers to a particular -endianness. Read more
source§

fn from_slice_i64(src: &mut [i64])

Converts the given slice of signed 64 bit integers to a particular -endianness. Read more
source§

fn from_slice_i128(src: &mut [i128])

Converts the given slice of signed 128 bit integers to a particular -endianness. Read more
source§

impl Clone for LittleEndian

source§

fn clone(&self) -> LittleEndian

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LittleEndian

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for LittleEndian

source§

fn default() -> LittleEndian

Returns the “default value” for a type. Read more
source§

impl Hash for LittleEndian

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl Ord for LittleEndian

source§

fn cmp(&self, other: &LittleEndian) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<LittleEndian> for LittleEndian

source§

fn eq(&self, other: &LittleEndian) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<LittleEndian> for LittleEndian

source§

fn partial_cmp(&self, other: &LittleEndian) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for LittleEndian

source§

impl Eq for LittleEndian

source§

impl StructuralEq for LittleEndian

source§

impl StructuralPartialEq for LittleEndian

\ No newline at end of file diff --git a/docs/doc/byteorder/type.NetworkEndian.html b/docs/doc/byteorder/type.NetworkEndian.html deleted file mode 100644 index 05ba0ae..0000000 --- a/docs/doc/byteorder/type.NetworkEndian.html +++ /dev/null @@ -1,38 +0,0 @@ -NetworkEndian in byteorder - Rust

Type Alias byteorder::NetworkEndian

source ·
pub type NetworkEndian = BigEndian;
Expand description

Defines network byte order serialization.

-

Network byte order is defined by RFC 1700 to be big-endian, and is -referred to in several protocol specifications. This type is an alias of -BigEndian.

-

Note that this type has no value constructor. It is used purely at the -type level.

-

Examples

-

Write and read i16 numbers in big endian order:

- -
use byteorder::{ByteOrder, NetworkEndian, BigEndian};
-
-let mut buf = [0; 2];
-BigEndian::write_i16(&mut buf, -5_000);
-assert_eq!(-5_000, NetworkEndian::read_i16(&buf));
-

Aliased Type§

enum NetworkEndian {}

Variants§

Trait Implementations§

source§

impl ByteOrder for BigEndian

source§

fn read_u16(buf: &[u8]) -> u16

Reads an unsigned 16 bit integer from buf. Read more
source§

fn read_u32(buf: &[u8]) -> u32

Reads an unsigned 32 bit integer from buf. Read more
source§

fn read_u64(buf: &[u8]) -> u64

Reads an unsigned 64 bit integer from buf. Read more
source§

fn read_u128(buf: &[u8]) -> u128

Reads an unsigned 128 bit integer from buf. Read more
source§

fn read_uint(buf: &[u8], nbytes: usize) -> u64

Reads an unsigned n-bytes integer from buf. Read more
source§

fn read_uint128(buf: &[u8], nbytes: usize) -> u128

Reads an unsigned n-bytes integer from buf. Read more
source§

fn write_u16(buf: &mut [u8], n: u16)

Writes an unsigned 16 bit integer n to buf. Read more
source§

fn write_u32(buf: &mut [u8], n: u32)

Writes an unsigned 32 bit integer n to buf. Read more
source§

fn write_u64(buf: &mut [u8], n: u64)

Writes an unsigned 64 bit integer n to buf. Read more
source§

fn write_u128(buf: &mut [u8], n: u128)

Writes an unsigned 128 bit integer n to buf. Read more
source§

fn write_uint(buf: &mut [u8], n: u64, nbytes: usize)

Writes an unsigned integer n to buf using only nbytes. Read more
source§

fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize)

Writes an unsigned integer n to buf using only nbytes. Read more
source§

fn read_u16_into(src: &[u8], dst: &mut [u16])

Reads unsigned 16 bit integers from src into dst. Read more
source§

fn read_u32_into(src: &[u8], dst: &mut [u32])

Reads unsigned 32 bit integers from src into dst. Read more
source§

fn read_u64_into(src: &[u8], dst: &mut [u64])

Reads unsigned 64 bit integers from src into dst. Read more
source§

fn read_u128_into(src: &[u8], dst: &mut [u128])

Reads unsigned 128 bit integers from src into dst. Read more
source§

fn write_u16_into(src: &[u16], dst: &mut [u8])

Writes unsigned 16 bit integers from src into dst. Read more
source§

fn write_u32_into(src: &[u32], dst: &mut [u8])

Writes unsigned 32 bit integers from src into dst. Read more
source§

fn write_u64_into(src: &[u64], dst: &mut [u8])

Writes unsigned 64 bit integers from src into dst. Read more
source§

fn write_u128_into(src: &[u128], dst: &mut [u8])

Writes unsigned 128 bit integers from src into dst. Read more
source§

fn from_slice_u16(numbers: &mut [u16])

Converts the given slice of unsigned 16 bit integers to a particular -endianness. Read more
source§

fn from_slice_u32(numbers: &mut [u32])

Converts the given slice of unsigned 32 bit integers to a particular -endianness. Read more
source§

fn from_slice_u64(numbers: &mut [u64])

Converts the given slice of unsigned 64 bit integers to a particular -endianness. Read more
source§

fn from_slice_u128(numbers: &mut [u128])

Converts the given slice of unsigned 128 bit integers to a particular -endianness. Read more
source§

fn from_slice_f32(numbers: &mut [f32])

Converts the given slice of IEEE754 single-precision (4 bytes) floating -point numbers to a particular endianness. Read more
source§

fn from_slice_f64(numbers: &mut [f64])

Converts the given slice of IEEE754 double-precision (8 bytes) floating -point numbers to a particular endianness. Read more
source§

fn read_u24(buf: &[u8]) -> u32

Reads an unsigned 24 bit integer from buf, stored in u32. Read more
source§

fn read_u48(buf: &[u8]) -> u64

Reads an unsigned 48 bit integer from buf, stored in u64. Read more
source§

fn write_u24(buf: &mut [u8], n: u32)

Writes an unsigned 24 bit integer n to buf, stored in u32. Read more
source§

fn write_u48(buf: &mut [u8], n: u64)

Writes an unsigned 48 bit integer n to buf, stored in u64. Read more
source§

fn read_i16(buf: &[u8]) -> i16

Reads a signed 16 bit integer from buf. Read more
source§

fn read_i24(buf: &[u8]) -> i32

Reads a signed 24 bit integer from buf, stored in i32. Read more
source§

fn read_i32(buf: &[u8]) -> i32

Reads a signed 32 bit integer from buf. Read more
source§

fn read_i48(buf: &[u8]) -> i64

Reads a signed 48 bit integer from buf, stored in i64. Read more
source§

fn read_i64(buf: &[u8]) -> i64

Reads a signed 64 bit integer from buf. Read more
source§

fn read_i128(buf: &[u8]) -> i128

Reads a signed 128 bit integer from buf. Read more
source§

fn read_int(buf: &[u8], nbytes: usize) -> i64

Reads a signed n-bytes integer from buf. Read more
source§

fn read_int128(buf: &[u8], nbytes: usize) -> i128

Reads a signed n-bytes integer from buf. Read more
source§

fn read_f32(buf: &[u8]) -> f32

Reads a IEEE754 single-precision (4 bytes) floating point number. Read more
source§

fn read_f64(buf: &[u8]) -> f64

Reads a IEEE754 double-precision (8 bytes) floating point number. Read more
source§

fn write_i16(buf: &mut [u8], n: i16)

Writes a signed 16 bit integer n to buf. Read more
source§

fn write_i24(buf: &mut [u8], n: i32)

Writes a signed 24 bit integer n to buf, stored in i32. Read more
source§

fn write_i32(buf: &mut [u8], n: i32)

Writes a signed 32 bit integer n to buf. Read more
source§

fn write_i48(buf: &mut [u8], n: i64)

Writes a signed 48 bit integer n to buf, stored in i64. Read more
source§

fn write_i64(buf: &mut [u8], n: i64)

Writes a signed 64 bit integer n to buf. Read more
source§

fn write_i128(buf: &mut [u8], n: i128)

Writes a signed 128 bit integer n to buf. Read more
source§

fn write_int(buf: &mut [u8], n: i64, nbytes: usize)

Writes a signed integer n to buf using only nbytes. Read more
source§

fn write_int128(buf: &mut [u8], n: i128, nbytes: usize)

Writes a signed integer n to buf using only nbytes. Read more
source§

fn write_f32(buf: &mut [u8], n: f32)

Writes a IEEE754 single-precision (4 bytes) floating point number. Read more
source§

fn write_f64(buf: &mut [u8], n: f64)

Writes a IEEE754 double-precision (8 bytes) floating point number. Read more
source§

fn read_i16_into(src: &[u8], dst: &mut [i16])

Reads signed 16 bit integers from src to dst. Read more
source§

fn read_i32_into(src: &[u8], dst: &mut [i32])

Reads signed 32 bit integers from src into dst. Read more
source§

fn read_i64_into(src: &[u8], dst: &mut [i64])

Reads signed 64 bit integers from src into dst. Read more
source§

fn read_i128_into(src: &[u8], dst: &mut [i128])

Reads signed 128 bit integers from src into dst. Read more
source§

fn read_f32_into(src: &[u8], dst: &mut [f32])

Reads IEEE754 single-precision (4 bytes) floating point numbers from -src into dst. Read more
source§

fn read_f32_into_unchecked(src: &[u8], dst: &mut [f32])

👎Deprecated since 1.3.0: please use read_f32_into instead
DEPRECATED. Read more
source§

fn read_f64_into(src: &[u8], dst: &mut [f64])

Reads IEEE754 single-precision (4 bytes) floating point numbers from -src into dst. Read more
source§

fn read_f64_into_unchecked(src: &[u8], dst: &mut [f64])

👎Deprecated since 1.3.0: please use read_f64_into instead
DEPRECATED. Read more
source§

fn write_i8_into(src: &[i8], dst: &mut [u8])

Writes signed 8 bit integers from src into dst. Read more
source§

fn write_i16_into(src: &[i16], dst: &mut [u8])

Writes signed 16 bit integers from src into dst. Read more
source§

fn write_i32_into(src: &[i32], dst: &mut [u8])

Writes signed 32 bit integers from src into dst. Read more
source§

fn write_i64_into(src: &[i64], dst: &mut [u8])

Writes signed 64 bit integers from src into dst. Read more
source§

fn write_i128_into(src: &[i128], dst: &mut [u8])

Writes signed 128 bit integers from src into dst. Read more
source§

fn write_f32_into(src: &[f32], dst: &mut [u8])

Writes IEEE754 single-precision (4 bytes) floating point numbers from -src into dst. Read more
source§

fn write_f64_into(src: &[f64], dst: &mut [u8])

Writes IEEE754 double-precision (8 bytes) floating point numbers from -src into dst. Read more
source§

fn from_slice_i16(src: &mut [i16])

Converts the given slice of signed 16 bit integers to a particular -endianness. Read more
source§

fn from_slice_i32(src: &mut [i32])

Converts the given slice of signed 32 bit integers to a particular -endianness. Read more
source§

fn from_slice_i64(src: &mut [i64])

Converts the given slice of signed 64 bit integers to a particular -endianness. Read more
source§

fn from_slice_i128(src: &mut [i128])

Converts the given slice of signed 128 bit integers to a particular -endianness. Read more
source§

impl Clone for BigEndian

source§

fn clone(&self) -> BigEndian

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BigEndian

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for BigEndian

source§

fn default() -> BigEndian

Returns the “default value” for a type. Read more
source§

impl Hash for BigEndian

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl Ord for BigEndian

source§

fn cmp(&self, other: &BigEndian) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<BigEndian> for BigEndian

source§

fn eq(&self, other: &BigEndian) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<BigEndian> for BigEndian

source§

fn partial_cmp(&self, other: &BigEndian) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for BigEndian

source§

impl Eq for BigEndian

source§

impl StructuralEq for BigEndian

source§

impl StructuralPartialEq for BigEndian

\ No newline at end of file diff --git a/docs/doc/crates.js b/docs/doc/crates.js deleted file mode 100644 index 0f4eb37..0000000 --- a/docs/doc/crates.js +++ /dev/null @@ -1 +0,0 @@ -window.ALL_CRATES = ["arduboy_rust","atomic_polyfill","byteorder","critical_section","hash32","heapless","panic_halt","stable_deref_trait"]; \ No newline at end of file diff --git a/docs/doc/critical_section/all.html b/docs/doc/critical_section/all.html deleted file mode 100644 index fe2e506..0000000 --- a/docs/doc/critical_section/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Structs

Traits

Macros

Functions

Type Aliases

\ No newline at end of file diff --git a/docs/doc/critical_section/fn.acquire.html b/docs/doc/critical_section/fn.acquire.html deleted file mode 100644 index b578d44..0000000 --- a/docs/doc/critical_section/fn.acquire.html +++ /dev/null @@ -1,16 +0,0 @@ -acquire in critical_section - Rust

Function critical_section::acquire

source ·
pub unsafe fn acquire() -> RestoreState
Expand description

Acquire a critical section in the current thread.

-

This function is extremely low level. Strongly prefer using with instead.

-

Nesting critical sections is allowed. The inner critical sections -are mostly no-ops since they’re already protected by the outer one.

-

Safety

-
    -
  • Each acquire call must be paired with exactly one release call in the same thread.
  • -
  • acquire returns a “restore state” that you must pass to the corresponding release call.
  • -
  • acquire/release pairs must be “properly nested”, ie it’s not OK to do a=acquire(); b=acquire(); release(a); release(b);.
  • -
  • It is UB to call release if the critical section is not acquired in the current thread.
  • -
  • It is UB to call release with a “restore state” that does not come from the corresponding acquire call.
  • -
  • It must provide ordering guarantees at least equivalent to a [core::sync::atomic::Ordering::Acquire] -on a memory location shared by all critical sections, on which the release call will do a -[core::sync::atomic::Ordering::Release] operation.
  • -
-
\ No newline at end of file diff --git a/docs/doc/critical_section/fn.release.html b/docs/doc/critical_section/fn.release.html deleted file mode 100644 index 293ee16..0000000 --- a/docs/doc/critical_section/fn.release.html +++ /dev/null @@ -1,5 +0,0 @@ -release in critical_section - Rust

Function critical_section::release

source ·
pub unsafe fn release(restore_state: RestoreState)
Expand description

Release the critical section.

-

This function is extremely low level. Strongly prefer using with instead.

-

Safety

-

See acquire for the safety contract description.

-
\ No newline at end of file diff --git a/docs/doc/critical_section/fn.with.html b/docs/doc/critical_section/fn.with.html deleted file mode 100644 index 9305ac7..0000000 --- a/docs/doc/critical_section/fn.with.html +++ /dev/null @@ -1,7 +0,0 @@ -with in critical_section - Rust

Function critical_section::with

source ·
pub fn with<R>(f: impl FnOnce(CriticalSection<'_>) -> R) -> R
Expand description

Execute closure f in a critical section.

-

Nesting critical sections is allowed. The inner critical sections -are mostly no-ops since they’re already protected by the outer one.

-

Panics

-

This function panics if the given closure f panics. In this case -the critical section is released before unwinding.

-
\ No newline at end of file diff --git a/docs/doc/critical_section/index.html b/docs/doc/critical_section/index.html deleted file mode 100644 index dfcc8ac..0000000 --- a/docs/doc/critical_section/index.html +++ /dev/null @@ -1,167 +0,0 @@ -critical_section - Rust

Crate critical_section

source ·
Expand description

critical-section

-

crates.io -crates.io -Documentation

-

This project is developed and maintained by the HAL team.

-

A critical section that works everywhere!

-

When writing software for embedded systems, it’s common to use a “critical section” -as a basic primitive to control concurrency. A critical section is essentially a -mutex global to the whole process, that can be acquired by only one thread at a time. -This can be used to protect data behind mutexes, to emulate atomics in -targets that don’t support them, etc.

-

There’s a wide range of possible implementations depending on the execution environment:

-
    -
  • For bare-metal single core, disabling interrupts in the current (only) core.
  • -
  • For bare-metal multicore, disabling interrupts in the current core and acquiring a hardware spinlock to prevent other cores from entering a critical section concurrently.
  • -
  • For bare-metal using a RTOS, using library functions for acquiring a critical section, often named “scheduler lock” or “kernel lock”.
  • -
  • For bare-metal running in non-privileged mode, calling some system call is usually needed.
  • -
  • For std targets, acquiring a global std::sync::Mutex.
  • -
-

Libraries often need to use critical sections, but there’s no universal API for this in core. This leads -library authors to hard-code them for their target, or at best add some cfgs to support a few targets. -This doesn’t scale since there are many targets out there, and in the general case it’s impossible to know -which critical section implementation is needed from the Rust target alone. For example, the thumbv7em-none-eabi target -could be cases 1-4 from the above list.

-

This crate solves the problem by providing this missing universal API.

-
    -
  • It provides functions acquire, release and with that libraries can directly use.
  • -
  • It provides a way for any crate to supply an implementation. This allows “target support” crates such as architecture crates (cortex-m, riscv), RTOS bindings, or HALs for multicore chips to supply the correct implementation so that all the crates in the dependency tree automatically use it.
  • -
-

Usage in no-std binaries.

-

First, add a dependency on a crate providing a critical section implementation. Enable the critical-section-* Cargo feature if required by the crate.

-

Implementations are typically provided by either architecture-support crates, HAL crates, and OS/RTOS bindings, including:

-
    -
  • The cortex-m crate provides an implementation for all single-core Cortex-M microcontrollers via its critical-section-single-core feature
  • -
  • The riscv crate provides an implementation for all single-hart RISC-V microcontrollers via its critical-section-single-hart feature
  • -
  • The msp430 crate provides an implementation for all MSP430 microcontrollers via its critical-section-single-core feature
  • -
  • The rp2040-hal crate provides a multi-core-safe critical section for the RP2040 microcontroller via its critical-section-impl feature
  • -
  • The avr-device crate provides an implementation for all AVR microcontrollers via its critical-section-impl feature
  • -
  • The esp-hal-common crate provides an implementation for ESP32 microcontrollers which is used by the ESP HALs
  • -
  • The embassy-rp crate provides a multi-core-safe critical section for the RP2040 microcontroller via its critical-section-impl feature
  • -
  • The nrf-softdevice crate provides a critical section that’s compatible with the nRF soft-device firmware via its critical-section-impl feature
  • -
-

For example, for single-core Cortex-M targets, you can use:

-
[dependencies]
-cortex-m = { version = "0.7.6", features = ["critical-section-single-core"]}
-
-

Then you can use critical_section::with().

- -
use core::cell::Cell;
-use critical_section::Mutex;
-
-static MY_VALUE: Mutex<Cell<u32>> = Mutex::new(Cell::new(0));
-
-critical_section::with(|cs| {
-    // This code runs within a critical section.
-
-    // `cs` is a token that you can use to "prove" that to some API,
-    // for example to a `Mutex`:
-    MY_VALUE.borrow(cs).set(42);
-});
-
-

Usage in std binaries.

-

Add the critical-section dependency to Cargo.toml enabling the std feature. This makes the critical-section crate itself -provide an implementation based on std::sync::Mutex, so you don’t have to add any other dependency.

-
[dependencies]
-critical-section = { version = "1.1", features = ["std"]}
-

Usage in libraries

-

If you’re writing a library intended to be portable across many targets, simply add a dependency on critical-section -and use critical_section::free and/or Mutex as usual.

-

Do not add any dependency supplying a critical section implementation. Do not enable any critical-section-* Cargo feature. -This has to be done by the end user, enabling the correct implementation for their target.

-

Do not enable any Cargo feature in critical-section.

-

Usage in std tests for no-std libraries.

-

If you want to run std-using tests in otherwise no-std libraries, enable the std feature in dev-dependencies only. -This way the main target will use the no-std implementation chosen by the end-user’s binary, and only the test targets -will use the std implementation.

-
[dependencies]
-critical-section = "1.1"
-
-[dev-dependencies]
-critical-section = { version = "1.1", features = ["std"]}
-

Providing an implementation

-

Crates adding support for a particular architecture, chip or operating system should provide a critical section implementation. -It is strongly recommended to gate the implementation behind a feature, so the user can still use another implementation -if needed (having two implementations in the same binary will cause linking to fail).

-

Add the dependency, and a critical-section-* feature to your Cargo.toml:

-
[features]
-# Enable critical section implementation that does "foo"
-critical-section-foo = ["critical-section/restore-state-bool"]
-
-[dependencies]
-critical-section = { version = "1.0", optional = true }
-
-

Then, provide the critical implementation like this:

- -
// This is a type alias for the enabled `restore-state-*` feature.
-// For example, it is `bool` if you enable `restore-state-bool`.
-use critical_section::RawRestoreState;
-
-struct MyCriticalSection;
-critical_section::set_impl!(MyCriticalSection);
-
-unsafe impl critical_section::Impl for MyCriticalSection {
-    unsafe fn acquire() -> RawRestoreState {
-        // TODO
-    }
-
-    unsafe fn release(token: RawRestoreState) {
-        // TODO
-    }
-}
-

Troubleshooting

Undefined reference errors

-

If you get an error like these:

-
undefined reference to `_critical_section_1_0_acquire'
-undefined reference to `_critical_section_1_0_release'
-
-

it is because you (or a library) are using critical_section::with without providing a critical section implementation. -Make sure you’re depending on a crate providing the implementation, and have enabled the critical-section-* feature in it if required. See the Usage section above.

-

The error can also be caused by having the dependency but never useing it. This can be fixed by adding a dummy use:

- -
use the_cs_impl_crate as _;
-

Duplicate symbol errors

-

If you get errors like these:

-
error: symbol `_critical_section_1_0_acquire` is already defined
-
-

it is because you have two crates trying to provide a critical section implementation. You can only -have one implementation in a program.

-

You can use cargo tree --format '{p} {f}' to view all dependencies and their enabled features. Make sure -that in the whole dependency tree, exactly one implementation is provided.

-

Check for multiple versions of the same crate as well. For example, check the critical-section-single-core -feature is not enabled for both cortex-m 0.7 and 0.8.

-

Why not generics?

-

An alternative solution would be to use a CriticalSection trait, and make all -code that needs acquiring the critical section generic over it. This has a few problems:

-
    -
  • It would require passing it as a generic param to a very big amount of code, which -would be quite unergonomic.
  • -
  • It’s common to put Mutexes in static variables, and statics can’t -be generic.
  • -
  • It would allow mixing different critical section implementations in the same program, -which would be unsound.
  • -
-

Minimum Supported Rust Version (MSRV)

-

This crate is guaranteed to compile on the following Rust versions:

-
    -
  • If the std feature is not enabled: stable Rust 1.54 and up.
  • -
  • If the std feature is enabled: stable Rust 1.63 and up.
  • -
-

It might compile with older versions but that may change in any new patch release.

-

See here for details on how the MSRV may be upgraded.

-

License

-

This work is licensed under either of

- -

at your option.

-

Contribution

-

Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in the work by you, as defined in the Apache-2.0 license, shall be -dual licensed as above, without any additional terms or conditions.

-

Code of Conduct

-

Contribution to this crate is organized under the terms of the Rust Code of -Conduct, the maintainer of this crate, the HAL team, promises -to intervene to uphold that code of conduct.

-

Macros

  • Set the critical section implementation.

Structs

Traits

  • Methods required for a critical section implementation.

Functions

  • Acquire a critical section in the current thread.
  • Release the critical section.
  • Execute closure f in a critical section.

Type Aliases

\ No newline at end of file diff --git a/docs/doc/critical_section/macro.set_impl!.html b/docs/doc/critical_section/macro.set_impl!.html deleted file mode 100644 index a96aecb..0000000 --- a/docs/doc/critical_section/macro.set_impl!.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to macro.set_impl.html...

- - - \ No newline at end of file diff --git a/docs/doc/critical_section/macro.set_impl.html b/docs/doc/critical_section/macro.set_impl.html deleted file mode 100644 index 2941e6b..0000000 --- a/docs/doc/critical_section/macro.set_impl.html +++ /dev/null @@ -1,19 +0,0 @@ -set_impl in critical_section - Rust
macro_rules! set_impl {
-    ($t: ty) => { ... };
-}
Expand description

Set the critical section implementation.

-

Example

-
use critical_section::RawRestoreState;
-
-struct MyCriticalSection;
-critical_section::set_impl!(MyCriticalSection);
-
-unsafe impl critical_section::Impl for MyCriticalSection {
-    unsafe fn acquire() -> RawRestoreState {
-        // ...
-    }
-
-    unsafe fn release(restore_state: RawRestoreState) {
-        // ...
-    }
-}
-
\ No newline at end of file diff --git a/docs/doc/critical_section/mutex/struct.Mutex.html b/docs/doc/critical_section/mutex/struct.Mutex.html deleted file mode 100644 index 2684495..0000000 --- a/docs/doc/critical_section/mutex/struct.Mutex.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../critical_section/struct.Mutex.html...

- - - \ No newline at end of file diff --git a/docs/doc/critical_section/sidebar-items.js b/docs/doc/critical_section/sidebar-items.js deleted file mode 100644 index 9099ab3..0000000 --- a/docs/doc/critical_section/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"fn":["acquire","release","with"],"macro":["set_impl"],"struct":["CriticalSection","Mutex","RestoreState"],"trait":["Impl"],"type":["RawRestoreState"]}; \ No newline at end of file diff --git a/docs/doc/critical_section/struct.CriticalSection.html b/docs/doc/critical_section/struct.CriticalSection.html deleted file mode 100644 index 593c154..0000000 --- a/docs/doc/critical_section/struct.CriticalSection.html +++ /dev/null @@ -1,26 +0,0 @@ -CriticalSection in critical_section - Rust
pub struct CriticalSection<'cs> { /* private fields */ }
Expand description

Critical section token.

-

An instance of this type indicates that the current thread is executing code within a critical -section.

-

Implementations§

source§

impl<'cs> CriticalSection<'cs>

source

pub unsafe fn new() -> Self

Creates a critical section token.

-

This method is meant to be used to create safe abstractions rather than being directly used -in applications.

-
Safety
-

This must only be called when the current thread is in a critical section. The caller must -ensure that the returned instance will not live beyond the end of the critical section.

-

The caller must use adequate fences to prevent the compiler from moving the -instructions inside the critical section to the outside of it. Sequentially consistent fences are -suggested immediately after entry and immediately before exit from the critical section.

-

Note that the lifetime 'cs of the returned instance is unconstrained. User code must not -be able to influence the lifetime picked for this type, since that might cause it to be -inferred to 'static.

-

Trait Implementations§

source§

impl<'cs> Clone for CriticalSection<'cs>

source§

fn clone(&self) -> CriticalSection<'cs>

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'cs> Debug for CriticalSection<'cs>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'cs> Copy for CriticalSection<'cs>

Auto Trait Implementations§

§

impl<'cs> RefUnwindSafe for CriticalSection<'cs>

§

impl<'cs> Send for CriticalSection<'cs>

§

impl<'cs> Sync for CriticalSection<'cs>

§

impl<'cs> Unpin for CriticalSection<'cs>

§

impl<'cs> UnwindSafe for CriticalSection<'cs>

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/critical_section/struct.Mutex.html b/docs/doc/critical_section/struct.Mutex.html deleted file mode 100644 index ca30426..0000000 --- a/docs/doc/critical_section/struct.Mutex.html +++ /dev/null @@ -1,101 +0,0 @@ -Mutex in critical_section - Rust

Struct critical_section::Mutex

source ·
pub struct Mutex<T> { /* private fields */ }
Expand description

A mutex based on critical sections.

-

Example

-

-static FOO: Mutex<Cell<i32>> = Mutex::new(Cell::new(42));
-
-fn main() {
-    critical_section::with(|cs| {
-        FOO.borrow(cs).set(43);
-    });
-}
-
-fn interrupt_handler() {
-    let _x = critical_section::with(|cs| FOO.borrow(cs).get());
-}
-

Design

-

std::sync::Mutex has two purposes. It converts types that are [Send] -but not [Sync] into types that are both; and it provides -interior mutability. critical_section::Mutex, on the other hand, only adds -Sync. It does not provide interior mutability.

-

This was a conscious design choice. It is possible to create multiple -CriticalSection tokens, either by nesting critical sections or Copying -an existing token. As a result, it would not be sound for Mutex::borrow -to return &mut T, because there would be nothing to prevent calling -borrow multiple times to create aliased &mut T references.

-

The solution is to include a runtime check to ensure that each resource is -borrowed only once. This is what std::sync::Mutex does. However, this is -a runtime cost that may not be required in all circumstances. For instance, -Mutex<Cell<T>> never needs to create &mut T or equivalent.

-

If &mut T is needed, the simplest solution is to use Mutex<RefCell<T>>, -which is the closest analogy to std::sync::Mutex. [RefCell] inserts the -exact runtime check necessary to guarantee that the &mut T reference is -unique.

-

To reduce verbosity when using Mutex<RefCell<T>>, we reimplement some of -RefCell’s methods on it directly.

- -

-static FOO: Mutex<RefCell<i32>> = Mutex::new(RefCell::new(42));
-
-fn main() {
-    critical_section::with(|cs| {
-        // Instead of calling this
-        let _ = FOO.borrow(cs).take();
-        // Call this
-        let _ = FOO.take(cs);
-        // `RefCell::borrow` and `RefCell::borrow_mut` are renamed to
-        // `borrow_ref` and `borrow_ref_mut` to avoid name collisions
-        let _: &mut i32 = &mut *FOO.borrow_ref_mut(cs);
-    })
-}
-

Implementations§

source§

impl<T> Mutex<T>

source

pub const fn new(value: T) -> Self

Creates a new mutex.

-
source

pub fn get_mut(&mut self) -> &mut T

Gets a mutable reference to the contained value when the mutex is already uniquely borrowed.

-

This does not require locking or a critical section since it takes &mut self, which -guarantees unique ownership already. Care must be taken when using this method to -unsafely access static mut variables, appropriate fences must be used to prevent -unwanted optimizations.

-
source

pub fn into_inner(self) -> T

Unwraps the contained value, consuming the mutex.

-
source

pub fn borrow<'cs>(&'cs self, _cs: CriticalSection<'cs>) -> &'cs T

Borrows the data for the duration of the critical section.

-
source§

impl<T> Mutex<RefCell<T>>

source

pub fn replace<'cs>(&'cs self, cs: CriticalSection<'cs>, t: T) -> T

Borrow the data and call [RefCell::replace]

-

This is equivalent to self.borrow(cs).replace(t)

-
Panics
-

This call could panic. See the documentation for [RefCell::replace] -for more details.

-
source

pub fn replace_with<'cs, F>(&'cs self, cs: CriticalSection<'cs>, f: F) -> Twhere - F: FnOnce(&mut T) -> T,

Borrow the data and call [RefCell::replace_with]

-

This is equivalent to self.borrow(cs).replace_with(f)

-
Panics
-

This call could panic. See the documentation for -[RefCell::replace_with] for more details.

-
source

pub fn borrow_ref<'cs>(&'cs self, cs: CriticalSection<'cs>) -> Ref<'cs, T>

Borrow the data and call [RefCell::borrow]

-

This is equivalent to self.borrow(cs).borrow()

-
Panics
-

This call could panic. See the documentation for [RefCell::borrow] -for more details.

-
source

pub fn borrow_ref_mut<'cs>( - &'cs self, - cs: CriticalSection<'cs> -) -> RefMut<'cs, T>

Borrow the data and call [RefCell::borrow_mut]

-

This is equivalent to self.borrow(cs).borrow_mut()

-
Panics
-

This call could panic. See the documentation for [RefCell::borrow_mut] -for more details.

-
source§

impl<T: Default> Mutex<RefCell<T>>

source

pub fn take<'cs>(&'cs self, cs: CriticalSection<'cs>) -> T

Borrow the data and call [RefCell::take]

-

This is equivalent to self.borrow(cs).take()

-
Panics
-

This call could panic. See the documentation for [RefCell::take] -for more details.

-

Trait Implementations§

source§

impl<T: Debug> Debug for Mutex<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Sync for Mutex<T>where - T: Send,

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for Mutex<T>

§

impl<T> Send for Mutex<T>where - T: Send,

§

impl<T> Unpin for Mutex<T>where - T: Unpin,

§

impl<T> UnwindSafe for Mutex<T>where - T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/critical_section/struct.RestoreState.html b/docs/doc/critical_section/struct.RestoreState.html deleted file mode 100644 index d088dc3..0000000 --- a/docs/doc/critical_section/struct.RestoreState.html +++ /dev/null @@ -1,25 +0,0 @@ -RestoreState in critical_section - Rust
pub struct RestoreState(/* private fields */);
Expand description

Opaque “restore state”.

-

Implementations use this to “carry over” information between acquiring and releasing -a critical section. For example, when nesting two critical sections of an -implementation that disables interrupts globally, acquiring the inner one won’t disable -the interrupts since they’re already disabled. The impl would use the restore state to “tell” -the corresponding release that it does not have to reenable interrupts yet, only the -outer release should do so.

-

User code uses RestoreState opaquely, critical section implementations -use RawRestoreState so that they can use the inner value.

-

Implementations§

source§

impl RestoreState

source

pub const fn invalid() -> Self

Create an invalid, dummy RestoreState.

-

This can be useful to avoid Option when storing a RestoreState in a -struct field, or a static.

-

Note that due to the safety contract of acquire/release, you must not pass -a RestoreState obtained from this method to release.

-

Trait Implementations§

source§

impl Clone for RestoreState

source§

fn clone(&self) -> RestoreState

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RestoreState

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for RestoreState

Auto Trait Implementations§

§

impl RefUnwindSafe for RestoreState

§

impl Send for RestoreState

§

impl Sync for RestoreState

§

impl Unpin for RestoreState

§

impl UnwindSafe for RestoreState

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/critical_section/trait.Impl.html b/docs/doc/critical_section/trait.Impl.html deleted file mode 100644 index e1c2b86..0000000 --- a/docs/doc/critical_section/trait.Impl.html +++ /dev/null @@ -1,15 +0,0 @@ -Impl in critical_section - Rust
pub unsafe trait Impl {
-    // Required methods
-    unsafe fn acquire() -> RawRestoreState;
-    unsafe fn release(restore_state: RawRestoreState);
-}
Expand description

Methods required for a critical section implementation.

-

This trait is not intended to be used except when implementing a critical section.

-

Safety

-

Implementations must uphold the contract specified in crate::acquire and crate::release.

-

Required Methods§

source

unsafe fn acquire() -> RawRestoreState

Acquire the critical section.

-
Safety
-

Callers must uphold the contract specified in crate::acquire and crate::release.

-
source

unsafe fn release(restore_state: RawRestoreState)

Release the critical section.

-
Safety
-

Callers must uphold the contract specified in crate::acquire and crate::release.

-

Implementors§

\ No newline at end of file diff --git a/docs/doc/critical_section/type.RawRestoreState.html b/docs/doc/critical_section/type.RawRestoreState.html deleted file mode 100644 index 6ef39ef..0000000 --- a/docs/doc/critical_section/type.RawRestoreState.html +++ /dev/null @@ -1,14 +0,0 @@ -RawRestoreState in critical_section - Rust
pub type RawRestoreState = ();
Expand description

Raw, transparent “restore state”.

-

This type changes based on which Cargo feature is selected, out of

-
    -
  • restore-state-none (default, makes the type be ())
  • -
  • restore-state-bool
  • -
  • restore-state-u8
  • -
  • restore-state-u16
  • -
  • restore-state-u32
  • -
  • restore-state-u64
  • -
-

See RestoreState.

-

User code uses RestoreState opaquely, critical section implementations -use RawRestoreState so that they can use the inner value.

-
\ No newline at end of file diff --git a/docs/doc/hash32/all.html b/docs/doc/hash32/all.html deleted file mode 100644 index 9f971bc..0000000 --- a/docs/doc/hash32/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/docs/doc/hash32/fnv/struct.Hasher.html b/docs/doc/hash32/fnv/struct.Hasher.html deleted file mode 100644 index 670d7d2..0000000 --- a/docs/doc/hash32/fnv/struct.Hasher.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../hash32/struct.FnvHasher.html...

- - - \ No newline at end of file diff --git a/docs/doc/hash32/index.html b/docs/doc/hash32/index.html deleted file mode 100644 index e75c2e8..0000000 --- a/docs/doc/hash32/index.html +++ /dev/null @@ -1,46 +0,0 @@ -hash32 - Rust

Crate hash32

source ·
Expand description

32-bit hashing machinery

-

Why?

-

Because 32-bit architectures are a thing (e.g. ARM Cortex-M) and you don’t want your hashing -function to pull in a bunch of slow 64-bit compiler intrinsics (software implementations of -64-bit operations).

-

Relationship to core::hash

-

This crate exposes the same interfaces you’ll find in core::hash: Hash, Hasher, -BuildHasher and BuildHasherDefault. The main difference is that hash32::Hasher::finish -returns a u32 instead of u64, and the contract of hash32::Hasher forbids the implementer -from performing 64-bit (or 128-bit) operations while computing the hash.

-

#[derive(Hash32)]

-

The easiest way to implement hash32::Hash for a struct is to use the #[derive(Hash32)].

-

Note that you need to explicitly depend on both hash32 and hash32_derive; both crates -must appear in your Cargo.toml.

- -
use hash32_derive::Hash32;
-
-#[derive(Hash32)]
-struct Ipv4Addr([u8; 4]);
-
-
-

Hashers

-

This crate provides implementations of the following 32-bit hashing algorithms:

- -

MSRV

-

This crate is guaranteed to compile on latest stable Rust. It might compile on older -versions but that may change in any new patch release.

-

Future

-

In the future we’d like to deprecate this crate in favor of making core::hash::Hasher generic -over the size of the computed hash. Below is shown the planned change (but it doesn’t work due -to limitations in the associated_type_defaults feature):

- -
#![feature(associated_type_defaults)]
-
-trait Hasher {
-    type Hash = u64; // default type for backwards compatibility
-
-    fn finish(&self) -> Self::Hash; // changed
-    fn write(&mut self, bytes: &[u8]);
-}
-

With this change a single #[derive(Hash)] would enough to make a type hashable with 32-bit and -64-bit hashers.

-

Structs

Traits

\ No newline at end of file diff --git a/docs/doc/hash32/murmur3/struct.Hasher.html b/docs/doc/hash32/murmur3/struct.Hasher.html deleted file mode 100644 index bdeafc6..0000000 --- a/docs/doc/hash32/murmur3/struct.Hasher.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../hash32/struct.Murmur3Hasher.html...

- - - \ No newline at end of file diff --git a/docs/doc/hash32/sidebar-items.js b/docs/doc/hash32/sidebar-items.js deleted file mode 100644 index 84624b8..0000000 --- a/docs/doc/hash32/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"struct":["BuildHasherDefault","FnvHasher","Murmur3Hasher"],"trait":["BuildHasher","Hash","Hasher"]}; \ No newline at end of file diff --git a/docs/doc/hash32/struct.BuildHasherDefault.html b/docs/doc/hash32/struct.BuildHasherDefault.html deleted file mode 100644 index ee6895a..0000000 --- a/docs/doc/hash32/struct.BuildHasherDefault.html +++ /dev/null @@ -1,24 +0,0 @@ -BuildHasherDefault in hash32 - Rust
pub struct BuildHasherDefault<H> { /* private fields */ }
Expand description

Implementations§

source§

impl<H> BuildHasherDefault<H>

source

pub const fn new() -> Self

const constructor

-

Trait Implementations§

source§

impl<H> BuildHasher for BuildHasherDefault<H>where - H: Default + Hasher,

source§

impl<H> Clone for BuildHasherDefault<H>where - H: Default + Hasher,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<H: Default + Hasher> Debug for BuildHasherDefault<H>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<H> Default for BuildHasherDefault<H>where - H: Default + Hasher,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<H> PartialEq<BuildHasherDefault<H>> for BuildHasherDefault<H>where - H: Default + Hasher,

source§

fn eq(&self, _other: &BuildHasherDefault<H>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<H: Default + Hasher> Eq for BuildHasherDefault<H>

Auto Trait Implementations§

§

impl<H> RefUnwindSafe for BuildHasherDefault<H>where - H: RefUnwindSafe,

§

impl<H> Send for BuildHasherDefault<H>where - H: Send,

§

impl<H> Sync for BuildHasherDefault<H>where - H: Sync,

§

impl<H> Unpin for BuildHasherDefault<H>where - H: Unpin,

§

impl<H> UnwindSafe for BuildHasherDefault<H>where - H: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/hash32/struct.FnvHasher.html b/docs/doc/hash32/struct.FnvHasher.html deleted file mode 100644 index eb1950a..0000000 --- a/docs/doc/hash32/struct.FnvHasher.html +++ /dev/null @@ -1,12 +0,0 @@ -FnvHasher in hash32 - Rust

Struct hash32::FnvHasher

source ·
pub struct FnvHasher { /* private fields */ }
Expand description

32-bit Fowler-Noll-Vo hasher

-

Trait Implementations§

source§

impl Default for Hasher

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Hasher for Hasher

source§

fn finish(&self) -> u32

source§

fn write(&mut self, bytes: &[u8])

Auto Trait Implementations§

§

impl RefUnwindSafe for Hasher

§

impl Send for Hasher

§

impl Sync for Hasher

§

impl Unpin for Hasher

§

impl UnwindSafe for Hasher

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/hash32/struct.Murmur3Hasher.html b/docs/doc/hash32/struct.Murmur3Hasher.html deleted file mode 100644 index fcbad37..0000000 --- a/docs/doc/hash32/struct.Murmur3Hasher.html +++ /dev/null @@ -1,12 +0,0 @@ -Murmur3Hasher in hash32 - Rust

Struct hash32::Murmur3Hasher

source ·
pub struct Murmur3Hasher { /* private fields */ }
Expand description

32-bit MurmurHash3 hasher

-

Trait Implementations§

source§

impl Default for Hasher

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Hasher for Hasher

source§

fn finish(&self) -> u32

source§

fn write(&mut self, bytes: &[u8])

Auto Trait Implementations§

§

impl RefUnwindSafe for Hasher

§

impl Send for Hasher

§

impl Sync for Hasher

§

impl Unpin for Hasher

§

impl UnwindSafe for Hasher

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/hash32/trait.BuildHasher.html b/docs/doc/hash32/trait.BuildHasher.html deleted file mode 100644 index 19e0523..0000000 --- a/docs/doc/hash32/trait.BuildHasher.html +++ /dev/null @@ -1,10 +0,0 @@ -BuildHasher in hash32 - Rust

Trait hash32::BuildHasher

source ·
pub trait BuildHasher {
-    type Hasher: Hasher;
-
-    // Required method
-    fn build_hasher(&self) -> Self::Hasher;
-}
Expand description

See core::hash::BuildHasher for details

-

Required Associated Types§

Required Methods§

Implementors§

source§

impl<H> BuildHasher for BuildHasherDefault<H>where - H: Default + Hasher,

§

type Hasher = H

\ No newline at end of file diff --git a/docs/doc/hash32/trait.Hash.html b/docs/doc/hash32/trait.Hash.html deleted file mode 100644 index 8c84762..0000000 --- a/docs/doc/hash32/trait.Hash.html +++ /dev/null @@ -1,119 +0,0 @@ -Hash in hash32 - Rust

Trait hash32::Hash

source ·
pub trait Hash {
-    // Required method
-    fn hash<H>(&self, state: &mut H)
-       where H: Hasher;
-
-    // Provided method
-    fn hash_slice<H>(data: &[Self], state: &mut H)
-       where H: Hasher,
-             Self: Sized { ... }
-}
Expand description

See core::hash::Hash for details

-

Required Methods§

source

fn hash<H>(&self, state: &mut H)where - H: Hasher,

Feeds this value into the given Hasher.

-

Provided Methods§

source

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher.

-

Implementations on Foreign Types§

source§

impl<T> Hash for [T; 13]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl Hash for usize

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher,

source§

impl<A: Hash, B: Hash, C> Hash for (A, B, C)where - C: ?Sized + Hash,

source§

fn hash<S: Hasher>(&self, state: &mut S)

source§

impl<T> Hash for [T; 29]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl Hash for i32

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 2]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl Hash for u16

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher,

source§

impl Hash for u64

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 12]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I> Hash for (A, B, C, D, E, F, G, H, I)where - I: ?Sized + Hash,

source§

fn hash<S: Hasher>(&self, state: &mut S)

source§

impl<A: Hash, B: Hash, C: Hash, D: Hash, E> Hash for (A, B, C, D, E)where - E: ?Sized + Hash,

source§

fn hash<S: Hasher>(&self, state: &mut S)

source§

impl<T> Hash for [T; 4]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 21]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 23]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<A: Hash, B> Hash for (A, B)where - B: ?Sized + Hash,

source§

fn hash<S: Hasher>(&self, state: &mut S)

source§

impl<T> Hash for [T; 27]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 5]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl Hash for i8

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 9]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash, J: Hash, K> Hash for (A, B, C, D, E, F, G, H, I, J, K)where - K: ?Sized + Hash,

source§

fn hash<S: Hasher>(&self, state: &mut S)

source§

impl<T> Hash for [T; 3]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 26]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 8]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 20]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 16]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 28]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<'a, T: ?Sized + Hash> Hash for &'a T

source§

fn hash<H: Hasher>(&self, state: &mut H)

source§

impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G> Hash for (A, B, C, D, E, F, G)where - G: ?Sized + Hash,

source§

fn hash<S: Hasher>(&self, state: &mut S)

source§

impl Hash for char

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 18]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl Hash for isize

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher,

source§

impl<A: Hash, B: Hash, C: Hash, D> Hash for (A, B, C, D)where - D: ?Sized + Hash,

source§

fn hash<S: Hasher>(&self, state: &mut S)

source§

impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash, J> Hash for (A, B, C, D, E, F, G, H, I, J)where - J: ?Sized + Hash,

source§

fn hash<S: Hasher>(&self, state: &mut S)

source§

impl<T> Hash for [T; 24]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<A> Hash for (A,)where - A: ?Sized + Hash,

source§

fn hash<S: Hasher>(&self, state: &mut S)

source§

impl Hash for i16

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher,

source§

impl<'a, T: ?Sized + Hash> Hash for &'a mut T

source§

fn hash<H: Hasher>(&self, state: &mut H)

source§

impl Hash for u8

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 32]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 14]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl Hash for u32

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 19]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 17]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl Hash for ()

source§

fn hash<H: Hasher>(&self, _state: &mut H)

source§

impl<T> Hash for [T; 10]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 11]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 0]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 22]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H> Hash for (A, B, C, D, E, F, G, H)where - H: ?Sized + Hash,

source§

fn hash<S: Hasher>(&self, state: &mut S)

source§

impl<T> Hash for [T; 15]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F> Hash for (A, B, C, D, E, F)where - F: ?Sized + Hash,

source§

fn hash<S: Hasher>(&self, state: &mut S)

source§

impl<T> Hash for [T; 31]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl Hash for bool

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 7]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 1]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl Hash for str

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<A: Hash, B: Hash, C: Hash, D: Hash, E: Hash, F: Hash, G: Hash, H: Hash, I: Hash, J: Hash, K: Hash, L> Hash for (A, B, C, D, E, F, G, H, I, J, K, L)where - L: ?Sized + Hash,

source§

fn hash<S: Hasher>(&self, state: &mut S)

source§

impl<T> Hash for [T; 30]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl Hash for i64

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 6]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

source§

impl<T> Hash for [T; 25]where - T: Hash,

source§

fn hash<H>(&self, state: &mut H)where - H: Hasher,

Implementors§

\ No newline at end of file diff --git a/docs/doc/hash32/trait.Hasher.html b/docs/doc/hash32/trait.Hasher.html deleted file mode 100644 index 4583639..0000000 --- a/docs/doc/hash32/trait.Hasher.html +++ /dev/null @@ -1,11 +0,0 @@ -Hasher in hash32 - Rust

Trait hash32::Hasher

source ·
pub trait Hasher {
-    // Required methods
-    fn finish(&self) -> u32;
-    fn write(&mut self, bytes: &[u8]);
-}
Expand description

See core::hash::Hasher for details

-

Contract

-

Implementers of this trait must not perform any 64-bit (or 128-bit) operation while computing -the hash.

-

Required Methods§

source

fn finish(&self) -> u32

source

fn write(&mut self, bytes: &[u8])

Implementors§

source§

impl Hasher for hash32::FnvHasher

source§

impl Hasher for hash32::Murmur3Hasher

\ No newline at end of file diff --git a/docs/doc/heapless/all.html b/docs/doc/heapless/all.html deleted file mode 100644 index 8ad89a9..0000000 --- a/docs/doc/heapless/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate
\ No newline at end of file diff --git a/docs/doc/heapless/binary_heap/enum.Max.html b/docs/doc/heapless/binary_heap/enum.Max.html deleted file mode 100644 index 06c4d6b..0000000 --- a/docs/doc/heapless/binary_heap/enum.Max.html +++ /dev/null @@ -1,12 +0,0 @@ -Max in heapless::binary_heap - Rust
pub enum Max {}
Expand description

Max-heap

-

Trait Implementations§

source§

impl Kind for Max

Auto Trait Implementations§

§

impl RefUnwindSafe for Max

§

impl Send for Max

§

impl Sync for Max

§

impl Unpin for Max

§

impl UnwindSafe for Max

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/binary_heap/enum.Min.html b/docs/doc/heapless/binary_heap/enum.Min.html deleted file mode 100644 index 8b5661a..0000000 --- a/docs/doc/heapless/binary_heap/enum.Min.html +++ /dev/null @@ -1,12 +0,0 @@ -Min in heapless::binary_heap - Rust
pub enum Min {}
Expand description

Min-heap

-

Trait Implementations§

source§

impl Kind for Min

Auto Trait Implementations§

§

impl RefUnwindSafe for Min

§

impl Send for Min

§

impl Sync for Min

§

impl Unpin for Min

§

impl UnwindSafe for Min

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/binary_heap/index.html b/docs/doc/heapless/binary_heap/index.html deleted file mode 100644 index 21b60da..0000000 --- a/docs/doc/heapless/binary_heap/index.html +++ /dev/null @@ -1,5 +0,0 @@ -heapless::binary_heap - Rust

Module heapless::binary_heap

source ·
Expand description

A priority queue implemented with a binary heap.

-

Insertion and popping the largest element have O(log n) time complexity. Checking the largest -/ smallest element is O(1).

-

Structs

  • A priority queue implemented with a binary heap.
  • Structure wrapping a mutable reference to the greatest item on a -BinaryHeap.

Enums

Traits

  • The binary heap kind: min-heap or max-heap
\ No newline at end of file diff --git a/docs/doc/heapless/binary_heap/sidebar-items.js b/docs/doc/heapless/binary_heap/sidebar-items.js deleted file mode 100644 index 1a0b7ee..0000000 --- a/docs/doc/heapless/binary_heap/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["Max","Min"],"struct":["BinaryHeap","PeekMut"],"trait":["Kind"]}; \ No newline at end of file diff --git a/docs/doc/heapless/binary_heap/struct.BinaryHeap.html b/docs/doc/heapless/binary_heap/struct.BinaryHeap.html deleted file mode 100644 index 661d551..0000000 --- a/docs/doc/heapless/binary_heap/struct.BinaryHeap.html +++ /dev/null @@ -1,197 +0,0 @@ -BinaryHeap in heapless::binary_heap - Rust
pub struct BinaryHeap<T, K, const N: usize> { /* private fields */ }
Expand description

A priority queue implemented with a binary heap.

-

This can be either a min-heap or a max-heap.

-

It is a logic error for an item to be modified in such a way that the item’s ordering relative -to any other item, as determined by the Ord trait, changes while it is in the heap. This is -normally only possible through Cell, RefCell, global state, I/O, or unsafe code.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-
-// We can use peek to look at the next item in the heap. In this case,
-// there's no items in there yet so we get None.
-assert_eq!(heap.peek(), None);
-
-// Let's add some scores...
-heap.push(1).unwrap();
-heap.push(5).unwrap();
-heap.push(2).unwrap();
-
-// Now peek shows the most important item in the heap.
-assert_eq!(heap.peek(), Some(&5));
-
-// We can check the length of a heap.
-assert_eq!(heap.len(), 3);
-
-// We can iterate over the items in the heap, although they are returned in
-// a random order.
-for x in &heap {
-    println!("{}", x);
-}
-
-// If we instead pop these scores, they should come back in order.
-assert_eq!(heap.pop(), Some(5));
-assert_eq!(heap.pop(), Some(2));
-assert_eq!(heap.pop(), Some(1));
-assert_eq!(heap.pop(), None);
-
-// We can clear the heap of any remaining items.
-heap.clear();
-
-// The heap should now be empty.
-assert!(heap.is_empty())
-

Implementations§

source§

impl<T, K, const N: usize> BinaryHeap<T, K, N>

source

pub const fn new() -> Self

Creates an empty BinaryHeap as a $K-heap.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-// allocate the binary heap on the stack
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-heap.push(4).unwrap();
-
-// allocate the binary heap in a static variable
-static mut HEAP: BinaryHeap<i32, Max, 8> = BinaryHeap::new();
-
source§

impl<T, K, const N: usize> BinaryHeap<T, K, N>where - T: Ord, - K: Kind,

source

pub fn capacity(&self) -> usize

Returns the capacity of the binary heap.

-
source

pub fn clear(&mut self)

Drops all items from the binary heap.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-heap.push(1).unwrap();
-heap.push(3).unwrap();
-
-assert!(!heap.is_empty());
-
-heap.clear();
-
-assert!(heap.is_empty());
-
source

pub fn len(&self) -> usize

Returns the length of the binary heap.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-heap.push(1).unwrap();
-heap.push(3).unwrap();
-
-assert_eq!(heap.len(), 2);
-
source

pub fn is_empty(&self) -> bool

Checks if the binary heap is empty.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-
-assert!(heap.is_empty());
-
-heap.push(3).unwrap();
-heap.push(5).unwrap();
-heap.push(1).unwrap();
-
-assert!(!heap.is_empty());
-
source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator visiting all values in the underlying vector, in arbitrary order.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-heap.push(1).unwrap();
-heap.push(2).unwrap();
-heap.push(3).unwrap();
-heap.push(4).unwrap();
-
-// Print 1, 2, 3, 4 in arbitrary order
-for x in heap.iter() {
-    println!("{}", x);
-
-}
-
source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns a mutable iterator visiting all values in the underlying vector, in arbitrary order.

-

WARNING Mutating the items in the binary heap can leave the heap in an inconsistent -state.

-
source

pub fn peek(&self) -> Option<&T>

Returns the top (greatest if max-heap, smallest if min-heap) item in the binary heap, or -None if it is empty.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-assert_eq!(heap.peek(), None);
-
-heap.push(1).unwrap();
-heap.push(5).unwrap();
-heap.push(2).unwrap();
-assert_eq!(heap.peek(), Some(&5));
-
source

pub fn peek_mut(&mut self) -> Option<PeekMut<'_, T, K, N>>

Returns a mutable reference to the greatest item in the binary heap, or -None if it is empty.

-

Note: If the PeekMut value is leaked, the heap may be in an -inconsistent state.

-
Examples
-

Basic usage:

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-assert!(heap.peek_mut().is_none());
-
-heap.push(1);
-heap.push(5);
-heap.push(2);
-{
-    let mut val = heap.peek_mut().unwrap();
-    *val = 0;
-}
-
-assert_eq!(heap.peek(), Some(&2));
-
source

pub fn pop(&mut self) -> Option<T>

Removes the top (greatest if max-heap, smallest if min-heap) item from the binary heap and -returns it, or None if it is empty.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-heap.push(1).unwrap();
-heap.push(3).unwrap();
-
-assert_eq!(heap.pop(), Some(3));
-assert_eq!(heap.pop(), Some(1));
-assert_eq!(heap.pop(), None);
-
source

pub unsafe fn pop_unchecked(&mut self) -> T

Removes the top (greatest if max-heap, smallest if min-heap) item from the binary heap and -returns it, without checking if the binary heap is empty.

-
source

pub fn push(&mut self, item: T) -> Result<(), T>

Pushes an item onto the binary heap.

- -
use heapless::binary_heap::{BinaryHeap, Max};
-
-let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-heap.push(3).unwrap();
-heap.push(5).unwrap();
-heap.push(1).unwrap();
-
-assert_eq!(heap.len(), 3);
-assert_eq!(heap.peek(), Some(&5));
-
source

pub unsafe fn push_unchecked(&mut self, item: T)

Pushes an item onto the binary heap without first checking if it’s full.

-
source

pub fn into_vec(self) -> Vec<T, N>

Returns the underlying Vec<T,N>. Order is arbitrary and time is O(1).

-

Trait Implementations§

source§

impl<T, K, const N: usize> Clone for BinaryHeap<T, K, N>where - K: Kind, - T: Ord + Clone,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, K, const N: usize> Debug for BinaryHeap<T, K, N>where - K: Kind, - T: Ord + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, K, const N: usize> Default for BinaryHeap<T, K, N>where - T: Ord, - K: Kind,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'a, T, K, const N: usize> IntoIterator for &'a BinaryHeap<T, K, N>where - K: Kind, - T: Ord,

§

type Item = &'a T

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<T, K, const N: usize> RefUnwindSafe for BinaryHeap<T, K, N>where - K: RefUnwindSafe, - T: RefUnwindSafe,

§

impl<T, K, const N: usize> Send for BinaryHeap<T, K, N>where - K: Send, - T: Send,

§

impl<T, K, const N: usize> Sync for BinaryHeap<T, K, N>where - K: Sync, - T: Sync,

§

impl<T, K, const N: usize> Unpin for BinaryHeap<T, K, N>where - K: Unpin, - T: Unpin,

§

impl<T, K, const N: usize> UnwindSafe for BinaryHeap<T, K, N>where - K: UnwindSafe, - T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/binary_heap/struct.PeekMut.html b/docs/doc/heapless/binary_heap/struct.PeekMut.html deleted file mode 100644 index 5d589b7..0000000 --- a/docs/doc/heapless/binary_heap/struct.PeekMut.html +++ /dev/null @@ -1,32 +0,0 @@ -PeekMut in heapless::binary_heap - Rust
pub struct PeekMut<'a, T, K, const N: usize>where
-    T: Ord,
-    K: Kind,{ /* private fields */ }
Expand description

Structure wrapping a mutable reference to the greatest item on a -BinaryHeap.

-

This struct is created by the peek_mut method on BinaryHeap. See -its documentation for more.

-

Implementations§

source§

impl<'a, T, K, const N: usize> PeekMut<'a, T, K, N>where - T: Ord, - K: Kind,

source

pub fn pop(this: PeekMut<'a, T, K, N>) -> T

Removes the peeked value from the heap and returns it.

-

Trait Implementations§

source§

impl<T, K, const N: usize> Deref for PeekMut<'_, T, K, N>where - T: Ord, - K: Kind,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
source§

impl<T, K, const N: usize> DerefMut for PeekMut<'_, T, K, N>where - T: Ord, - K: Kind,

source§

fn deref_mut(&mut self) -> &mut T

Mutably dereferences the value.
source§

impl<T, K, const N: usize> Drop for PeekMut<'_, T, K, N>where - T: Ord, - K: Kind,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a, T, K, const N: usize> RefUnwindSafe for PeekMut<'a, T, K, N>where - K: RefUnwindSafe, - T: RefUnwindSafe,

§

impl<'a, T, K, const N: usize> Send for PeekMut<'a, T, K, N>where - K: Send, - T: Send,

§

impl<'a, T, K, const N: usize> Sync for PeekMut<'a, T, K, N>where - K: Sync, - T: Sync,

§

impl<'a, T, K, const N: usize> Unpin for PeekMut<'a, T, K, N>

§

impl<'a, T, K, const N: usize> !UnwindSafe for PeekMut<'a, T, K, N>

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/binary_heap/trait.Kind.html b/docs/doc/heapless/binary_heap/trait.Kind.html deleted file mode 100644 index b953014..0000000 --- a/docs/doc/heapless/binary_heap/trait.Kind.html +++ /dev/null @@ -1,2 +0,0 @@ -Kind in heapless::binary_heap - Rust
pub trait Kind: Sealed { }
Expand description

The binary heap kind: min-heap or max-heap

-

Implementors§

source§

impl Kind for Max

source§

impl Kind for Min

\ No newline at end of file diff --git a/docs/doc/heapless/deque/struct.Deque.html b/docs/doc/heapless/deque/struct.Deque.html deleted file mode 100644 index bed2056..0000000 --- a/docs/doc/heapless/deque/struct.Deque.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../heapless/struct.Deque.html...

- - - \ No newline at end of file diff --git a/docs/doc/heapless/enum.Entry.html b/docs/doc/heapless/enum.Entry.html deleted file mode 100644 index c0e1366..0000000 --- a/docs/doc/heapless/enum.Entry.html +++ /dev/null @@ -1,24 +0,0 @@ -Entry in heapless - Rust

Enum heapless::Entry

source ·
pub enum Entry<'a, K, V, const N: usize> {
-    Occupied(OccupiedEntry<'a, K, V, N>),
-    Vacant(VacantEntry<'a, K, V, N>),
-}
Expand description

A view into an entry in the map

-

Variants§

§

Occupied(OccupiedEntry<'a, K, V, N>)

The entry corresponding to the key K exists in the map

-
§

Vacant(VacantEntry<'a, K, V, N>)

The entry corresponding to the key K does not exist in the map

-

Auto Trait Implementations§

§

impl<'a, K, V, const N: usize> RefUnwindSafe for Entry<'a, K, V, N>where - K: RefUnwindSafe, - V: RefUnwindSafe,

§

impl<'a, K, V, const N: usize> Send for Entry<'a, K, V, N>where - K: Send, - V: Send,

§

impl<'a, K, V, const N: usize> Sync for Entry<'a, K, V, N>where - K: Sync, - V: Sync,

§

impl<'a, K, V, const N: usize> Unpin for Entry<'a, K, V, N>where - K: Unpin,

§

impl<'a, K, V, const N: usize> !UnwindSafe for Entry<'a, K, V, N>

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/histbuf/struct.HistoryBuffer.html b/docs/doc/heapless/histbuf/struct.HistoryBuffer.html deleted file mode 100644 index e82b382..0000000 --- a/docs/doc/heapless/histbuf/struct.HistoryBuffer.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../heapless/struct.HistoryBuffer.html...

- - - \ No newline at end of file diff --git a/docs/doc/heapless/histbuf/struct.OldestOrdered.html b/docs/doc/heapless/histbuf/struct.OldestOrdered.html deleted file mode 100644 index 5f3824b..0000000 --- a/docs/doc/heapless/histbuf/struct.OldestOrdered.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../heapless/struct.OldestOrdered.html...

- - - \ No newline at end of file diff --git a/docs/doc/heapless/index.html b/docs/doc/heapless/index.html deleted file mode 100644 index e3ac204..0000000 --- a/docs/doc/heapless/index.html +++ /dev/null @@ -1,64 +0,0 @@ -heapless - Rust

Crate heapless

source ·
Expand description

static friendly data structures that don’t require dynamic memory allocation

-

The core principle behind heapless is that its data structures are backed by a static memory -allocation. For example, you can think of heapless::Vec as an alternative version of -std::Vec with fixed capacity and that can’t be re-allocated on the fly (e.g. via push).

-

All heapless data structures store their memory allocation inline and specify their capacity -via their type parameter N. This means that you can instantiate a heapless data structure on -the stack, in a static variable, or even in the heap.

- -
use heapless::Vec; // fixed capacity `std::Vec`
-
-// on the stack
-let mut xs: Vec<u8, 8> = Vec::new(); // can hold up to 8 elements
-xs.push(42).unwrap();
-assert_eq!(xs.pop(), Some(42));
-
-// in a `static` variable
-static mut XS: Vec<u8, 8> = Vec::new();
-
-let xs = unsafe { &mut XS };
-
-xs.push(42);
-assert_eq!(xs.pop(), Some(42));
-
-// in the heap (though kind of pointless because no reallocation)
-let mut ys: Box<Vec<u8, 8>> = Box::new(Vec::new());
-ys.push(42).unwrap();
-assert_eq!(ys.pop(), Some(42));
-

Because they have fixed capacity heapless data structures don’t implicitly reallocate. This -means that operations like heapless::Vec.push are truly constant time rather than amortized -constant time with potentially unbounded (depends on the allocator) worst case execution time -(which is bad / unacceptable for hard real time applications).

-

heapless data structures don’t use a memory allocator which means no risk of an uncatchable -Out Of Memory (OOM) condition while performing operations on them. It’s certainly possible to -run out of capacity while growing heapless data structures, but the API lets you handle this -possibility by returning a Result on operations that may exhaust the capacity of the data -structure.

-

List of currently implemented data structures:

- -

Optional Features

-

The heapless crate provides the following optional Cargo features:

- -

Minimum Supported Rust Version (MSRV)

-

This crate is guaranteed to compile on stable Rust 1.51 and up with its default set of features. -It might compile on older versions but that may change in any new patch release.

-

Re-exports

  • pub use binary_heap::BinaryHeap;
  • pub use indexmap::Bucket;
  • pub use indexmap::Pos;

Modules

  • A priority queue implemented with a binary heap.
  • A fixed sorted priority linked list, similar to BinaryHeap but with different properties -on push, pop, etc. -For example, the sorting of the list will never memcpy the underlying value, so having large -objects in the list will not cause a performance hit.

Structs

Enums

  • A view into an entry in the map

Type Aliases

\ No newline at end of file diff --git a/docs/doc/heapless/indexmap/enum.Entry.html b/docs/doc/heapless/indexmap/enum.Entry.html deleted file mode 100644 index d262792..0000000 --- a/docs/doc/heapless/indexmap/enum.Entry.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../heapless/enum.Entry.html...

- - - \ No newline at end of file diff --git a/docs/doc/heapless/indexmap/struct.IndexMap.html b/docs/doc/heapless/indexmap/struct.IndexMap.html deleted file mode 100644 index 62bda9b..0000000 --- a/docs/doc/heapless/indexmap/struct.IndexMap.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../heapless/struct.IndexMap.html...

- - - \ No newline at end of file diff --git a/docs/doc/heapless/indexmap/struct.OccupiedEntry.html b/docs/doc/heapless/indexmap/struct.OccupiedEntry.html deleted file mode 100644 index 1571dfb..0000000 --- a/docs/doc/heapless/indexmap/struct.OccupiedEntry.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../heapless/struct.OccupiedEntry.html...

- - - \ No newline at end of file diff --git a/docs/doc/heapless/indexmap/struct.VacantEntry.html b/docs/doc/heapless/indexmap/struct.VacantEntry.html deleted file mode 100644 index fdd96b9..0000000 --- a/docs/doc/heapless/indexmap/struct.VacantEntry.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../heapless/struct.VacantEntry.html...

- - - \ No newline at end of file diff --git a/docs/doc/heapless/indexmap/type.FnvIndexMap.html b/docs/doc/heapless/indexmap/type.FnvIndexMap.html deleted file mode 100644 index 833b42e..0000000 --- a/docs/doc/heapless/indexmap/type.FnvIndexMap.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../heapless/type.FnvIndexMap.html...

- - - \ No newline at end of file diff --git a/docs/doc/heapless/indexset/struct.IndexSet.html b/docs/doc/heapless/indexset/struct.IndexSet.html deleted file mode 100644 index 94efaaf..0000000 --- a/docs/doc/heapless/indexset/struct.IndexSet.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../heapless/struct.IndexSet.html...

- - - \ No newline at end of file diff --git a/docs/doc/heapless/indexset/type.FnvIndexSet.html b/docs/doc/heapless/indexset/type.FnvIndexSet.html deleted file mode 100644 index 3324f20..0000000 --- a/docs/doc/heapless/indexset/type.FnvIndexSet.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../heapless/type.FnvIndexSet.html...

- - - \ No newline at end of file diff --git a/docs/doc/heapless/linear_map/struct.LinearMap.html b/docs/doc/heapless/linear_map/struct.LinearMap.html deleted file mode 100644 index a377206..0000000 --- a/docs/doc/heapless/linear_map/struct.LinearMap.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../heapless/struct.LinearMap.html...

- - - \ No newline at end of file diff --git a/docs/doc/heapless/sidebar-items.js b/docs/doc/heapless/sidebar-items.js deleted file mode 100644 index 0e3275a..0000000 --- a/docs/doc/heapless/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"enum":["Entry"],"mod":["binary_heap","sorted_linked_list"],"struct":["Deque","HistoryBuffer","IndexMap","IndexSet","LinearMap","OccupiedEntry","OldestOrdered","String","VacantEntry","Vec"],"type":["FnvIndexMap","FnvIndexSet"]}; \ No newline at end of file diff --git a/docs/doc/heapless/sorted_linked_list/index.html b/docs/doc/heapless/sorted_linked_list/index.html deleted file mode 100644 index b1e2903..0000000 --- a/docs/doc/heapless/sorted_linked_list/index.html +++ /dev/null @@ -1,21 +0,0 @@ -heapless::sorted_linked_list - Rust
Expand description

A fixed sorted priority linked list, similar to BinaryHeap but with different properties -on push, pop, etc. -For example, the sorting of the list will never memcpy the underlying value, so having large -objects in the list will not cause a performance hit.

-

Examples

-
use heapless::sorted_linked_list::{SortedLinkedList, Max};
-let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-// The largest value will always be first
-ll.push(1).unwrap();
-assert_eq!(ll.peek(), Some(&1));
-
-ll.push(2).unwrap();
-assert_eq!(ll.peek(), Some(&2));
-
-ll.push(3).unwrap();
-assert_eq!(ll.peek(), Some(&3));
-
-// This will not fit in the queue.
-assert_eq!(ll.push(4), Err(4));
-

Structs

Traits

  • The linked list kind: min-list or max-list
  • Trait for defining an index for the linked list, never implemented by users.
\ No newline at end of file diff --git a/docs/doc/heapless/sorted_linked_list/sidebar-items.js b/docs/doc/heapless/sorted_linked_list/sidebar-items.js deleted file mode 100644 index ae6b39f..0000000 --- a/docs/doc/heapless/sorted_linked_list/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"struct":["FindMut","Iter","LinkedIndexU16","LinkedIndexU8","LinkedIndexUsize","Max","Min","Node","SortedLinkedList"],"trait":["Kind","SortedLinkedListIndex"]}; \ No newline at end of file diff --git a/docs/doc/heapless/sorted_linked_list/struct.FindMut.html b/docs/doc/heapless/sorted_linked_list/struct.FindMut.html deleted file mode 100644 index ec2f2a5..0000000 --- a/docs/doc/heapless/sorted_linked_list/struct.FindMut.html +++ /dev/null @@ -1,77 +0,0 @@ -FindMut in heapless::sorted_linked_list - Rust
pub struct FindMut<'a, T, Idx, K, const N: usize>where
-    T: Ord,
-    Idx: SortedLinkedListIndex,
-    K: Kind,{ /* private fields */ }
Expand description

Implementations§

source§

impl<'a, T, Idx, K, const N: usize> FindMut<'a, T, Idx, K, N>where - T: Ord, - Idx: SortedLinkedListIndex, - K: Kind,

source

pub fn pop(self) -> T

This will pop the element from the list.

-

Complexity is worst-case O(1).

-
Example
-
use heapless::sorted_linked_list::{SortedLinkedList, Max};
-let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-ll.push(1).unwrap();
-ll.push(2).unwrap();
-ll.push(3).unwrap();
-
-// Find a value and update it
-let mut find = ll.find_mut(|v| *v == 2).unwrap();
-find.pop();
-
-assert_eq!(ll.pop(), Ok(3));
-assert_eq!(ll.pop(), Ok(1));
-assert_eq!(ll.pop(), Err(()));
-
source

pub fn finish(self)

This will resort the element into the correct position in the list if needed. The resorting -will only happen if the element has been accessed mutably.

-

Same as calling drop.

-

Complexity is worst-case O(N).

-
Example
-
use heapless::sorted_linked_list::{SortedLinkedList, Max};
-let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-ll.push(1).unwrap();
-ll.push(2).unwrap();
-ll.push(3).unwrap();
-
-let mut find = ll.find_mut(|v| *v == 2).unwrap();
-find.finish(); // No resort, we did not access the value.
-
-let mut find = ll.find_mut(|v| *v == 2).unwrap();
-*find += 1000;
-find.finish(); // Will resort, we accessed (and updated) the value.
-
-assert_eq!(ll.pop(), Ok(1002));
-assert_eq!(ll.pop(), Ok(3));
-assert_eq!(ll.pop(), Ok(1));
-assert_eq!(ll.pop(), Err(()));
-

Trait Implementations§

source§

impl<T, Idx, K, const N: usize> Deref for FindMut<'_, T, Idx, K, N>where - T: Ord, - Idx: SortedLinkedListIndex, - K: Kind,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<T, Idx, K, const N: usize> DerefMut for FindMut<'_, T, Idx, K, N>where - T: Ord, - Idx: SortedLinkedListIndex, - K: Kind,

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<T, Idx, K, const N: usize> Drop for FindMut<'_, T, Idx, K, N>where - T: Ord, - Idx: SortedLinkedListIndex, - K: Kind,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a, T, Idx, K, const N: usize> RefUnwindSafe for FindMut<'a, T, Idx, K, N>where - Idx: RefUnwindSafe, - K: RefUnwindSafe, - T: RefUnwindSafe,

§

impl<'a, T, Idx, K, const N: usize> Send for FindMut<'a, T, Idx, K, N>where - Idx: Send, - K: Send, - T: Send,

§

impl<'a, T, Idx, K, const N: usize> Sync for FindMut<'a, T, Idx, K, N>where - Idx: Sync, - K: Sync, - T: Sync,

§

impl<'a, T, Idx, K, const N: usize> Unpin for FindMut<'a, T, Idx, K, N>where - Idx: Unpin,

§

impl<'a, T, Idx, K, const N: usize> !UnwindSafe for FindMut<'a, T, Idx, K, N>

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/sorted_linked_list/struct.Iter.html b/docs/doc/heapless/sorted_linked_list/struct.Iter.html deleted file mode 100644 index 3ba80ae..0000000 --- a/docs/doc/heapless/sorted_linked_list/struct.Iter.html +++ /dev/null @@ -1,209 +0,0 @@ -Iter in heapless::sorted_linked_list - Rust
pub struct Iter<'a, T, Idx, K, const N: usize>where
-    T: Ord,
-    Idx: SortedLinkedListIndex,
-    K: Kind,{ /* private fields */ }
Expand description

Iterator for the linked list.

-

Trait Implementations§

source§

impl<'a, T, Idx, K, const N: usize> Iterator for Iter<'a, T, Idx, K, N>where - T: Ord, - Idx: SortedLinkedListIndex, - K: Kind,

§

type Item = &'a T

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<Self::Item>

Advances the iterator and returns the next value. Read more
§

fn next_chunk<const N: usize>( - &mut self -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where - Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
1.0.0§

fn count(self) -> usizewhere - Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0§

fn last(self) -> Option<Self::Item>where - Self: Sized,

Consumes the iterator, returning the last element. Read more
§

fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0§

fn step_by(self, step: usize) -> StepBy<Self>where - Self: Sized,

Creates an iterator starting at the same point, but stepping by -the given amount at each iteration. Read more
1.0.0§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where - Self: Sized, - U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where - Self: Sized, - U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>where - Self: Sized, - G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator -between adjacent items of the original iterator. Read more
1.0.0§

fn map<B, F>(self, f: F) -> Map<Self, F>where - Self: Sized, - F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each -element. Read more
1.21.0§

fn for_each<F>(self, f: F)where - Self: Sized, - F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0§

fn filter<P>(self, predicate: P) -> Filter<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element -should be yielded. Read more
1.0.0§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>where - Self: Sized, - F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0§

fn enumerate(self) -> Enumerate<Self>where - Self: Sized,

Creates an iterator which gives the current iteration count as well as -the next value. Read more
1.0.0§

fn peekable(self) -> Peekable<Self>where - Self: Sized,

Creates an iterator which can use the peek and peek_mut methods -to look at the next element of the iterator without consuming it. See -their documentation for more information. Read more
1.0.0§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where - Self: Sized, - P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0§

fn skip(self, n: usize) -> Skip<Self>where - Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0§

fn take(self, n: usize) -> Take<Self>where - Self: Sized,

Creates an iterator that yields the first n elements, or fewer -if the underlying iterator ends sooner. Read more
1.0.0§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>where - Self: Sized, - F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but -unlike fold, produces a new iterator. Read more
1.0.0§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where - Self: Sized, - U: IntoIterator, - F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
§

fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>where - Self: Sized, - F: FnMut(&[Self::Item; N]) -> R,

🔬This is a nightly-only experimental API. (iter_map_windows)
Calls the given function f for each contiguous window of size N over -self and returns an iterator over the outputs of f. Like slice::windows(), -the windows during mapping overlap as well. Read more
1.0.0§

fn fuse(self) -> Fuse<Self>where - Self: Sized,

Creates an iterator which ends after the first [None]. Read more
1.0.0§

fn inspect<F>(self, f: F) -> Inspect<Self, F>where - Self: Sized, - F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0§

fn by_ref(&mut self) -> &mut Selfwhere - Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0§

fn collect<B>(self) -> Bwhere - B: FromIterator<Self::Item>, - Self: Sized,

Transforms an iterator into a collection. Read more
§

fn collect_into<E>(self, collection: &mut E) -> &mut Ewhere - E: Extend<Self::Item>, - Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0§

fn partition<B, F>(self, f: F) -> (B, B)where - Self: Sized, - B: Default + Extend<Self::Item>, - F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
§

fn is_partitioned<P>(self, predicate: P) -> boolwhere - Self: Sized, - P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate, -such that all those that return true precede all those that return false. Read more
1.27.0§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere - Self: Sized, - F: FnMut(B, Self::Item) -> R, - R: Try<Output = B>,

An iterator method that applies a function as long as it returns -successfully, producing a single, final value. Read more
1.27.0§

fn try_for_each<F, R>(&mut self, f: F) -> Rwhere - Self: Sized, - F: FnMut(Self::Item) -> R, - R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the -iterator, stopping at the first error and returning that error. Read more
1.0.0§

fn fold<B, F>(self, init: B, f: F) -> Bwhere - Self: Sized, - F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation, -returning the final result. Read more
1.51.0§

fn reduce<F>(self, f: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing -operation. Read more
§

fn try_reduce<F, R>( - &mut self, - f: F -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> R, - R: Try<Output = Self::Item>, - <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the -closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0§

fn all<F>(&mut self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0§

fn any<F>(&mut self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0§

fn find_map<B, F>(&mut self, f: F) -> Option<B>where - Self: Sized, - F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns -the first non-none result. Read more
§

fn try_find<F, R>( - &mut self, - f: F -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere - Self: Sized, - F: FnMut(&Self::Item) -> R, - R: Try<Output = bool>, - <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns -the first true result or the first error. Read more
1.0.0§

fn position<P>(&mut self, predicate: P) -> Option<usize>where - Self: Sized, - P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.6.0§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>where - B: Ord, - Self: Sized, - F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the -specified function. Read more
1.15.0§

fn max_by<F>(self, compare: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the -specified comparison function. Read more
1.6.0§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>where - B: Ord, - Self: Sized, - F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the -specified function. Read more
1.15.0§

fn min_by<F>(self, compare: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the -specified comparison function. Read more
1.0.0§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where - FromA: Default + Extend<A>, - FromB: Default + Extend<B>, - Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0§

fn copied<'a, T>(self) -> Copied<Self>where - T: 'a + Copy, - Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0§

fn cloned<'a, T>(self) -> Cloned<Self>where - T: 'a + Clone, - Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where - Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0§

fn sum<S>(self) -> Swhere - Self: Sized, - S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0§

fn product<P>(self) -> Pwhere - Self: Sized, - P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this [Iterator] with those -of another with respect to the specified comparison function. Read more
1.5.0§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>where - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Lexicographically compares the [PartialOrd] elements of -this [Iterator] with those of another. The comparison works like short-circuit -evaluation, returning a result without comparing the remaining elements. -As soon as an order can be determined, the evaluation stops and a result is returned. Read more
§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this [Iterator] with those -of another with respect to the specified comparison function. Read more
1.5.0§

fn eq<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialEq<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are equal to those of -another. Read more
§

fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this [Iterator] are equal to those of -another with respect to the specified equality function. Read more
1.5.0§

fn ne<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialEq<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are not equal to those of -another. Read more
1.5.0§

fn lt<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are lexicographically -less than those of another. Read more
1.5.0§

fn le<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are lexicographically -less or equal to those of another. Read more
1.5.0§

fn gt<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are lexicographically -greater than those of another. Read more
1.5.0§

fn ge<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are lexicographically -greater than or equal to those of another. Read more
§

fn is_sorted_by<F>(self, compare: F) -> boolwhere - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
§

fn is_sorted_by_key<F, K>(self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> K, - K: PartialOrd<K>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction -function. Read more

Auto Trait Implementations§

§

impl<'a, T, Idx, K, const N: usize> RefUnwindSafe for Iter<'a, T, Idx, K, N>where - Idx: RefUnwindSafe, - K: RefUnwindSafe, - T: RefUnwindSafe,

§

impl<'a, T, Idx, K, const N: usize> Send for Iter<'a, T, Idx, K, N>where - Idx: Send + Sync, - K: Sync, - T: Sync,

§

impl<'a, T, Idx, K, const N: usize> Sync for Iter<'a, T, Idx, K, N>where - Idx: Sync, - K: Sync, - T: Sync,

§

impl<'a, T, Idx, K, const N: usize> Unpin for Iter<'a, T, Idx, K, N>where - Idx: Unpin,

§

impl<'a, T, Idx, K, const N: usize> UnwindSafe for Iter<'a, T, Idx, K, N>where - Idx: UnwindSafe + RefUnwindSafe, - K: RefUnwindSafe, - T: RefUnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<I> IntoIterator for Iwhere - I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/sorted_linked_list/struct.LinkedIndexU16.html b/docs/doc/heapless/sorted_linked_list/struct.LinkedIndexU16.html deleted file mode 100644 index 9360464..0000000 --- a/docs/doc/heapless/sorted_linked_list/struct.LinkedIndexU16.html +++ /dev/null @@ -1,19 +0,0 @@ -LinkedIndexU16 in heapless::sorted_linked_list - Rust
pub struct LinkedIndexU16(/* private fields */);
Expand description

Index for the SortedLinkedList with specific backing storage.

-

Trait Implementations§

source§

impl Clone for LinkedIndexU16

source§

fn clone(&self) -> LinkedIndexU16

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LinkedIndexU16

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for LinkedIndexU16

source§

fn cmp(&self, other: &LinkedIndexU16) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<LinkedIndexU16> for LinkedIndexU16

source§

fn eq(&self, other: &LinkedIndexU16) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<LinkedIndexU16> for LinkedIndexU16

source§

fn partial_cmp(&self, other: &LinkedIndexU16) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for LinkedIndexU16

source§

impl Eq for LinkedIndexU16

source§

impl SortedLinkedListIndex for LinkedIndexU16

source§

impl StructuralEq for LinkedIndexU16

source§

impl StructuralPartialEq for LinkedIndexU16

Auto Trait Implementations§

§

impl RefUnwindSafe for LinkedIndexU16

§

impl Send for LinkedIndexU16

§

impl Sync for LinkedIndexU16

§

impl Unpin for LinkedIndexU16

§

impl UnwindSafe for LinkedIndexU16

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/sorted_linked_list/struct.LinkedIndexU8.html b/docs/doc/heapless/sorted_linked_list/struct.LinkedIndexU8.html deleted file mode 100644 index 903c1b9..0000000 --- a/docs/doc/heapless/sorted_linked_list/struct.LinkedIndexU8.html +++ /dev/null @@ -1,19 +0,0 @@ -LinkedIndexU8 in heapless::sorted_linked_list - Rust
pub struct LinkedIndexU8(/* private fields */);
Expand description

Index for the SortedLinkedList with specific backing storage.

-

Trait Implementations§

source§

impl Clone for LinkedIndexU8

source§

fn clone(&self) -> LinkedIndexU8

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LinkedIndexU8

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for LinkedIndexU8

source§

fn cmp(&self, other: &LinkedIndexU8) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<LinkedIndexU8> for LinkedIndexU8

source§

fn eq(&self, other: &LinkedIndexU8) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<LinkedIndexU8> for LinkedIndexU8

source§

fn partial_cmp(&self, other: &LinkedIndexU8) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for LinkedIndexU8

source§

impl Eq for LinkedIndexU8

source§

impl SortedLinkedListIndex for LinkedIndexU8

source§

impl StructuralEq for LinkedIndexU8

source§

impl StructuralPartialEq for LinkedIndexU8

Auto Trait Implementations§

§

impl RefUnwindSafe for LinkedIndexU8

§

impl Send for LinkedIndexU8

§

impl Sync for LinkedIndexU8

§

impl Unpin for LinkedIndexU8

§

impl UnwindSafe for LinkedIndexU8

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/sorted_linked_list/struct.LinkedIndexUsize.html b/docs/doc/heapless/sorted_linked_list/struct.LinkedIndexUsize.html deleted file mode 100644 index 19647d2..0000000 --- a/docs/doc/heapless/sorted_linked_list/struct.LinkedIndexUsize.html +++ /dev/null @@ -1,19 +0,0 @@ -LinkedIndexUsize in heapless::sorted_linked_list - Rust
pub struct LinkedIndexUsize(/* private fields */);
Expand description

Index for the SortedLinkedList with specific backing storage.

-

Trait Implementations§

source§

impl Clone for LinkedIndexUsize

source§

fn clone(&self) -> LinkedIndexUsize

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LinkedIndexUsize

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for LinkedIndexUsize

source§

fn cmp(&self, other: &LinkedIndexUsize) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<LinkedIndexUsize> for LinkedIndexUsize

source§

fn eq(&self, other: &LinkedIndexUsize) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<LinkedIndexUsize> for LinkedIndexUsize

source§

fn partial_cmp(&self, other: &LinkedIndexUsize) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for LinkedIndexUsize

source§

impl Eq for LinkedIndexUsize

source§

impl SortedLinkedListIndex for LinkedIndexUsize

source§

impl StructuralEq for LinkedIndexUsize

source§

impl StructuralPartialEq for LinkedIndexUsize

Auto Trait Implementations§

§

impl RefUnwindSafe for LinkedIndexUsize

§

impl Send for LinkedIndexUsize

§

impl Sync for LinkedIndexUsize

§

impl Unpin for LinkedIndexUsize

§

impl UnwindSafe for LinkedIndexUsize

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/sorted_linked_list/struct.Max.html b/docs/doc/heapless/sorted_linked_list/struct.Max.html deleted file mode 100644 index d988b96..0000000 --- a/docs/doc/heapless/sorted_linked_list/struct.Max.html +++ /dev/null @@ -1,12 +0,0 @@ -Max in heapless::sorted_linked_list - Rust
pub struct Max;
Expand description

Marker for Max sorted SortedLinkedList.

-

Trait Implementations§

source§

impl Kind for Max

Auto Trait Implementations§

§

impl RefUnwindSafe for Max

§

impl Send for Max

§

impl Sync for Max

§

impl Unpin for Max

§

impl UnwindSafe for Max

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/sorted_linked_list/struct.Min.html b/docs/doc/heapless/sorted_linked_list/struct.Min.html deleted file mode 100644 index 87d1905..0000000 --- a/docs/doc/heapless/sorted_linked_list/struct.Min.html +++ /dev/null @@ -1,12 +0,0 @@ -Min in heapless::sorted_linked_list - Rust
pub struct Min;
Expand description

Marker for Min sorted SortedLinkedList.

-

Trait Implementations§

source§

impl Kind for Min

Auto Trait Implementations§

§

impl RefUnwindSafe for Min

§

impl Send for Min

§

impl Sync for Min

§

impl Unpin for Min

§

impl UnwindSafe for Min

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/sorted_linked_list/struct.Node.html b/docs/doc/heapless/sorted_linked_list/struct.Node.html deleted file mode 100644 index b555e20..0000000 --- a/docs/doc/heapless/sorted_linked_list/struct.Node.html +++ /dev/null @@ -1,22 +0,0 @@ -Node in heapless::sorted_linked_list - Rust
pub struct Node<T, Idx> { /* private fields */ }
Expand description

A node in the SortedLinkedList.

-

Auto Trait Implementations§

§

impl<T, Idx> RefUnwindSafe for Node<T, Idx>where - Idx: RefUnwindSafe, - T: RefUnwindSafe,

§

impl<T, Idx> Send for Node<T, Idx>where - Idx: Send, - T: Send,

§

impl<T, Idx> Sync for Node<T, Idx>where - Idx: Sync, - T: Sync,

§

impl<T, Idx> Unpin for Node<T, Idx>where - Idx: Unpin, - T: Unpin,

§

impl<T, Idx> UnwindSafe for Node<T, Idx>where - Idx: UnwindSafe, - T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/sorted_linked_list/struct.SortedLinkedList.html b/docs/doc/heapless/sorted_linked_list/struct.SortedLinkedList.html deleted file mode 100644 index 04093d0..0000000 --- a/docs/doc/heapless/sorted_linked_list/struct.SortedLinkedList.html +++ /dev/null @@ -1,151 +0,0 @@ -SortedLinkedList in heapless::sorted_linked_list - Rust
pub struct SortedLinkedList<T, Idx, K, const N: usize>where
-    Idx: SortedLinkedListIndex,{ /* private fields */ }
Expand description

The linked list.

-

Implementations§

source§

impl<T, K, const N: usize> SortedLinkedList<T, LinkedIndexU8, K, N>

source

pub const fn new_u8() -> Self

Create a new linked list.

-
source§

impl<T, K, const N: usize> SortedLinkedList<T, LinkedIndexU16, K, N>

source

pub const fn new_u16() -> Self

Create a new linked list.

-
source§

impl<T, K, const N: usize> SortedLinkedList<T, LinkedIndexUsize, K, N>

source

pub const fn new_usize() -> Self

Create a new linked list.

-
source§

impl<T, Idx, K, const N: usize> SortedLinkedList<T, Idx, K, N>where - T: Ord, - Idx: SortedLinkedListIndex, - K: Kind,

source

pub unsafe fn push_unchecked(&mut self, value: T)

Pushes a value onto the list without checking if the list is full.

-

Complexity is worst-case O(N).

-
Safety
-

Assumes that the list is not full.

-
source

pub fn push(&mut self, value: T) -> Result<(), T>

Pushes an element to the linked list and sorts it into place.

-

Complexity is worst-case O(N).

-
Example
-
use heapless::sorted_linked_list::{SortedLinkedList, Max};
-let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-// The largest value will always be first
-ll.push(1).unwrap();
-assert_eq!(ll.peek(), Some(&1));
-
-ll.push(2).unwrap();
-assert_eq!(ll.peek(), Some(&2));
-
-ll.push(3).unwrap();
-assert_eq!(ll.peek(), Some(&3));
-
-// This will not fit in the queue.
-assert_eq!(ll.push(4), Err(4));
-
source

pub fn iter(&self) -> Iter<'_, T, Idx, K, N>

Get an iterator over the sorted list.

-
Example
-
use heapless::sorted_linked_list::{SortedLinkedList, Max};
-let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-ll.push(1).unwrap();
-ll.push(2).unwrap();
-
-let mut iter = ll.iter();
-
-assert_eq!(iter.next(), Some(&2));
-assert_eq!(iter.next(), Some(&1));
-assert_eq!(iter.next(), None);
-
source

pub fn find_mut<F>(&mut self, f: F) -> Option<FindMut<'_, T, Idx, K, N>>where - F: FnMut(&T) -> bool,

Find an element in the list that can be changed and resorted.

-
Example
-
use heapless::sorted_linked_list::{SortedLinkedList, Max};
-let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-ll.push(1).unwrap();
-ll.push(2).unwrap();
-ll.push(3).unwrap();
-
-// Find a value and update it
-let mut find = ll.find_mut(|v| *v == 2).unwrap();
-*find += 1000;
-find.finish();
-
-assert_eq!(ll.pop(), Ok(1002));
-assert_eq!(ll.pop(), Ok(3));
-assert_eq!(ll.pop(), Ok(1));
-assert_eq!(ll.pop(), Err(()));
-
source

pub fn peek(&self) -> Option<&T>

Peek at the first element.

-
Example
-
use heapless::sorted_linked_list::{SortedLinkedList, Max, Min};
-let mut ll_max: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-// The largest value will always be first
-ll_max.push(1).unwrap();
-assert_eq!(ll_max.peek(), Some(&1));
-ll_max.push(2).unwrap();
-assert_eq!(ll_max.peek(), Some(&2));
-ll_max.push(3).unwrap();
-assert_eq!(ll_max.peek(), Some(&3));
-
-let mut ll_min: SortedLinkedList<_, _, Min, 3> = SortedLinkedList::new_usize();
-
-// The Smallest value will always be first
-ll_min.push(3).unwrap();
-assert_eq!(ll_min.peek(), Some(&3));
-ll_min.push(2).unwrap();
-assert_eq!(ll_min.peek(), Some(&2));
-ll_min.push(1).unwrap();
-assert_eq!(ll_min.peek(), Some(&1));
-
source

pub unsafe fn pop_unchecked(&mut self) -> T

Pop an element from the list without checking so the list is not empty.

-
Safety
-

Assumes that the list is not empty.

-
source

pub fn pop(&mut self) -> Result<T, ()>

Pops the first element in the list.

-

Complexity is worst-case O(1).

-
Example
-
use heapless::sorted_linked_list::{SortedLinkedList, Max};
-let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-ll.push(1).unwrap();
-ll.push(2).unwrap();
-
-assert_eq!(ll.pop(), Ok(2));
-assert_eq!(ll.pop(), Ok(1));
-assert_eq!(ll.pop(), Err(()));
-
source

pub fn is_full(&self) -> bool

Checks if the linked list is full.

-
Example
-
use heapless::sorted_linked_list::{SortedLinkedList, Max};
-let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-assert_eq!(ll.is_full(), false);
-
-ll.push(1).unwrap();
-assert_eq!(ll.is_full(), false);
-ll.push(2).unwrap();
-assert_eq!(ll.is_full(), false);
-ll.push(3).unwrap();
-assert_eq!(ll.is_full(), true);
-
source

pub fn is_empty(&self) -> bool

Checks if the linked list is empty.

-
Example
-
use heapless::sorted_linked_list::{SortedLinkedList, Max};
-let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-
-assert_eq!(ll.is_empty(), true);
-
-ll.push(1).unwrap();
-assert_eq!(ll.is_empty(), false);
-

Trait Implementations§

source§

impl<T, Idx, K, const N: usize> Debug for SortedLinkedList<T, Idx, K, N>where - T: Ord + Debug, - Idx: SortedLinkedListIndex, - K: Kind,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, Idx, K, const N: usize> Drop for SortedLinkedList<T, Idx, K, N>where - Idx: SortedLinkedListIndex,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<T, Idx, K, const N: usize> RefUnwindSafe for SortedLinkedList<T, Idx, K, N>where - Idx: RefUnwindSafe, - K: RefUnwindSafe, - T: RefUnwindSafe,

§

impl<T, Idx, K, const N: usize> Send for SortedLinkedList<T, Idx, K, N>where - Idx: Send, - K: Send, - T: Send,

§

impl<T, Idx, K, const N: usize> Sync for SortedLinkedList<T, Idx, K, N>where - Idx: Sync, - K: Sync, - T: Sync,

§

impl<T, Idx, K, const N: usize> Unpin for SortedLinkedList<T, Idx, K, N>where - Idx: Unpin, - K: Unpin, - T: Unpin,

§

impl<T, Idx, K, const N: usize> UnwindSafe for SortedLinkedList<T, Idx, K, N>where - Idx: UnwindSafe, - K: UnwindSafe, - T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/sorted_linked_list/trait.Kind.html b/docs/doc/heapless/sorted_linked_list/trait.Kind.html deleted file mode 100644 index 68cad2b..0000000 --- a/docs/doc/heapless/sorted_linked_list/trait.Kind.html +++ /dev/null @@ -1,2 +0,0 @@ -Kind in heapless::sorted_linked_list - Rust
pub trait Kind: Sealed { }
Expand description

The linked list kind: min-list or max-list

-

Implementors§

source§

impl Kind for Max

source§

impl Kind for Min

\ No newline at end of file diff --git a/docs/doc/heapless/sorted_linked_list/trait.SortedLinkedListIndex.html b/docs/doc/heapless/sorted_linked_list/trait.SortedLinkedListIndex.html deleted file mode 100644 index 2f8bc57..0000000 --- a/docs/doc/heapless/sorted_linked_list/trait.SortedLinkedListIndex.html +++ /dev/null @@ -1,2 +0,0 @@ -SortedLinkedListIndex in heapless::sorted_linked_list - Rust
pub trait SortedLinkedListIndex: Copy { }
Expand description

Trait for defining an index for the linked list, never implemented by users.

-

Implementors§

\ No newline at end of file diff --git a/docs/doc/heapless/string/struct.String.html b/docs/doc/heapless/string/struct.String.html deleted file mode 100644 index 85a356a..0000000 --- a/docs/doc/heapless/string/struct.String.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../heapless/struct.String.html...

- - - \ No newline at end of file diff --git a/docs/doc/heapless/struct.Deque.html b/docs/doc/heapless/struct.Deque.html deleted file mode 100644 index 70bfcb3..0000000 --- a/docs/doc/heapless/struct.Deque.html +++ /dev/null @@ -1,89 +0,0 @@ -Deque in heapless - Rust

Struct heapless::Deque

source ·
pub struct Deque<T, const N: usize> { /* private fields */ }
Expand description

A fixed capacity double-ended queue.

-

Examples

-
use heapless::Deque;
-
-// A deque with a fixed capacity of 8 elements allocated on the stack
-let mut deque = Deque::<_, 8>::new();
-
-// You can use it as a good old FIFO queue.
-deque.push_back(1);
-deque.push_back(2);
-assert_eq!(deque.len(), 2);
-
-assert_eq!(deque.pop_front(), Some(1));
-assert_eq!(deque.pop_front(), Some(2));
-assert_eq!(deque.len(), 0);
-
-// Deque is double-ended, you can push and pop from the front and back.
-deque.push_back(1);
-deque.push_front(2);
-deque.push_back(3);
-deque.push_front(4);
-assert_eq!(deque.pop_front(), Some(4));
-assert_eq!(deque.pop_front(), Some(2));
-assert_eq!(deque.pop_front(), Some(1));
-assert_eq!(deque.pop_front(), Some(3));
-
-// You can iterate it, yielding all the elements front-to-back.
-for x in &deque {
-    println!("{}", x);
-}
-

Implementations§

source§

impl<T, const N: usize> Deque<T, N>

source

pub const fn new() -> Self

Constructs a new, empty deque with a fixed capacity of N

-
Examples
-
use heapless::Deque;
-
-// allocate the deque on the stack
-let mut x: Deque<u8, 16> = Deque::new();
-
-// allocate the deque in a static variable
-static mut X: Deque<u8, 16> = Deque::new();
-
source

pub const fn capacity(&self) -> usize

Returns the maximum number of elements the deque can hold.

-
source

pub const fn len(&self) -> usize

Returns the number of elements currently in the deque.

-
source

pub fn clear(&mut self)

Clears the deque, removing all values.

-
source

pub fn is_empty(&self) -> bool

Returns whether the deque is empty.

-
source

pub fn is_full(&self) -> bool

Returns whether the deque is full (i.e. if len() == capacity().

-
source

pub fn as_slices(&self) -> (&[T], &[T])

Returns a pair of slices which contain, in order, the contents of the Deque.

-
source

pub fn as_mut_slices(&mut self) -> (&mut [T], &mut [T])

Returns a pair of mutable slices which contain, in order, the contents of the Deque.

-
source

pub fn front(&self) -> Option<&T>

Provides a reference to the front element, or None if the Deque is empty.

-
source

pub fn front_mut(&mut self) -> Option<&mut T>

Provides a mutable reference to the front element, or None if the Deque is empty.

-
source

pub fn back(&self) -> Option<&T>

Provides a reference to the back element, or None if the Deque is empty.

-
source

pub fn back_mut(&mut self) -> Option<&mut T>

Provides a mutable reference to the back element, or None if the Deque is empty.

-
source

pub fn pop_front(&mut self) -> Option<T>

Removes the item from the front of the deque and returns it, or None if it’s empty

-
source

pub fn pop_back(&mut self) -> Option<T>

Removes the item from the back of the deque and returns it, or None if it’s empty

-
source

pub fn push_front(&mut self, item: T) -> Result<(), T>

Appends an item to the front of the deque

-

Returns back the item if the deque is full

-
source

pub fn push_back(&mut self, item: T) -> Result<(), T>

Appends an item to the back of the deque

-

Returns back the item if the deque is full

-
source

pub unsafe fn pop_front_unchecked(&mut self) -> T

Removes an item from the front of the deque and returns it, without checking that the deque -is not empty

-
Safety
-

It’s undefined behavior to call this on an empty deque

-
source

pub unsafe fn pop_back_unchecked(&mut self) -> T

Removes an item from the back of the deque and returns it, without checking that the deque -is not empty

-
Safety
-

It’s undefined behavior to call this on an empty deque

-
source

pub unsafe fn push_front_unchecked(&mut self, item: T)

Appends an item to the front of the deque

-
Safety
-

This assumes the deque is not full.

-
source

pub unsafe fn push_back_unchecked(&mut self, item: T)

Appends an item to the back of the deque

-
Safety
-

This assumes the deque is not full.

-
source

pub fn iter(&self) -> Iter<'_, T, N>

Returns an iterator over the deque.

-
source

pub fn iter_mut(&mut self) -> IterMut<'_, T, N>

Returns an iterator that allows modifying each value.

-

Trait Implementations§

source§

impl<T, const N: usize> Clone for Deque<T, N>where - T: Clone,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug, const N: usize> Debug for Deque<T, N>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, const N: usize> Default for Deque<T, N>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<T, const N: usize> Drop for Deque<T, N>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'a, T, const N: usize> IntoIterator for &'a Deque<T, N>

§

type Item = &'a T

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, T, N>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, T, const N: usize> IntoIterator for &'a mut Deque<T, N>

§

type Item = &'a mut T

The type of the elements being iterated over.
§

type IntoIter = IterMut<'a, T, N>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, const N: usize> IntoIterator for Deque<T, N>

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T, N>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<T, const N: usize> RefUnwindSafe for Deque<T, N>where - T: RefUnwindSafe,

§

impl<T, const N: usize> Send for Deque<T, N>where - T: Send,

§

impl<T, const N: usize> Sync for Deque<T, N>where - T: Sync,

§

impl<T, const N: usize> Unpin for Deque<T, N>where - T: Unpin,

§

impl<T, const N: usize> UnwindSafe for Deque<T, N>where - T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/struct.HistoryBuffer.html b/docs/doc/heapless/struct.HistoryBuffer.html deleted file mode 100644 index 5e4af65..0000000 --- a/docs/doc/heapless/struct.HistoryBuffer.html +++ /dev/null @@ -1,1089 +0,0 @@ -HistoryBuffer in heapless - Rust

Struct heapless::HistoryBuffer

source ·
pub struct HistoryBuffer<T, const N: usize> { /* private fields */ }
Expand description

A “history buffer”, similar to a write-only ring buffer of fixed length.

-

This buffer keeps a fixed number of elements. On write, the oldest element -is overwritten. Thus, the buffer is useful to keep a history of values with -some desired depth, and for example calculate a rolling average.

-

Examples

-
use heapless::HistoryBuffer;
-
-// Initialize a new buffer with 8 elements.
-let mut buf = HistoryBuffer::<_, 8>::new();
-
-// Starts with no data
-assert_eq!(buf.recent(), None);
-
-buf.write(3);
-buf.write(5);
-buf.extend(&[4, 4]);
-
-// The most recent written element is a four.
-assert_eq!(buf.recent(), Some(&4));
-
-// To access all elements in an unspecified order, use `as_slice()`.
-for el in buf.as_slice() { println!("{:?}", el); }
-
-// Now we can prepare an average of all values, which comes out to 4.
-let avg = buf.as_slice().iter().sum::<usize>() / buf.len();
-assert_eq!(avg, 4);
-

Implementations§

source§

impl<T, const N: usize> HistoryBuffer<T, N>

source

pub const fn new() -> Self

Constructs a new history buffer.

-

The construction of a HistoryBuffer works in const contexts.

-
Examples
-
use heapless::HistoryBuffer;
-
-// Allocate a 16-element buffer on the stack
-let x: HistoryBuffer<u8, 16> = HistoryBuffer::new();
-assert_eq!(x.len(), 0);
-
source

pub fn clear(&mut self)

Clears the buffer, replacing every element with the default value of -type T.

-
source§

impl<T, const N: usize> HistoryBuffer<T, N>where - T: Copy + Clone,

source

pub fn new_with(t: T) -> Self

Constructs a new history buffer, where every element is the given value.

-
Examples
-
use heapless::HistoryBuffer;
-
-// Allocate a 16-element buffer on the stack
-let mut x: HistoryBuffer<u8, 16> = HistoryBuffer::new_with(4);
-// All elements are four
-assert_eq!(x.as_slice(), [4; 16]);
-
source

pub fn clear_with(&mut self, t: T)

Clears the buffer, replacing every element with the given value.

-
source§

impl<T, const N: usize> HistoryBuffer<T, N>

source

pub fn len(&self) -> usize

Returns the current fill level of the buffer.

-
source

pub fn capacity(&self) -> usize

Returns the capacity of the buffer, which is the length of the -underlying backing array.

-
source

pub fn write(&mut self, t: T)

Writes an element to the buffer, overwriting the oldest value.

-
source

pub fn extend_from_slice(&mut self, other: &[T])where - T: Clone,

Clones and writes all elements in a slice to the buffer.

-

If the slice is longer than the buffer, only the last self.len() -elements will actually be stored.

-
source

pub fn recent(&self) -> Option<&T>

Returns a reference to the most recently written value.

-
Examples
-
use heapless::HistoryBuffer;
-
-let mut x: HistoryBuffer<u8, 16> = HistoryBuffer::new();
-x.write(4);
-x.write(10);
-assert_eq!(x.recent(), Some(&10));
-
source

pub fn as_slice(&self) -> &[T]

Returns the array slice backing the buffer, without keeping track -of the write position. Therefore, the element order is unspecified.

-
source

pub fn oldest_ordered<'a>(&'a self) -> OldestOrdered<'a, T, N>

Returns an iterator for iterating over the buffer from oldest to newest.

-
Examples
-
use heapless::HistoryBuffer;
-
-let mut buffer: HistoryBuffer<u8, 6> = HistoryBuffer::new();
-buffer.extend([0, 0, 0, 1, 2, 3, 4, 5, 6]);
-let expected = [1, 2, 3, 4, 5, 6];
-for (x, y) in buffer.oldest_ordered().zip(expected.iter()) {
-    assert_eq!(x, y)
-}
-
-

Methods from Deref<Target = [T]>§

pub fn flatten(&self) -> &[T]

🔬This is a nightly-only experimental API. (slice_flatten)

Takes a &[[T; N]], and flattens it to a &[T].

-
Panics
-

This panics if the length of the resulting slice would overflow a usize.

-

This is only possible when flattening a slice of arrays of zero-sized -types, and thus tends to be irrelevant in practice. If -size_of::<T>() > 0, this will never panic.

-
Examples
-
#![feature(slice_flatten)]
-
-assert_eq!([[1, 2, 3], [4, 5, 6]].flatten(), &[1, 2, 3, 4, 5, 6]);
-
-assert_eq!(
-    [[1, 2, 3], [4, 5, 6]].flatten(),
-    [[1, 2], [3, 4], [5, 6]].flatten(),
-);
-
-let slice_of_empty_arrays: &[[i32; 0]] = &[[], [], [], [], []];
-assert!(slice_of_empty_arrays.flatten().is_empty());
-
-let empty_slice_of_arrays: &[[u32; 10]] = &[];
-assert!(empty_slice_of_arrays.flatten().is_empty());
-
1.23.0

pub fn is_ascii(&self) -> bool

Checks if all bytes in this slice are within the ASCII range.

-

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this slice is_ascii, returns it as a slice of -ASCII characters, otherwise returns None.

-

pub unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar]

🔬This is a nightly-only experimental API. (ascii_char)

Converts this slice of bytes into a slice of ASCII characters, -without checking whether they’re valid.

-
Safety
-

Every byte in the slice must be in 0..=127, or else this is UB.

-
1.23.0

pub fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool

Checks that two slices are an ASCII case-insensitive match.

-

Same as to_ascii_lowercase(a) == to_ascii_lowercase(b), -but without allocating and copying temporaries.

-
1.60.0

pub fn escape_ascii(&self) -> EscapeAscii<'_>

Returns an iterator that produces an escaped version of this slice, -treating it as an ASCII string.

-
Examples
-

-let s = b"0\t\r\n'\"\\\x9d";
-let escaped = s.escape_ascii().to_string();
-assert_eq!(escaped, "0\\t\\r\\n\\'\\\"\\\\\\x9d");
-

pub fn trim_ascii_start(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with leading ASCII whitespace bytes removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b" \t hello world\n".trim_ascii_start(), b"hello world\n");
-assert_eq!(b"  ".trim_ascii_start(), b"");
-assert_eq!(b"".trim_ascii_start(), b"");
-

pub fn trim_ascii_end(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with trailing ASCII whitespace bytes removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b"\r hello world\n ".trim_ascii_end(), b"\r hello world");
-assert_eq!(b"  ".trim_ascii_end(), b"");
-assert_eq!(b"".trim_ascii_end(), b"");
-

pub fn trim_ascii(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with leading and trailing ASCII whitespace bytes -removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b"\r hello world\n ".trim_ascii(), b"hello world");
-assert_eq!(b"  ".trim_ascii(), b"");
-assert_eq!(b"".trim_ascii(), b"");
-

pub fn as_str(&self) -> &str

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a UTF-8 str.

-

pub fn as_bytes(&self) -> &[u8]

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a slice of u8 bytes.

-
1.0.0

pub fn len(&self) -> usize

Returns the number of elements in the slice.

-
Examples
-
let a = [1, 2, 3];
-assert_eq!(a.len(), 3);
-
1.0.0

pub fn is_empty(&self) -> bool

Returns true if the slice has a length of 0.

-
Examples
-
let a = [1, 2, 3];
-assert!(!a.is_empty());
-
1.0.0

pub fn first(&self) -> Option<&T>

Returns the first element of the slice, or None if it is empty.

-
Examples
-
let v = [10, 40, 30];
-assert_eq!(Some(&10), v.first());
-
-let w: &[i32] = &[];
-assert_eq!(None, w.first());
-
1.5.0

pub fn split_first(&self) -> Option<(&T, &[T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
let x = &[0, 1, 2];
-
-if let Some((first, elements)) = x.split_first() {
-    assert_eq!(first, &0);
-    assert_eq!(elements, &[1, 2]);
-}
-
1.5.0

pub fn split_last(&self) -> Option<(&T, &[T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
let x = &[0, 1, 2];
-
-if let Some((last, elements)) = x.split_last() {
-    assert_eq!(last, &2);
-    assert_eq!(elements, &[0, 1]);
-}
-
1.0.0

pub fn last(&self) -> Option<&T>

Returns the last element of the slice, or None if it is empty.

-
Examples
-
let v = [10, 40, 30];
-assert_eq!(Some(&30), v.last());
-
-let w: &[i32] = &[];
-assert_eq!(None, w.last());
-

pub fn first_chunk<const N: usize>(&self) -> Option<&[T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the first N elements of the slice, or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let u = [10, 40, 30];
-assert_eq!(Some(&[10, 40]), u.first_chunk::<2>());
-
-let v: &[i32] = &[10];
-assert_eq!(None, v.first_chunk::<2>());
-
-let w: &[i32] = &[];
-assert_eq!(Some(&[]), w.first_chunk::<0>());
-

pub fn split_first_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the first N elements of the slice and the remainder, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &[0, 1, 2];
-
-if let Some((first, elements)) = x.split_first_chunk::<2>() {
-    assert_eq!(first, &[0, 1]);
-    assert_eq!(elements, &[2]);
-}
-

pub fn split_last_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the last N elements of the slice and the remainder, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &[0, 1, 2];
-
-if let Some((last, elements)) = x.split_last_chunk::<2>() {
-    assert_eq!(last, &[1, 2]);
-    assert_eq!(elements, &[0]);
-}
-

pub fn last_chunk<const N: usize>(&self) -> Option<&[T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the last element of the slice, or None if it is empty.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let u = [10, 40, 30];
-assert_eq!(Some(&[40, 30]), u.last_chunk::<2>());
-
-let v: &[i32] = &[10];
-assert_eq!(None, v.last_chunk::<2>());
-
-let w: &[i32] = &[];
-assert_eq!(Some(&[]), w.last_chunk::<0>());
-
1.0.0

pub fn get<I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output>where - I: SliceIndex<[T]>,

Returns a reference to an element or subslice depending on the type of -index.

-
    -
  • If given a position, returns a reference to the element at that -position or None if out of bounds.
  • -
  • If given a range, returns the subslice corresponding to that range, -or None if out of bounds.
  • -
-
Examples
-
let v = [10, 40, 30];
-assert_eq!(Some(&40), v.get(1));
-assert_eq!(Some(&[10, 40][..]), v.get(0..2));
-assert_eq!(None, v.get(3));
-assert_eq!(None, v.get(0..4));
-
1.0.0

pub unsafe fn get_unchecked<I>( - &self, - index: I -) -> &<I as SliceIndex<[T]>>::Outputwhere - I: SliceIndex<[T]>,

Returns a reference to an element or subslice, without doing bounds -checking.

-

For a safe alternative see get.

-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior -even if the resulting reference is not used.

-
Examples
-
let x = &[1, 2, 4];
-
-unsafe {
-    assert_eq!(x.get_unchecked(1), &2);
-}
-
1.0.0

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the slice’s buffer.

-

The caller must ensure that the slice outlives the pointer this -function returns, or else it will end up pointing to garbage.

-

The caller must also ensure that the memory the pointer (non-transitively) points to -is never written to (except inside an UnsafeCell) using this pointer or any pointer -derived from it. If you need to mutate the contents of the slice, use as_mut_ptr.

-

Modifying the container referenced by this slice may cause its buffer -to be reallocated, which would also make any pointers to it invalid.

-
Examples
-
let x = &[1, 2, 4];
-let x_ptr = x.as_ptr();
-
-unsafe {
-    for i in 0..x.len() {
-        assert_eq!(x.get_unchecked(i), &*x_ptr.add(i));
-    }
-}
-
1.48.0

pub fn as_ptr_range(&self) -> Range<*const T>

Returns the two raw pointers spanning the slice.

-

The returned range is half-open, which means that the end pointer -points one past the last element of the slice. This way, an empty -slice is represented by two equal pointers, and the difference between -the two pointers represents the size of the slice.

-

See as_ptr for warnings on using these pointers. The end pointer -requires extra caution, as it does not point to a valid element in the -slice.

-

This function is useful for interacting with foreign interfaces which -use two pointers to refer to a range of elements in memory, as is -common in C++.

-

It can also be useful to check if a pointer to an element refers to an -element of this slice:

- -
let a = [1, 2, 3];
-let x = &a[1] as *const _;
-let y = &5 as *const _;
-
-assert!(a.as_ptr_range().contains(&x));
-assert!(!a.as_ptr_range().contains(&y));
-
1.0.0

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the slice.

-

The iterator yields all items from start to end.

-
Examples
-
let x = &[1, 2, 4];
-let mut iterator = x.iter();
-
-assert_eq!(iterator.next(), Some(&1));
-assert_eq!(iterator.next(), Some(&2));
-assert_eq!(iterator.next(), Some(&4));
-assert_eq!(iterator.next(), None);
-
1.0.0

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length -size. The windows overlap. If the slice is shorter than -size, the iterator returns no values.

-
Panics
-

Panics if size is 0.

-
Examples
-
let slice = ['r', 'u', 's', 't'];
-let mut iter = slice.windows(2);
-assert_eq!(iter.next().unwrap(), &['r', 'u']);
-assert_eq!(iter.next().unwrap(), &['u', 's']);
-assert_eq!(iter.next().unwrap(), &['s', 't']);
-assert!(iter.next().is_none());
-

If the slice is shorter than size:

- -
let slice = ['f', 'o', 'o'];
-let mut iter = slice.windows(4);
-assert!(iter.next().is_none());
-

There’s no windows_mut, as that existing would let safe code violate the -“only one &mut at a time to the same thing” rule. However, you can sometimes -use Cell::as_slice_of_cells in -conjunction with windows to accomplish something similar:

- -
use std::cell::Cell;
-
-let mut array = ['R', 'u', 's', 't', ' ', '2', '0', '1', '5'];
-let slice = &mut array[..];
-let slice_of_cells: &[Cell<char>] = Cell::from_mut(slice).as_slice_of_cells();
-for w in slice_of_cells.windows(3) {
-    Cell::swap(&w[0], &w[2]);
-}
-assert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
-
1.0.0

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last chunk will not have length chunk_size.

-

See chunks_exact for a variant of this iterator that returns chunks of always exactly -chunk_size elements, and rchunks for the same iterator but starting at the end of the -slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.chunks(2);
-assert_eq!(iter.next().unwrap(), &['l', 'o']);
-assert_eq!(iter.next().unwrap(), &['r', 'e']);
-assert_eq!(iter.next().unwrap(), &['m']);
-assert!(iter.next().is_none());
-
1.31.0

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved -from the remainder function of the iterator.

-

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the -resulting code better than in the case of chunks.

-

See chunks for a variant of this iterator that also returns the remainder as a smaller -chunk, and rchunks_exact for the same iterator but starting at the end of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.chunks_exact(2);
-assert_eq!(iter.next().unwrap(), &['l', 'o']);
-assert_eq!(iter.next().unwrap(), &['r', 'e']);
-assert!(iter.next().is_none());
-assert_eq!(iter.remainder(), &['m']);
-

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -assuming that there’s no remainder.

-
Safety
-

This may only be called when

-
    -
  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • -
  • N != 0.
  • -
-
Examples
-
#![feature(slice_as_chunks)]
-let slice: &[char] = &['l', 'o', 'r', 'e', 'm', '!'];
-let chunks: &[[char; 1]] =
-    // SAFETY: 1-element chunks never have remainder
-    unsafe { slice.as_chunks_unchecked() };
-assert_eq!(chunks, &[['l'], ['o'], ['r'], ['e'], ['m'], ['!']]);
-let chunks: &[[char; 3]] =
-    // SAFETY: The slice length (6) is a multiple of 3
-    unsafe { slice.as_chunks_unchecked() };
-assert_eq!(chunks, &[['l', 'o', 'r'], ['e', 'm', '!']]);
-
-// These would be unsound:
-// let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5
-// let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed
-

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -starting at the beginning of the slice, -and a remainder slice with length strictly less than N.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(slice_as_chunks)]
-let slice = ['l', 'o', 'r', 'e', 'm'];
-let (chunks, remainder) = slice.as_chunks();
-assert_eq!(chunks, &[['l', 'o'], ['r', 'e']]);
-assert_eq!(remainder, &['m']);
-

If you expect the slice to be an exact multiple, you can combine -let-else with an empty slice pattern:

- -
#![feature(slice_as_chunks)]
-let slice = ['R', 'u', 's', 't'];
-let (chunks, []) = slice.as_chunks::<2>() else {
-    panic!("slice didn't have even length")
-};
-assert_eq!(chunks, &[['R', 'u'], ['s', 't']]);
-

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -starting at the end of the slice, -and a remainder slice with length strictly less than N.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(slice_as_chunks)]
-let slice = ['l', 'o', 'r', 'e', 'm'];
-let (remainder, chunks) = slice.as_rchunks();
-assert_eq!(remainder, &['l']);
-assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]);
-

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are array references and do not overlap. If N does not divide the -length of the slice, then the last up to N-1 elements will be omitted and can be -retrieved from the remainder function of the iterator.

-

This method is the const generic equivalent of chunks_exact.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(array_chunks)]
-let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.array_chunks();
-assert_eq!(iter.next().unwrap(), &['l', 'o']);
-assert_eq!(iter.next().unwrap(), &['r', 'e']);
-assert!(iter.next().is_none());
-assert_eq!(iter.remainder(), &['m']);
-

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, -starting at the beginning of the slice.

-

This is the const generic equivalent of windows.

-

If N is greater than the size of the slice, it will return no windows.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(array_windows)]
-let slice = [0, 1, 2, 3];
-let mut iter = slice.array_windows();
-assert_eq!(iter.next().unwrap(), &[0, 1]);
-assert_eq!(iter.next().unwrap(), &[1, 2]);
-assert_eq!(iter.next().unwrap(), &[2, 3]);
-assert!(iter.next().is_none());
-
1.31.0

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end -of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last chunk will not have length chunk_size.

-

See rchunks_exact for a variant of this iterator that returns chunks of always exactly -chunk_size elements, and chunks for the same iterator but starting at the beginning -of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.rchunks(2);
-assert_eq!(iter.next().unwrap(), &['e', 'm']);
-assert_eq!(iter.next().unwrap(), &['o', 'r']);
-assert_eq!(iter.next().unwrap(), &['l']);
-assert!(iter.next().is_none());
-
1.31.0

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -end of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved -from the remainder function of the iterator.

-

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the -resulting code better than in the case of rchunks.

-

See rchunks for a variant of this iterator that also returns the remainder as a smaller -chunk, and chunks_exact for the same iterator but starting at the beginning of the -slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.rchunks_exact(2);
-assert_eq!(iter.next().unwrap(), &['e', 'm']);
-assert_eq!(iter.next().unwrap(), &['o', 'r']);
-assert!(iter.next().is_none());
-assert_eq!(iter.remainder(), &['l']);
-

pub fn group_by<F>(&self, pred: F) -> GroupBy<'_, T, F>where - F: FnMut(&T, &T) -> bool,

🔬This is a nightly-only experimental API. (slice_group_by)

Returns an iterator over the slice producing non-overlapping runs -of elements using the predicate to separate them.

-

The predicate is called on two elements following themselves, -it means the predicate is called on slice[0] and slice[1] -then on slice[1] and slice[2] and so on.

-
Examples
-
#![feature(slice_group_by)]
-
-let slice = &[1, 1, 1, 3, 3, 2, 2, 2];
-
-let mut iter = slice.group_by(|a, b| a == b);
-
-assert_eq!(iter.next(), Some(&[1, 1, 1][..]));
-assert_eq!(iter.next(), Some(&[3, 3][..]));
-assert_eq!(iter.next(), Some(&[2, 2, 2][..]));
-assert_eq!(iter.next(), None);
-

This method can be used to extract the sorted subslices:

- -
#![feature(slice_group_by)]
-
-let slice = &[1, 1, 2, 3, 2, 3, 2, 3, 4];
-
-let mut iter = slice.group_by(|a, b| a <= b);
-
-assert_eq!(iter.next(), Some(&[1, 1, 2, 3][..]));
-assert_eq!(iter.next(), Some(&[2, 3][..]));
-assert_eq!(iter.next(), Some(&[2, 3, 4][..]));
-assert_eq!(iter.next(), None);
-
1.0.0

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

-

The first will contain all indices from [0, mid) (excluding -the index mid itself) and the second will contain all -indices from [mid, len) (excluding the index len itself).

-
Panics
-

Panics if mid > len.

-
Examples
-
let v = [1, 2, 3, 4, 5, 6];
-
-{
-   let (left, right) = v.split_at(0);
-   assert_eq!(left, []);
-   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_at(2);
-    assert_eq!(left, [1, 2]);
-    assert_eq!(right, [3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_at(6);
-    assert_eq!(left, [1, 2, 3, 4, 5, 6]);
-    assert_eq!(right, []);
-}
-

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

🔬This is a nightly-only experimental API. (slice_split_at_unchecked)

Divides one slice into two at an index, without doing bounds checking.

-

The first will contain all indices from [0, mid) (excluding -the index mid itself) and the second will contain all -indices from [mid, len) (excluding the index len itself).

-

For a safe alternative see split_at.

-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior -even if the resulting reference is not used. The caller has to ensure that -0 <= mid <= self.len().

-
Examples
-
#![feature(slice_split_at_unchecked)]
-
-let v = [1, 2, 3, 4, 5, 6];
-
-unsafe {
-   let (left, right) = v.split_at_unchecked(0);
-   assert_eq!(left, []);
-   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
-}
-
-unsafe {
-    let (left, right) = v.split_at_unchecked(2);
-    assert_eq!(left, [1, 2]);
-    assert_eq!(right, [3, 4, 5, 6]);
-}
-
-unsafe {
-    let (left, right) = v.split_at_unchecked(6);
-    assert_eq!(left, [1, 2, 3, 4, 5, 6]);
-    assert_eq!(right, []);
-}
-

pub fn split_array_ref<const N: usize>(&self) -> (&[T; N], &[T])

🔬This is a nightly-only experimental API. (split_array)

Divides one slice into an array and a remainder slice at an index.

-

The array will contain all indices from [0, N) (excluding -the index N itself) and the slice will contain all -indices from [N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let v = &[1, 2, 3, 4, 5, 6][..];
-
-{
-   let (left, right) = v.split_array_ref::<0>();
-   assert_eq!(left, &[]);
-   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_array_ref::<2>();
-    assert_eq!(left, &[1, 2]);
-    assert_eq!(right, [3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_array_ref::<6>();
-    assert_eq!(left, &[1, 2, 3, 4, 5, 6]);
-    assert_eq!(right, []);
-}
-

pub fn rsplit_array_ref<const N: usize>(&self) -> (&[T], &[T; N])

🔬This is a nightly-only experimental API. (split_array)

Divides one slice into an array and a remainder slice at an index from -the end.

-

The slice will contain all indices from [0, len - N) (excluding -the index len - N itself) and the array will contain all -indices from [len - N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let v = &[1, 2, 3, 4, 5, 6][..];
-
-{
-   let (left, right) = v.rsplit_array_ref::<0>();
-   assert_eq!(left, [1, 2, 3, 4, 5, 6]);
-   assert_eq!(right, &[]);
-}
-
-{
-    let (left, right) = v.rsplit_array_ref::<2>();
-    assert_eq!(left, [1, 2, 3, 4]);
-    assert_eq!(right, &[5, 6]);
-}
-
-{
-    let (left, right) = v.rsplit_array_ref::<6>();
-    assert_eq!(left, []);
-    assert_eq!(right, &[1, 2, 3, 4, 5, 6]);
-}
-
1.0.0

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred. The matched element is not contained in the subslices.

-
Examples
-
let slice = [10, 40, 33, 20];
-let mut iter = slice.split(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10, 40]);
-assert_eq!(iter.next().unwrap(), &[20]);
-assert!(iter.next().is_none());
-

If the first element is matched, an empty slice will be the first item -returned by the iterator. Similarly, if the last element in the slice -is matched, an empty slice will be the last item returned by the -iterator:

- -
let slice = [10, 40, 33];
-let mut iter = slice.split(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10, 40]);
-assert_eq!(iter.next().unwrap(), &[]);
-assert!(iter.next().is_none());
-

If two matched elements are directly adjacent, an empty slice will be -present between them:

- -
let slice = [10, 6, 33, 20];
-let mut iter = slice.split(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10]);
-assert_eq!(iter.next().unwrap(), &[]);
-assert_eq!(iter.next().unwrap(), &[20]);
-assert!(iter.next().is_none());
-
1.51.0

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred. The matched element is contained in the end of the previous -subslice as a terminator.

-
Examples
-
let slice = [10, 40, 33, 20];
-let mut iter = slice.split_inclusive(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10, 40, 33]);
-assert_eq!(iter.next().unwrap(), &[20]);
-assert!(iter.next().is_none());
-

If the last element of the slice is matched, -that element will be considered the terminator of the preceding slice. -That slice will be the last item returned by the iterator.

- -
let slice = [3, 10, 40, 33];
-let mut iter = slice.split_inclusive(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[3]);
-assert_eq!(iter.next().unwrap(), &[10, 40, 33]);
-assert!(iter.next().is_none());
-
1.27.0

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred, starting at the end of the slice and working backwards. -The matched element is not contained in the subslices.

-
Examples
-
let slice = [11, 22, 33, 0, 44, 55];
-let mut iter = slice.rsplit(|num| *num == 0);
-
-assert_eq!(iter.next().unwrap(), &[44, 55]);
-assert_eq!(iter.next().unwrap(), &[11, 22, 33]);
-assert_eq!(iter.next(), None);
-

As with split(), if the first or last element is matched, an empty -slice will be the first (or last) item returned by the iterator.

- -
let v = &[0, 1, 1, 2, 3, 5, 8];
-let mut it = v.rsplit(|n| *n % 2 == 0);
-assert_eq!(it.next().unwrap(), &[]);
-assert_eq!(it.next().unwrap(), &[3, 5]);
-assert_eq!(it.next().unwrap(), &[1, 1]);
-assert_eq!(it.next().unwrap(), &[]);
-assert_eq!(it.next(), None);
-
1.0.0

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred, limited to returning at most n items. The matched element is -not contained in the subslices.

-

The last element returned, if any, will contain the remainder of the -slice.

-
Examples
-

Print the slice split once by numbers divisible by 3 (i.e., [10, 40], -[20, 60, 50]):

- -
let v = [10, 40, 30, 20, 60, 50];
-
-for group in v.splitn(2, |num| *num % 3 == 0) {
-    println!("{group:?}");
-}
-
1.0.0

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred limited to returning at most n items. This starts at the end of -the slice and works backwards. The matched element is not contained in -the subslices.

-

The last element returned, if any, will contain the remainder of the -slice.

-
Examples
-

Print the slice split once, starting from the end, by numbers divisible -by 3 (i.e., [50], [10, 40, 30, 20]):

- -
let v = [10, 40, 30, 20, 60, 50];
-
-for group in v.rsplitn(2, |num| *num % 3 == 0) {
-    println!("{group:?}");
-}
-
1.0.0

pub fn contains(&self, x: &T) -> boolwhere - T: PartialEq<T>,

Returns true if the slice contains an element with the given value.

-

This operation is O(n).

-

Note that if you have a sorted slice, binary_search may be faster.

-
Examples
-
let v = [10, 40, 30];
-assert!(v.contains(&30));
-assert!(!v.contains(&50));
-

If you do not have a &T, but some other value that you can compare -with one (for example, String implements PartialEq<str>), you can -use iter().any:

- -
let v = [String::from("hello"), String::from("world")]; // slice of `String`
-assert!(v.iter().any(|e| e == "hello")); // search with `&str`
-assert!(!v.iter().any(|e| e == "hi"));
-
1.0.0

pub fn starts_with(&self, needle: &[T]) -> boolwhere - T: PartialEq<T>,

Returns true if needle is a prefix of the slice.

-
Examples
-
let v = [10, 40, 30];
-assert!(v.starts_with(&[10]));
-assert!(v.starts_with(&[10, 40]));
-assert!(!v.starts_with(&[50]));
-assert!(!v.starts_with(&[10, 50]));
-

Always returns true if needle is an empty slice:

- -
let v = &[10, 40, 30];
-assert!(v.starts_with(&[]));
-let v: &[u8] = &[];
-assert!(v.starts_with(&[]));
-
1.0.0

pub fn ends_with(&self, needle: &[T]) -> boolwhere - T: PartialEq<T>,

Returns true if needle is a suffix of the slice.

-
Examples
-
let v = [10, 40, 30];
-assert!(v.ends_with(&[30]));
-assert!(v.ends_with(&[40, 30]));
-assert!(!v.ends_with(&[50]));
-assert!(!v.ends_with(&[50, 30]));
-

Always returns true if needle is an empty slice:

- -
let v = &[10, 40, 30];
-assert!(v.ends_with(&[]));
-let v: &[u8] = &[];
-assert!(v.ends_with(&[]));
-
1.51.0

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>where - P: SlicePattern<Item = T> + ?Sized, - T: PartialEq<T>,

Returns a subslice with the prefix removed.

-

If the slice starts with prefix, returns the subslice after the prefix, wrapped in Some. -If prefix is empty, simply returns the original slice.

-

If the slice does not start with prefix, returns None.

-
Examples
-
let v = &[10, 40, 30];
-assert_eq!(v.strip_prefix(&[10]), Some(&[40, 30][..]));
-assert_eq!(v.strip_prefix(&[10, 40]), Some(&[30][..]));
-assert_eq!(v.strip_prefix(&[50]), None);
-assert_eq!(v.strip_prefix(&[10, 50]), None);
-
-let prefix : &str = "he";
-assert_eq!(b"hello".strip_prefix(prefix.as_bytes()),
-           Some(b"llo".as_ref()));
-
1.51.0

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>where - P: SlicePattern<Item = T> + ?Sized, - T: PartialEq<T>,

Returns a subslice with the suffix removed.

-

If the slice ends with suffix, returns the subslice before the suffix, wrapped in Some. -If suffix is empty, simply returns the original slice.

-

If the slice does not end with suffix, returns None.

-
Examples
-
let v = &[10, 40, 30];
-assert_eq!(v.strip_suffix(&[30]), Some(&[10, 40][..]));
-assert_eq!(v.strip_suffix(&[40, 30]), Some(&[10][..]));
-assert_eq!(v.strip_suffix(&[50]), None);
-assert_eq!(v.strip_suffix(&[50, 30]), None);
-

Binary searches this slice for a given element. -If the slice is not sorted, the returned result is unspecified and -meaningless.

-

If the value is found then [Result::Ok] is returned, containing the -index of the matching element. If there are multiple matches, then any -one of the matches could be returned. The index is chosen -deterministically, but is subject to change in future versions of Rust. -If the value is not found then [Result::Err] is returned, containing -the index where a matching element could be inserted while maintaining -sorted order.

-

See also binary_search_by, binary_search_by_key, and partition_point.

-
Examples
-

Looks up a series of four elements. The first is found, with a -uniquely determined position; the second and third are not -found; the fourth could match any position in [1, 4].

- -
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-
-assert_eq!(s.binary_search(&13),  Ok(9));
-assert_eq!(s.binary_search(&4),   Err(7));
-assert_eq!(s.binary_search(&100), Err(13));
-let r = s.binary_search(&1);
-assert!(match r { Ok(1..=4) => true, _ => false, });
-

If you want to find that whole range of matching items, rather than -an arbitrary matching one, that can be done using partition_point:

- -
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-
-let low = s.partition_point(|x| x < &1);
-assert_eq!(low, 1);
-let high = s.partition_point(|x| x <= &1);
-assert_eq!(high, 5);
-let r = s.binary_search(&1);
-assert!((low..high).contains(&r.unwrap()));
-
-assert!(s[..low].iter().all(|&x| x < 1));
-assert!(s[low..high].iter().all(|&x| x == 1));
-assert!(s[high..].iter().all(|&x| x > 1));
-
-// For something not found, the "range" of equal items is empty
-assert_eq!(s.partition_point(|x| x < &11), 9);
-assert_eq!(s.partition_point(|x| x <= &11), 9);
-assert_eq!(s.binary_search(&11), Err(9));
-

If you want to insert an item to a sorted vector, while maintaining -sort order, consider using partition_point:

- -
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-let num = 42;
-let idx = s.partition_point(|&x| x < num);
-// The above is equivalent to `let idx = s.binary_search(&num).unwrap_or_else(|x| x);`
-s.insert(idx, num);
-assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
1.0.0

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>where - F: FnMut(&'a T) -> Ordering,

Binary searches this slice with a comparator function.

-

The comparator function should return an order code that indicates -whether its argument is Less, Equal or Greater the desired -target. -If the slice is not sorted or if the comparator function does not -implement an order consistent with the sort order of the underlying -slice, the returned result is unspecified and meaningless.

-

If the value is found then [Result::Ok] is returned, containing the -index of the matching element. If there are multiple matches, then any -one of the matches could be returned. The index is chosen -deterministically, but is subject to change in future versions of Rust. -If the value is not found then [Result::Err] is returned, containing -the index where a matching element could be inserted while maintaining -sorted order.

-

See also binary_search, binary_search_by_key, and partition_point.

-
Examples
-

Looks up a series of four elements. The first is found, with a -uniquely determined position; the second and third are not -found; the fourth could match any position in [1, 4].

- -
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-
-let seek = 13;
-assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Ok(9));
-let seek = 4;
-assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(7));
-let seek = 100;
-assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(13));
-let seek = 1;
-let r = s.binary_search_by(|probe| probe.cmp(&seek));
-assert!(match r { Ok(1..=4) => true, _ => false, });
-
1.10.0

pub fn binary_search_by_key<'a, B, F>( - &'a self, - b: &B, - f: F -) -> Result<usize, usize>where - F: FnMut(&'a T) -> B, - B: Ord,

Binary searches this slice with a key extraction function.

-

Assumes that the slice is sorted by the key, for instance with -sort_by_key using the same key extraction function. -If the slice is not sorted by the key, the returned result is -unspecified and meaningless.

-

If the value is found then [Result::Ok] is returned, containing the -index of the matching element. If there are multiple matches, then any -one of the matches could be returned. The index is chosen -deterministically, but is subject to change in future versions of Rust. -If the value is not found then [Result::Err] is returned, containing -the index where a matching element could be inserted while maintaining -sorted order.

-

See also binary_search, binary_search_by, and partition_point.

-
Examples
-

Looks up a series of four elements in a slice of pairs sorted by -their second elements. The first is found, with a uniquely -determined position; the second and third are not found; the -fourth could match any position in [1, 4].

- -
let s = [(0, 0), (2, 1), (4, 1), (5, 1), (3, 1),
-         (1, 2), (2, 3), (4, 5), (5, 8), (3, 13),
-         (1, 21), (2, 34), (4, 55)];
-
-assert_eq!(s.binary_search_by_key(&13, |&(a, b)| b),  Ok(9));
-assert_eq!(s.binary_search_by_key(&4, |&(a, b)| b),   Err(7));
-assert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13));
-let r = s.binary_search_by_key(&1, |&(a, b)| b);
-assert!(match r { Ok(1..=4) => true, _ => false, });
-
1.30.0

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmute the slice to a slice of another type, ensuring alignment of the types is -maintained.

-

This method splits the slice into three distinct slices: prefix, correctly aligned middle -slice of a new type, and the suffix slice. How exactly the slice is split up is not -specified; the middle part may be smaller than necessary. However, if this fails to return a -maximal middle part, that is because code is running in a context where performance does not -matter, such as a sanitizer attempting to find alignment bugs. Regular code running -in a default (debug or release) execution will return a maximal middle part.

-

This method has no purpose when either input element T or output element U are -zero-sized and will return the original slice without splitting anything.

-
Safety
-

This method is essentially a transmute with respect to the elements in the returned -middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

-
Examples
-

Basic usage:

- -
unsafe {
-    let bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];
-    let (prefix, shorts, suffix) = bytes.align_to::<u16>();
-    // less_efficient_algorithm_for_bytes(prefix);
-    // more_efficient_algorithm_for_aligned_shorts(shorts);
-    // less_efficient_algorithm_for_bytes(suffix);
-}
-

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])where - Simd<T, LANES>: AsRef<[T; LANES]>, - T: SimdElement, - LaneCount<LANES>: SupportedLaneCount,

🔬This is a nightly-only experimental API. (portable_simd)

Split a slice into a prefix, a middle of aligned SIMD types, and a suffix.

-

This is a safe wrapper around [slice::align_to], so has the same weak -postconditions as that method. You’re only assured that -self.len() == prefix.len() + middle.len() * LANES + suffix.len().

-

Notably, all of the following are possible:

-
    -
  • prefix.len() >= LANES.
  • -
  • middle.is_empty() despite self.len() >= 3 * LANES.
  • -
  • suffix.len() >= LANES.
  • -
-

That said, this is a safe method, so if you’re only writing safe code, -then this can at most cause incorrect logic, not unsoundness.

-
Panics
-

This will panic if the size of the SIMD type is different from -LANES times that of the scalar.

-

At the time of writing, the trait restrictions on Simd<T, LANES> keeps -that from ever happening, as only power-of-two numbers of lanes are -supported. It’s possible that, in the future, those restrictions might -be lifted in a way that would make it possible to see panics from this -method for something like LANES == 3.

-
Examples
-
#![feature(portable_simd)]
-use core::simd::SimdFloat;
-
-let short = &[1, 2, 3];
-let (prefix, middle, suffix) = short.as_simd::<4>();
-assert_eq!(middle, []); // Not enough elements for anything in the middle
-
-// They might be split in any possible way between prefix and suffix
-let it = prefix.iter().chain(suffix).copied();
-assert_eq!(it.collect::<Vec<_>>(), vec![1, 2, 3]);
-
-fn basic_simd_sum(x: &[f32]) -> f32 {
-    use std::ops::Add;
-    use std::simd::f32x4;
-    let (prefix, middle, suffix) = x.as_simd();
-    let sums = f32x4::from_array([
-        prefix.iter().copied().sum(),
-        0.0,
-        0.0,
-        suffix.iter().copied().sum(),
-    ]);
-    let sums = middle.iter().copied().fold(sums, f32x4::add);
-    sums.reduce_sum()
-}
-
-let numbers: Vec<f32> = (1..101).map(|x| x as _).collect();
-assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0);
-

pub fn is_sorted(&self) -> boolwhere - T: PartialOrd<T>,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted.

-

That is, for each element a and its following element b, a <= b must hold. If the -slice yields exactly zero or one element, true is returned.

-

Note that if Self::Item is only PartialOrd, but not Ord, the above definition -implies that this function returns false if any two consecutive items are not -comparable.

-
Examples
-
#![feature(is_sorted)]
-let empty: [i32; 0] = [];
-
-assert!([1, 2, 2, 9].is_sorted());
-assert!(![1, 3, 2, 4].is_sorted());
-assert!([0].is_sorted());
-assert!(empty.is_sorted());
-assert!(![0.0, 1.0, f32::NAN].is_sorted());
-

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> boolwhere - F: FnMut(&'a T, &'a T) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given comparator function.

-

Instead of using PartialOrd::partial_cmp, this function uses the given compare -function to determine the ordering of two elements. Apart from that, it’s equivalent to -is_sorted; see its documentation for more information.

-

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> boolwhere - F: FnMut(&'a T) -> K, - K: PartialOrd<K>,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given key extraction function.

-

Instead of comparing the slice’s elements directly, this function compares the keys of the -elements, as determined by f. Apart from that, it’s equivalent to is_sorted; see its -documentation for more information.

-
Examples
-
#![feature(is_sorted)]
-
-assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
-assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
-
1.52.0

pub fn partition_point<P>(&self, pred: P) -> usizewhere - P: FnMut(&T) -> bool,

Returns the index of the partition point according to the given predicate -(the index of the first element of the second partition).

-

The slice is assumed to be partitioned according to the given predicate. -This means that all elements for which the predicate returns true are at the start of the slice -and all elements for which the predicate returns false are at the end. -For example, [7, 15, 3, 5, 4, 12, 6] is partitioned under the predicate x % 2 != 0 -(all odd numbers are at the start, all even at the end).

-

If this slice is not partitioned, the returned result is unspecified and meaningless, -as this method performs a kind of binary search.

-

See also binary_search, binary_search_by, and binary_search_by_key.

-
Examples
-
let v = [1, 2, 3, 3, 5, 6, 7];
-let i = v.partition_point(|&x| x < 5);
-
-assert_eq!(i, 4);
-assert!(v[..i].iter().all(|&x| x < 5));
-assert!(v[i..].iter().all(|&x| !(x < 5)));
-

If all elements of the slice match the predicate, including if the slice -is empty, then the length of the slice will be returned:

- -
let a = [2, 4, 8];
-assert_eq!(a.partition_point(|x| x < &100), a.len());
-let a: [i32; 0] = [];
-assert_eq!(a.partition_point(|x| x < &100), 0);
-

If you want to insert an item to a sorted vector, while maintaining -sort order:

- -
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-let num = 42;
-let idx = s.partition_point(|&x| x < num);
-s.insert(idx, num);
-assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-

Trait Implementations§

source§

impl<T, const N: usize> AsRef<[T]> for HistoryBuffer<T, N>

source§

fn as_ref(&self) -> &[T]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T, const N: usize> Debug for HistoryBuffer<T, N>where - T: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, const N: usize> Default for HistoryBuffer<T, N>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<T, const N: usize> Deref for HistoryBuffer<T, N>

§

type Target = [T]

The resulting type after dereferencing.
source§

fn deref(&self) -> &[T]

Dereferences the value.
source§

impl<T, const N: usize> Drop for HistoryBuffer<T, N>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'a, T, const N: usize> Extend<&'a T> for HistoryBuffer<T, N>where - T: 'a + Clone,

source§

fn extend<I>(&mut self, iter: I)where - I: IntoIterator<Item = &'a T>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, const N: usize> Extend<T> for HistoryBuffer<T, N>

source§

fn extend<I>(&mut self, iter: I)where - I: IntoIterator<Item = T>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more

Auto Trait Implementations§

§

impl<T, const N: usize> RefUnwindSafe for HistoryBuffer<T, N>where - T: RefUnwindSafe,

§

impl<T, const N: usize> Send for HistoryBuffer<T, N>where - T: Send,

§

impl<T, const N: usize> Sync for HistoryBuffer<T, N>where - T: Sync,

§

impl<T, const N: usize> Unpin for HistoryBuffer<T, N>where - T: Unpin,

§

impl<T, const N: usize> UnwindSafe for HistoryBuffer<T, N>where - T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/struct.IndexMap.html b/docs/doc/heapless/struct.IndexMap.html deleted file mode 100644 index bc68212..0000000 --- a/docs/doc/heapless/struct.IndexMap.html +++ /dev/null @@ -1,306 +0,0 @@ -IndexMap in heapless - Rust

Struct heapless::IndexMap

source ·
pub struct IndexMap<K, V, S, const N: usize> { /* private fields */ }
Expand description

Fixed capacity IndexMap

-

Note that you cannot use IndexMap directly, since it is generic around the hashing algorithm -in use. Pick a concrete instantiation like FnvIndexMap instead -or create your own.

-

Note that the capacity of the IndexMap must be a power of 2.

-

Examples

-

Since IndexMap cannot be used directly, we’re using its FnvIndexMap instantiation -for this example.

- -
use heapless::FnvIndexMap;
-
-// A hash map with a capacity of 16 key-value pairs allocated on the stack
-let mut book_reviews = FnvIndexMap::<_, _, 16>::new();
-
-// review some books.
-book_reviews.insert("Adventures of Huckleberry Finn",    "My favorite book.").unwrap();
-book_reviews.insert("Grimms' Fairy Tales",               "Masterpiece.").unwrap();
-book_reviews.insert("Pride and Prejudice",               "Very enjoyable.").unwrap();
-book_reviews.insert("The Adventures of Sherlock Holmes", "Eye lyked it alot.").unwrap();
-
-// check for a specific one.
-if !book_reviews.contains_key("Les Misérables") {
-    println!("We've got {} reviews, but Les Misérables ain't one.",
-             book_reviews.len());
-}
-
-// oops, this review has a lot of spelling mistakes, let's delete it.
-book_reviews.remove("The Adventures of Sherlock Holmes");
-
-// look up the values associated with some keys.
-let to_find = ["Pride and Prejudice", "Alice's Adventure in Wonderland"];
-for book in &to_find {
-    match book_reviews.get(book) {
-        Some(review) => println!("{}: {}", book, review),
-        None => println!("{} is unreviewed.", book)
-    }
-}
-
-// iterate over everything.
-for (book, review) in &book_reviews {
-    println!("{}: \"{}\"", book, review);
-}
-

Implementations§

source§

impl<K, V, S, const N: usize> IndexMap<K, V, BuildHasherDefault<S>, N>

source

pub const fn new() -> Self

Creates an empty IndexMap.

-
source§

impl<K, V, S, const N: usize> IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher,

source

pub fn capacity(&self) -> usize

Returns the number of elements the map can hold

-
source

pub fn keys(&self) -> impl Iterator<Item = &K>

Return an iterator over the keys of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for key in map.keys() {
-    println!("{}", key);
-}
-
source

pub fn values(&self) -> impl Iterator<Item = &V>

Return an iterator over the values of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for val in map.values() {
-    println!("{}", val);
-}
-
source

pub fn values_mut(&mut self) -> impl Iterator<Item = &mut V>

Return an iterator over mutable references to the the values of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for val in map.values_mut() {
-    *val += 10;
-}
-
-for val in map.values() {
-    println!("{}", val);
-}
-
source

pub fn iter(&self) -> Iter<'_, K, V>

Return an iterator over the key-value pairs of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for (key, val) in map.iter() {
-    println!("key: {} val: {}", key, val);
-}
-
source

pub fn iter_mut(&mut self) -> IterMut<'_, K, V>

Return an iterator over the key-value pairs of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for (_, val) in map.iter_mut() {
-    *val = 2;
-}
-
-for (key, val) in &map {
-    println!("key: {} val: {}", key, val);
-}
-
source

pub fn first(&self) -> Option<(&K, &V)>

Get the first key-value pair

-

Computes in O(1) time

-
source

pub fn first_mut(&mut self) -> Option<(&K, &mut V)>

Get the first key-value pair, with mutable access to the value

-

Computes in O(1) time

-
source

pub fn last(&self) -> Option<(&K, &V)>

Get the last key-value pair

-

Computes in O(1) time

-
source

pub fn last_mut(&mut self) -> Option<(&K, &mut V)>

Get the last key-value pair, with mutable access to the value

-

Computes in O(1) time

-
source

pub fn entry(&mut self, key: K) -> Entry<'_, K, V, N>

Returns an entry for the corresponding key

- -
use heapless::FnvIndexMap;
-use heapless::Entry;
-let mut map = FnvIndexMap::<_, _, 16>::new();
-if let Entry::Vacant(v) = map.entry("a") {
-    v.insert(1).unwrap();
-}
-if let Entry::Occupied(mut o) = map.entry("a") {
-    println!("found {}", *o.get()); // Prints 1
-    o.insert(2);
-}
-// Prints 2
-println!("val: {}", *map.get("a").unwrap());
-
source

pub fn len(&self) -> usize

Return the number of key-value pairs in the map.

-

Computes in O(1) time.

- -
use heapless::FnvIndexMap;
-
-let mut a = FnvIndexMap::<_, _, 16>::new();
-assert_eq!(a.len(), 0);
-a.insert(1, "a").unwrap();
-assert_eq!(a.len(), 1);
-
source

pub fn is_empty(&self) -> bool

Returns true if the map contains no elements.

-

Computes in O(1) time.

- -
use heapless::FnvIndexMap;
-
-let mut a = FnvIndexMap::<_, _, 16>::new();
-assert!(a.is_empty());
-a.insert(1, "a");
-assert!(!a.is_empty());
-
source

pub fn clear(&mut self)

Remove all key-value pairs in the map, while preserving its capacity.

-

Computes in O(n) time.

- -
use heapless::FnvIndexMap;
-
-let mut a = FnvIndexMap::<_, _, 16>::new();
-a.insert(1, "a");
-a.clear();
-assert!(a.is_empty());
-
source

pub fn get<Q>(&self, key: &Q) -> Option<&V>where - K: Borrow<Q>, - Q: ?Sized + Hash + Eq,

Returns a reference to the value corresponding to the key.

-

The key may be any borrowed form of the map’s key type, but Hash and Eq on the borrowed -form must match those for the key type.

-

Computes in O(1) time (average).

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.get(&1), Some(&"a"));
-assert_eq!(map.get(&2), None);
-
source

pub fn contains_key<Q>(&self, key: &Q) -> boolwhere - K: Borrow<Q>, - Q: ?Sized + Eq + Hash,

Returns true if the map contains a value for the specified key.

-

The key may be any borrowed form of the map’s key type, but Hash and Eq on the borrowed -form must match those for the key type.

-

Computes in O(1) time (average).

-
Examples
-
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 8>::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.contains_key(&1), true);
-assert_eq!(map.contains_key(&2), false);
-
source

pub fn get_mut<'v, Q>(&'v mut self, key: &Q) -> Option<&'v mut V>where - K: Borrow<Q>, - Q: ?Sized + Hash + Eq,

Returns a mutable reference to the value corresponding to the key.

-

The key may be any borrowed form of the map’s key type, but Hash and Eq on the borrowed -form must match those for the key type.

-

Computes in O(1) time (average).

-
Examples
-
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 8>::new();
-map.insert(1, "a").unwrap();
-if let Some(x) = map.get_mut(&1) {
-    *x = "b";
-}
-assert_eq!(map[&1], "b");
-
source

pub fn insert(&mut self, key: K, value: V) -> Result<Option<V>, (K, V)>

Inserts a key-value pair into the map.

-

If an equivalent key already exists in the map: the key remains and retains in its place in -the order, its corresponding value is updated with value and the older value is returned -inside Some(_).

-

If no equivalent key existed in the map: the new key-value pair is inserted, last in order, -and None is returned.

-

Computes in O(1) time (average).

-

See also entry if you you want to insert or modify or if you need to get the index of the -corresponding key-value pair.

-
Examples
-
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 8>::new();
-assert_eq!(map.insert(37, "a"), Ok(None));
-assert_eq!(map.is_empty(), false);
-
-map.insert(37, "b");
-assert_eq!(map.insert(37, "c"), Ok(Some("b")));
-assert_eq!(map[&37], "c");
-
source

pub fn remove<Q>(&mut self, key: &Q) -> Option<V>where - K: Borrow<Q>, - Q: ?Sized + Hash + Eq,

Same as swap_remove

-

Computes in O(1) time (average).

-
Examples
-
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 8>::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.remove(&1), Some("a"));
-assert_eq!(map.remove(&1), None);
-
source

pub fn swap_remove<Q>(&mut self, key: &Q) -> Option<V>where - K: Borrow<Q>, - Q: ?Sized + Hash + Eq,

Remove the key-value pair equivalent to key and return its value.

-

Like Vec::swap_remove, the pair is removed by swapping it with the last element of the map -and popping it off. This perturbs the postion of what used to be the last element!

-

Return None if key is not in map.

-

Computes in O(1) time (average).

-

Trait Implementations§

source§

impl<K, V, S, const N: usize> Clone for IndexMap<K, V, S, N>where - K: Eq + Hash + Clone, - V: Clone, - S: Clone,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<K, V, S, const N: usize> Debug for IndexMap<K, V, S, N>where - K: Eq + Hash + Debug, - V: Debug, - S: BuildHasher,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<K, V, S, const N: usize> Default for IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher + Default,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'a, K, V, S, const N: usize> Extend<(&'a K, &'a V)> for IndexMap<K, V, S, N>where - K: Eq + Hash + Copy, - V: Copy, - S: BuildHasher,

source§

fn extend<I>(&mut self, iterable: I)where - I: IntoIterator<Item = (&'a K, &'a V)>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<K, V, S, const N: usize> Extend<(K, V)> for IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher,

source§

fn extend<I>(&mut self, iterable: I)where - I: IntoIterator<Item = (K, V)>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<K, V, S, const N: usize> FromIterator<(K, V)> for IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher + Default,

source§

fn from_iter<I>(iterable: I) -> Selfwhere - I: IntoIterator<Item = (K, V)>,

Creates a value from an iterator. Read more
source§

impl<'a, K, Q, V, S, const N: usize> Index<&'a Q> for IndexMap<K, V, S, N>where - K: Eq + Hash + Borrow<Q>, - Q: ?Sized + Eq + Hash, - S: BuildHasher,

§

type Output = V

The returned type after indexing.
source§

fn index(&self, key: &Q) -> &V

Performs the indexing (container[index]) operation. Read more
source§

impl<'a, K, Q, V, S, const N: usize> IndexMut<&'a Q> for IndexMap<K, V, S, N>where - K: Eq + Hash + Borrow<Q>, - Q: ?Sized + Eq + Hash, - S: BuildHasher,

source§

fn index_mut(&mut self, key: &Q) -> &mut V

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<'a, K, V, S, const N: usize> IntoIterator for &'a IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher,

§

type Item = (&'a K, &'a V)

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, K, V>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, K, V, S, const N: usize> IntoIterator for &'a mut IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher,

§

type Item = (&'a K, &'a mut V)

The type of the elements being iterated over.
§

type IntoIter = IterMut<'a, K, V>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<K, V, S, const N: usize> IntoIterator for IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher,

§

type Item = (K, V)

The type of the elements being iterated over.
§

type IntoIter = IntoIter<K, V, N>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<K, V, S, S2, const N: usize, const N2: usize> PartialEq<IndexMap<K, V, S2, N2>> for IndexMap<K, V, S, N>where - K: Eq + Hash, - V: Eq, - S: BuildHasher, - S2: BuildHasher,

source§

fn eq(&self, other: &IndexMap<K, V, S2, N2>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<K, V, S, const N: usize> Eq for IndexMap<K, V, S, N>where - K: Eq + Hash, - V: Eq, - S: BuildHasher,

Auto Trait Implementations§

§

impl<K, V, S, const N: usize> RefUnwindSafe for IndexMap<K, V, S, N>where - K: RefUnwindSafe, - S: RefUnwindSafe, - V: RefUnwindSafe,

§

impl<K, V, S, const N: usize> Send for IndexMap<K, V, S, N>where - K: Send, - S: Send, - V: Send,

§

impl<K, V, S, const N: usize> Sync for IndexMap<K, V, S, N>where - K: Sync, - S: Sync, - V: Sync,

§

impl<K, V, S, const N: usize> Unpin for IndexMap<K, V, S, N>where - K: Unpin, - S: Unpin, - V: Unpin,

§

impl<K, V, S, const N: usize> UnwindSafe for IndexMap<K, V, S, N>where - K: UnwindSafe, - S: UnwindSafe, - V: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/struct.IndexSet.html b/docs/doc/heapless/struct.IndexSet.html deleted file mode 100644 index a30a671..0000000 --- a/docs/doc/heapless/struct.IndexSet.html +++ /dev/null @@ -1,296 +0,0 @@ -IndexSet in heapless - Rust

Struct heapless::IndexSet

source ·
pub struct IndexSet<T, S, const N: usize> { /* private fields */ }
Expand description

Fixed capacity IndexSet.

-

Note that you cannot use IndexSet directly, since it is generic around the hashing algorithm -in use. Pick a concrete instantiation like FnvIndexSet instead -or create your own.

-

Note that the capacity of the IndexSet must be a power of 2.

-

Examples

-

Since IndexSet cannot be used directly, we’re using its FnvIndexSet instantiation -for this example.

- -
use heapless::FnvIndexSet;
-
-// A hash set with a capacity of 16 elements allocated on the stack
-let mut books = FnvIndexSet::<_, 16>::new();
-
-// Add some books.
-books.insert("A Dance With Dragons").unwrap();
-books.insert("To Kill a Mockingbird").unwrap();
-books.insert("The Odyssey").unwrap();
-books.insert("The Great Gatsby").unwrap();
-
-// Check for a specific one.
-if !books.contains("The Winds of Winter") {
-    println!("We have {} books, but The Winds of Winter ain't one.",
-             books.len());
-}
-
-// Remove a book.
-books.remove("The Odyssey");
-
-// Iterate over everything.
-for book in &books {
-    println!("{}", book);
-}
-

Implementations§

source§

impl<T, S, const N: usize> IndexSet<T, BuildHasherDefault<S>, N>

source

pub const fn new() -> Self

Creates an empty IndexSet

-
source§

impl<T, S, const N: usize> IndexSet<T, S, N>where - T: Eq + Hash, - S: BuildHasher,

source

pub fn capacity(&self) -> usize

Returns the number of elements the set can hold

-
Examples
-
use heapless::FnvIndexSet;
-
-let set = FnvIndexSet::<i32, 16>::new();
-assert_eq!(set.capacity(), 16);
-
source

pub fn iter(&self) -> Iter<'_, T>

Return an iterator over the values of the set, in their order

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut set = FnvIndexSet::<_, 16>::new();
-set.insert("a").unwrap();
-set.insert("b").unwrap();
-
-// Will print in an arbitrary order.
-for x in set.iter() {
-    println!("{}", x);
-}
-
source

pub fn first(&self) -> Option<&T>

Get the first value

-

Computes in O(1) time

-
source

pub fn last(&self) -> Option<&T>

Get the last value

-

Computes in O(1) time

-
source

pub fn difference<'a, S2, const N2: usize>( - &'a self, - other: &'a IndexSet<T, S2, N2> -) -> Difference<'a, T, S2, N2>where - S2: BuildHasher,

Visits the values representing the difference, i.e. the values that are in self but not in -other.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-
-// Can be seen as `a - b`.
-for x in a.difference(&b) {
-    println!("{}", x); // Print 1
-}
-
-let diff: FnvIndexSet<_, 16> = a.difference(&b).collect();
-assert_eq!(diff, [1].iter().collect::<FnvIndexSet<_, 16>>());
-
-// Note that difference is not symmetric,
-// and `b - a` means something else:
-let diff: FnvIndexSet<_, 16> = b.difference(&a).collect();
-assert_eq!(diff, [4].iter().collect::<FnvIndexSet<_, 16>>());
-
source

pub fn symmetric_difference<'a, S2, const N2: usize>( - &'a self, - other: &'a IndexSet<T, S2, N2> -) -> impl Iterator<Item = &'a T>where - S2: BuildHasher,

Visits the values representing the symmetric difference, i.e. the values that are in self -or in other but not in both.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-
-// Print 1, 4 in that order order.
-for x in a.symmetric_difference(&b) {
-    println!("{}", x);
-}
-
-let diff1: FnvIndexSet<_, 16> = a.symmetric_difference(&b).collect();
-let diff2: FnvIndexSet<_, 16> = b.symmetric_difference(&a).collect();
-
-assert_eq!(diff1, diff2);
-assert_eq!(diff1, [1, 4].iter().collect::<FnvIndexSet<_, 16>>());
-
source

pub fn intersection<'a, S2, const N2: usize>( - &'a self, - other: &'a IndexSet<T, S2, N2> -) -> Intersection<'a, T, S2, N2>where - S2: BuildHasher,

Visits the values representing the intersection, i.e. the values that are both in self and -other.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-
-// Print 2, 3 in that order.
-for x in a.intersection(&b) {
-    println!("{}", x);
-}
-
-let intersection: FnvIndexSet<_, 16> = a.intersection(&b).collect();
-assert_eq!(intersection, [2, 3].iter().collect::<FnvIndexSet<_, 16>>());
-
source

pub fn union<'a, S2, const N2: usize>( - &'a self, - other: &'a IndexSet<T, S2, N2> -) -> impl Iterator<Item = &'a T>where - S2: BuildHasher,

Visits the values representing the union, i.e. all the values in self or other, without -duplicates.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-
-// Print 1, 2, 3, 4 in that order.
-for x in a.union(&b) {
-    println!("{}", x);
-}
-
-let union: FnvIndexSet<_, 16> = a.union(&b).collect();
-assert_eq!(union, [1, 2, 3, 4].iter().collect::<FnvIndexSet<_, 16>>());
-
source

pub fn len(&self) -> usize

Returns the number of elements in the set.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut v: FnvIndexSet<_, 16> = FnvIndexSet::new();
-assert_eq!(v.len(), 0);
-v.insert(1).unwrap();
-assert_eq!(v.len(), 1);
-
source

pub fn is_empty(&self) -> bool

Returns true if the set contains no elements.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut v: FnvIndexSet<_, 16> = FnvIndexSet::new();
-assert!(v.is_empty());
-v.insert(1).unwrap();
-assert!(!v.is_empty());
-
source

pub fn clear(&mut self)

Clears the set, removing all values.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut v: FnvIndexSet<_, 16> = FnvIndexSet::new();
-v.insert(1).unwrap();
-v.clear();
-assert!(v.is_empty());
-
source

pub fn contains<Q>(&self, value: &Q) -> boolwhere - T: Borrow<Q>, - Q: ?Sized + Eq + Hash,

Returns true if the set contains a value.

-

The value may be any borrowed form of the set’s value type, but Hash and Eq on the -borrowed form must match those for the value type.

-
Examples
-
use heapless::FnvIndexSet;
-
-let set: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-assert_eq!(set.contains(&1), true);
-assert_eq!(set.contains(&4), false);
-
source

pub fn is_disjoint<S2, const N2: usize>( - &self, - other: &IndexSet<T, S2, N2> -) -> boolwhere - S2: BuildHasher,

Returns true if self has no elements in common with other. This is equivalent to -checking for an empty intersection.

-
Examples
-
use heapless::FnvIndexSet;
-
-let a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b = FnvIndexSet::<_, 16>::new();
-
-assert_eq!(a.is_disjoint(&b), true);
-b.insert(4).unwrap();
-assert_eq!(a.is_disjoint(&b), true);
-b.insert(1).unwrap();
-assert_eq!(a.is_disjoint(&b), false);
-
source

pub fn is_subset<S2, const N2: usize>( - &self, - other: &IndexSet<T, S2, N2> -) -> boolwhere - S2: BuildHasher,

Returns true if the set is a subset of another, i.e. other contains at least all the -values in self.

-
Examples
-
use heapless::FnvIndexSet;
-
-let sup: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut set = FnvIndexSet::<_, 16>::new();
-
-assert_eq!(set.is_subset(&sup), true);
-set.insert(2).unwrap();
-assert_eq!(set.is_subset(&sup), true);
-set.insert(4).unwrap();
-assert_eq!(set.is_subset(&sup), false);
-
source

pub fn is_superset<S2, const N2: usize>( - &self, - other: &IndexSet<T, S2, N2> -) -> boolwhere - S2: BuildHasher,

Examples
-
use heapless::FnvIndexSet;
-
-let sub: FnvIndexSet<_, 16> = [1, 2].iter().cloned().collect();
-let mut set = FnvIndexSet::<_, 16>::new();
-
-assert_eq!(set.is_superset(&sub), false);
-
-set.insert(0).unwrap();
-set.insert(1).unwrap();
-assert_eq!(set.is_superset(&sub), false);
-
-set.insert(2).unwrap();
-assert_eq!(set.is_superset(&sub), true);
-
source

pub fn insert(&mut self, value: T) -> Result<bool, T>

Adds a value to the set.

-

If the set did not have this value present, true is returned.

-

If the set did have this value present, false is returned.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut set = FnvIndexSet::<_, 16>::new();
-
-assert_eq!(set.insert(2).unwrap(), true);
-assert_eq!(set.insert(2).unwrap(), false);
-assert_eq!(set.len(), 1);
-
source

pub fn remove<Q>(&mut self, value: &Q) -> boolwhere - T: Borrow<Q>, - Q: ?Sized + Eq + Hash,

Removes a value from the set. Returns true if the value was present in the set.

-

The value may be any borrowed form of the set’s value type, but Hash and Eq on the -borrowed form must match those for the value type.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut set = FnvIndexSet::<_, 16>::new();
-
-set.insert(2).unwrap();
-assert_eq!(set.remove(&2), true);
-assert_eq!(set.remove(&2), false);
-

Trait Implementations§

source§

impl<T, S, const N: usize> Clone for IndexSet<T, S, N>where - T: Eq + Hash + Clone, - S: Clone,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, S, const N: usize> Debug for IndexSet<T, S, N>where - T: Eq + Hash + Debug, - S: BuildHasher,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, S, const N: usize> Default for IndexSet<T, S, N>where - T: Eq + Hash, - S: BuildHasher + Default,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'a, T, S, const N: usize> Extend<&'a T> for IndexSet<T, S, N>where - T: 'a + Eq + Hash + Copy, - S: BuildHasher,

source§

fn extend<I>(&mut self, iterable: I)where - I: IntoIterator<Item = &'a T>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, S, const N: usize> Extend<T> for IndexSet<T, S, N>where - T: Eq + Hash, - S: BuildHasher,

source§

fn extend<I>(&mut self, iterable: I)where - I: IntoIterator<Item = T>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, S, const N: usize> FromIterator<T> for IndexSet<T, S, N>where - T: Eq + Hash, - S: BuildHasher + Default,

source§

fn from_iter<I>(iter: I) -> Selfwhere - I: IntoIterator<Item = T>,

Creates a value from an iterator. Read more
source§

impl<'a, T, S, const N: usize> IntoIterator for &'a IndexSet<T, S, N>where - T: Eq + Hash, - S: BuildHasher,

§

type Item = &'a T

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, S1, S2, const N1: usize, const N2: usize> PartialEq<IndexSet<T, S2, N2>> for IndexSet<T, S1, N1>where - T: Eq + Hash, - S1: BuildHasher, - S2: BuildHasher,

source§

fn eq(&self, other: &IndexSet<T, S2, N2>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

§

impl<T, S, const N: usize> RefUnwindSafe for IndexSet<T, S, N>where - S: RefUnwindSafe, - T: RefUnwindSafe,

§

impl<T, S, const N: usize> Send for IndexSet<T, S, N>where - S: Send, - T: Send,

§

impl<T, S, const N: usize> Sync for IndexSet<T, S, N>where - S: Sync, - T: Sync,

§

impl<T, S, const N: usize> Unpin for IndexSet<T, S, N>where - S: Unpin, - T: Unpin,

§

impl<T, S, const N: usize> UnwindSafe for IndexSet<T, S, N>where - S: UnwindSafe, - T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/struct.LinearMap.html b/docs/doc/heapless/struct.LinearMap.html deleted file mode 100644 index 21f795e..0000000 --- a/docs/doc/heapless/struct.LinearMap.html +++ /dev/null @@ -1,214 +0,0 @@ -LinearMap in heapless - Rust

Struct heapless::LinearMap

source ·
pub struct LinearMap<K, V, const N: usize> { /* private fields */ }
Expand description

A fixed capacity map / dictionary that performs lookups via linear search

-

Note that as this map doesn’t use hashing so most operations are O(N) instead of O(1)

-

Implementations§

source§

impl<K, V, const N: usize> LinearMap<K, V, N>

source

pub const fn new() -> Self

Creates an empty LinearMap

-
Examples
-
use heapless::LinearMap;
-
-// allocate the map on the stack
-let mut map: LinearMap<&str, isize, 8> = LinearMap::new();
-
-// allocate the map in a static variable
-static mut MAP: LinearMap<&str, isize, 8> = LinearMap::new();
-
source§

impl<K, V, const N: usize> LinearMap<K, V, N>where - K: Eq,

source

pub fn capacity(&self) -> usize

Returns the number of elements that the map can hold

-

Computes in O(1) time

-
Examples
-
use heapless::LinearMap;
-
-let map: LinearMap<&str, isize, 8> = LinearMap::new();
-assert_eq!(map.capacity(), 8);
-
source

pub fn clear(&mut self)

Clears the map, removing all key-value pairs

-

Computes in O(1) time

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert(1, "a").unwrap();
-map.clear();
-assert!(map.is_empty());
-
source

pub fn contains_key(&self, key: &K) -> bool

Returns true if the map contains a value for the specified key.

-

Computes in O(N) time

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.contains_key(&1), true);
-assert_eq!(map.contains_key(&2), false);
-
source

pub fn get<Q>(&self, key: &Q) -> Option<&V>where - K: Borrow<Q>, - Q: Eq + ?Sized,

Returns a reference to the value corresponding to the key

-

Computes in O(N) time

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.get(&1), Some(&"a"));
-assert_eq!(map.get(&2), None);
-
source

pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>where - K: Borrow<Q>, - Q: Eq + ?Sized,

Returns a mutable reference to the value corresponding to the key

-

Computes in O(N) time

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert(1, "a").unwrap();
-if let Some(x) = map.get_mut(&1) {
-    *x = "b";
-}
-assert_eq!(map[&1], "b");
-
source

pub fn len(&self) -> usize

Returns the number of elements in this map

-

Computes in O(1) time

-
Examples
-
use heapless::LinearMap;
-
-let mut a: LinearMap<_, _, 8> = LinearMap::new();
-assert_eq!(a.len(), 0);
-a.insert(1, "a").unwrap();
-assert_eq!(a.len(), 1);
-
source

pub fn insert(&mut self, key: K, value: V) -> Result<Option<V>, (K, V)>

Inserts a key-value pair into the map.

-

If the map did not have this key present, None is returned.

-

If the map did have this key present, the value is updated, and the old value is returned.

-

Computes in O(N) time

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-assert_eq!(map.insert(37, "a").unwrap(), None);
-assert_eq!(map.is_empty(), false);
-
-map.insert(37, "b").unwrap();
-assert_eq!(map.insert(37, "c").unwrap(), Some("b"));
-assert_eq!(map[&37], "c");
-
source

pub fn is_empty(&self) -> bool

Returns true if the map contains no elements

-

Computes in O(1) time

-
Examples
-
use heapless::LinearMap;
-
-let mut a: LinearMap<_, _, 8> = LinearMap::new();
-assert!(a.is_empty());
-a.insert(1, "a").unwrap();
-assert!(!a.is_empty());
-
source

pub fn iter(&self) -> Iter<'_, K, V>

An iterator visiting all key-value pairs in arbitrary order.

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for (key, val) in map.iter() {
-    println!("key: {} val: {}", key, val);
-}
-
source

pub fn iter_mut(&mut self) -> IterMut<'_, K, V>

An iterator visiting all key-value pairs in arbitrary order, with mutable references to the -values

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-// Update all values
-for (_, val) in map.iter_mut() {
-    *val = 2;
-}
-
-for (key, val) in &map {
-    println!("key: {} val: {}", key, val);
-}
-
source

pub fn keys(&self) -> impl Iterator<Item = &K>

An iterator visiting all keys in arbitrary order

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for key in map.keys() {
-    println!("{}", key);
-}
-
source

pub fn remove<Q>(&mut self, key: &Q) -> Option<V>where - K: Borrow<Q>, - Q: Eq + ?Sized,

Removes a key from the map, returning the value at the key if the key was previously in the -map

-

Computes in O(N) time

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.remove(&1), Some("a"));
-assert_eq!(map.remove(&1), None);
-
source

pub fn values(&self) -> impl Iterator<Item = &V>

An iterator visiting all values in arbitrary order

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for val in map.values() {
-    println!("{}", val);
-}
-
source

pub fn values_mut(&mut self) -> impl Iterator<Item = &mut V>

An iterator visiting all values mutably in arbitrary order

-
Examples
-
use heapless::LinearMap;
-
-let mut map: LinearMap<_, _, 8> = LinearMap::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for val in map.values_mut() {
-    *val += 10;
-}
-
-for val in map.values() {
-    println!("{}", val);
-}
-

Trait Implementations§

source§

impl<K, V, const N: usize> Clone for LinearMap<K, V, N>where - K: Eq + Clone, - V: Clone,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<K, V, const N: usize> Debug for LinearMap<K, V, N>where - K: Eq + Debug, - V: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<K, V, const N: usize> Default for LinearMap<K, V, N>where - K: Eq,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<K, V, const N: usize> Drop for LinearMap<K, V, N>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<K, V, const N: usize> FromIterator<(K, V)> for LinearMap<K, V, N>where - K: Eq,

source§

fn from_iter<I>(iter: I) -> Selfwhere - I: IntoIterator<Item = (K, V)>,

Creates a value from an iterator. Read more
source§

impl<'a, K, V, Q, const N: usize> Index<&'a Q> for LinearMap<K, V, N>where - K: Borrow<Q> + Eq, - Q: Eq + ?Sized,

§

type Output = V

The returned type after indexing.
source§

fn index(&self, key: &Q) -> &V

Performs the indexing (container[index]) operation. Read more
source§

impl<'a, K, V, Q, const N: usize> IndexMut<&'a Q> for LinearMap<K, V, N>where - K: Borrow<Q> + Eq, - Q: Eq + ?Sized,

source§

fn index_mut(&mut self, key: &Q) -> &mut V

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<'a, K, V, const N: usize> IntoIterator for &'a LinearMap<K, V, N>where - K: Eq,

§

type Item = (&'a K, &'a V)

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, K, V>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<K, V, const N: usize, const N2: usize> PartialEq<LinearMap<K, V, N2>> for LinearMap<K, V, N>where - K: Eq, - V: PartialEq,

source§

fn eq(&self, other: &LinearMap<K, V, N2>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<K, V, const N: usize> Eq for LinearMap<K, V, N>where - K: Eq, - V: PartialEq,

Auto Trait Implementations§

§

impl<K, V, const N: usize> RefUnwindSafe for LinearMap<K, V, N>where - K: RefUnwindSafe, - V: RefUnwindSafe,

§

impl<K, V, const N: usize> Send for LinearMap<K, V, N>where - K: Send, - V: Send,

§

impl<K, V, const N: usize> Sync for LinearMap<K, V, N>where - K: Sync, - V: Sync,

§

impl<K, V, const N: usize> Unpin for LinearMap<K, V, N>where - K: Unpin, - V: Unpin,

§

impl<K, V, const N: usize> UnwindSafe for LinearMap<K, V, N>where - K: UnwindSafe, - V: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/struct.OccupiedEntry.html b/docs/doc/heapless/struct.OccupiedEntry.html deleted file mode 100644 index b3b6573..0000000 --- a/docs/doc/heapless/struct.OccupiedEntry.html +++ /dev/null @@ -1,27 +0,0 @@ -OccupiedEntry in heapless - Rust

Struct heapless::OccupiedEntry

source ·
pub struct OccupiedEntry<'a, K, V, const N: usize> { /* private fields */ }
Expand description

An occupied entry which can be manipulated

-

Implementations§

source§

impl<'a, K, V, const N: usize> OccupiedEntry<'a, K, V, N>where - K: Eq + Hash,

source

pub fn key(&self) -> &K

Gets a reference to the key that this entity corresponds to

-
source

pub fn remove_entry(self) -> (K, V)

Removes this entry from the map and yields its corresponding key and value

-
source

pub fn get(&self) -> &V

Gets a reference to the value associated with this entry

-
source

pub fn get_mut(&mut self) -> &mut V

Gets a mutable reference to the value associated with this entry

-
source

pub fn into_mut(self) -> &'a mut V

Consumes this entry and yields a reference to the underlying value

-
source

pub fn insert(self, value: V) -> V

Overwrites the underlying map’s value with this entry’s value

-
source

pub fn remove(self) -> V

Removes this entry from the map and yields its value

-

Auto Trait Implementations§

§

impl<'a, K, V, const N: usize> RefUnwindSafe for OccupiedEntry<'a, K, V, N>where - K: RefUnwindSafe, - V: RefUnwindSafe,

§

impl<'a, K, V, const N: usize> Send for OccupiedEntry<'a, K, V, N>where - K: Send, - V: Send,

§

impl<'a, K, V, const N: usize> Sync for OccupiedEntry<'a, K, V, N>where - K: Sync, - V: Sync,

§

impl<'a, K, V, const N: usize> Unpin for OccupiedEntry<'a, K, V, N>where - K: Unpin,

§

impl<'a, K, V, const N: usize> !UnwindSafe for OccupiedEntry<'a, K, V, N>

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/struct.OldestOrdered.html b/docs/doc/heapless/struct.OldestOrdered.html deleted file mode 100644 index f43d951..0000000 --- a/docs/doc/heapless/struct.OldestOrdered.html +++ /dev/null @@ -1,194 +0,0 @@ -OldestOrdered in heapless - Rust

Struct heapless::OldestOrdered

source ·
pub struct OldestOrdered<'a, T, const N: usize> { /* private fields */ }
Expand description

An iterator on the underlying buffer ordered from oldest data to newest

-

Trait Implementations§

source§

impl<'a, T: Clone, const N: usize> Clone for OldestOrdered<'a, T, N>

source§

fn clone(&self) -> OldestOrdered<'a, T, N>

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, T, const N: usize> Iterator for OldestOrdered<'a, T, N>

§

type Item = &'a T

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<&'a T>

Advances the iterator and returns the next value. Read more
§

fn next_chunk<const N: usize>( - &mut self -) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where - Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
1.0.0§

fn count(self) -> usizewhere - Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0§

fn last(self) -> Option<Self::Item>where - Self: Sized,

Consumes the iterator, returning the last element. Read more
§

fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0§

fn step_by(self, step: usize) -> StepBy<Self>where - Self: Sized,

Creates an iterator starting at the same point, but stepping by -the given amount at each iteration. Read more
1.0.0§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>where - Self: Sized, - U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where - Self: Sized, - U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>where - Self: Sized, - G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator -between adjacent items of the original iterator. Read more
1.0.0§

fn map<B, F>(self, f: F) -> Map<Self, F>where - Self: Sized, - F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each -element. Read more
1.21.0§

fn for_each<F>(self, f: F)where - Self: Sized, - F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0§

fn filter<P>(self, predicate: P) -> Filter<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element -should be yielded. Read more
1.0.0§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>where - Self: Sized, - F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0§

fn enumerate(self) -> Enumerate<Self>where - Self: Sized,

Creates an iterator which gives the current iteration count as well as -the next value. Read more
1.0.0§

fn peekable(self) -> Peekable<Self>where - Self: Sized,

Creates an iterator which can use the peek and peek_mut methods -to look at the next element of the iterator without consuming it. See -their documentation for more information. Read more
1.0.0§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>where - Self: Sized, - P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0§

fn skip(self, n: usize) -> Skip<Self>where - Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0§

fn take(self, n: usize) -> Take<Self>where - Self: Sized,

Creates an iterator that yields the first n elements, or fewer -if the underlying iterator ends sooner. Read more
1.0.0§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>where - Self: Sized, - F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but -unlike fold, produces a new iterator. Read more
1.0.0§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where - Self: Sized, - U: IntoIterator, - F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
§

fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>where - Self: Sized, - F: FnMut(&[Self::Item; N]) -> R,

🔬This is a nightly-only experimental API. (iter_map_windows)
Calls the given function f for each contiguous window of size N over -self and returns an iterator over the outputs of f. Like slice::windows(), -the windows during mapping overlap as well. Read more
1.0.0§

fn fuse(self) -> Fuse<Self>where - Self: Sized,

Creates an iterator which ends after the first [None]. Read more
1.0.0§

fn inspect<F>(self, f: F) -> Inspect<Self, F>where - Self: Sized, - F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0§

fn by_ref(&mut self) -> &mut Selfwhere - Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0§

fn collect<B>(self) -> Bwhere - B: FromIterator<Self::Item>, - Self: Sized,

Transforms an iterator into a collection. Read more
§

fn collect_into<E>(self, collection: &mut E) -> &mut Ewhere - E: Extend<Self::Item>, - Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0§

fn partition<B, F>(self, f: F) -> (B, B)where - Self: Sized, - B: Default + Extend<Self::Item>, - F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
§

fn is_partitioned<P>(self, predicate: P) -> boolwhere - Self: Sized, - P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate, -such that all those that return true precede all those that return false. Read more
1.27.0§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere - Self: Sized, - F: FnMut(B, Self::Item) -> R, - R: Try<Output = B>,

An iterator method that applies a function as long as it returns -successfully, producing a single, final value. Read more
1.27.0§

fn try_for_each<F, R>(&mut self, f: F) -> Rwhere - Self: Sized, - F: FnMut(Self::Item) -> R, - R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the -iterator, stopping at the first error and returning that error. Read more
1.0.0§

fn fold<B, F>(self, init: B, f: F) -> Bwhere - Self: Sized, - F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation, -returning the final result. Read more
1.51.0§

fn reduce<F>(self, f: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing -operation. Read more
§

fn try_reduce<F, R>( - &mut self, - f: F -) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryTypewhere - Self: Sized, - F: FnMut(Self::Item, Self::Item) -> R, - R: Try<Output = Self::Item>, - <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the -closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0§

fn all<F>(&mut self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0§

fn any<F>(&mut self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>where - Self: Sized, - P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0§

fn find_map<B, F>(&mut self, f: F) -> Option<B>where - Self: Sized, - F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns -the first non-none result. Read more
§

fn try_find<F, R>( - &mut self, - f: F -) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryTypewhere - Self: Sized, - F: FnMut(&Self::Item) -> R, - R: Try<Output = bool>, - <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns -the first true result or the first error. Read more
1.0.0§

fn position<P>(&mut self, predicate: P) -> Option<usize>where - Self: Sized, - P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.6.0§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>where - B: Ord, - Self: Sized, - F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the -specified function. Read more
1.15.0§

fn max_by<F>(self, compare: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the -specified comparison function. Read more
1.6.0§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>where - B: Ord, - Self: Sized, - F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the -specified function. Read more
1.15.0§

fn min_by<F>(self, compare: F) -> Option<Self::Item>where - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the -specified comparison function. Read more
1.0.0§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)where - FromA: Default + Extend<A>, - FromB: Default + Extend<B>, - Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0§

fn copied<'a, T>(self) -> Copied<Self>where - T: 'a + Copy, - Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0§

fn cloned<'a, T>(self) -> Cloned<Self>where - T: 'a + Clone, - Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where - Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0§

fn sum<S>(self) -> Swhere - Self: Sized, - S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0§

fn product<P>(self) -> Pwhere - Self: Sized, - P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Orderingwhere - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this [Iterator] with those -of another with respect to the specified comparison function. Read more
1.5.0§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>where - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Lexicographically compares the [PartialOrd] elements of -this [Iterator] with those of another. The comparison works like short-circuit -evaluation, returning a result without comparing the remaining elements. -As soon as an order can be determined, the evaluation stops and a result is returned. Read more
§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this [Iterator] with those -of another with respect to the specified comparison function. Read more
1.5.0§

fn eq<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialEq<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are equal to those of -another. Read more
§

fn eq_by<I, F>(self, other: I, eq: F) -> boolwhere - Self: Sized, - I: IntoIterator, - F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this [Iterator] are equal to those of -another with respect to the specified equality function. Read more
1.5.0§

fn ne<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialEq<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are not equal to those of -another. Read more
1.5.0§

fn lt<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are lexicographically -less than those of another. Read more
1.5.0§

fn le<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are lexicographically -less or equal to those of another. Read more
1.5.0§

fn gt<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are lexicographically -greater than those of another. Read more
1.5.0§

fn ge<I>(self, other: I) -> boolwhere - I: IntoIterator, - Self::Item: PartialOrd<<I as IntoIterator>::Item>, - Self: Sized,

Determines if the elements of this [Iterator] are lexicographically -greater than or equal to those of another. Read more
§

fn is_sorted_by<F>(self, compare: F) -> boolwhere - Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
§

fn is_sorted_by_key<F, K>(self, f: F) -> boolwhere - Self: Sized, - F: FnMut(Self::Item) -> K, - K: PartialOrd<K>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction -function. Read more

Auto Trait Implementations§

§

impl<'a, T, const N: usize> RefUnwindSafe for OldestOrdered<'a, T, N>where - T: RefUnwindSafe,

§

impl<'a, T, const N: usize> Send for OldestOrdered<'a, T, N>where - T: Sync,

§

impl<'a, T, const N: usize> Sync for OldestOrdered<'a, T, N>where - T: Sync,

§

impl<'a, T, const N: usize> Unpin for OldestOrdered<'a, T, N>

§

impl<'a, T, const N: usize> UnwindSafe for OldestOrdered<'a, T, N>where - T: RefUnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<I> IntoIterator for Iwhere - I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/struct.String.html b/docs/doc/heapless/struct.String.html deleted file mode 100644 index 5622f5c..0000000 --- a/docs/doc/heapless/struct.String.html +++ /dev/null @@ -1,1371 +0,0 @@ -String in heapless - Rust

Struct heapless::String

source ·
pub struct String<const N: usize> { /* private fields */ }
Expand description

A fixed capacity String

-

Implementations§

source§

impl<const N: usize> String<N>

source

pub const fn new() -> Self

Constructs a new, empty String with a fixed capacity of N bytes

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-// allocate the string on the stack
-let mut s: String<4> = String::new();
-
-// allocate the string in a static variable
-static mut S: String<4> = String::new();
-
source

pub fn into_bytes(self) -> Vec<u8, N>

Converts a String into a byte vector.

-

This consumes the String, so we do not need to copy its contents.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let s: String<4> = String::from("ab");
-let b = s.into_bytes();
-assert!(b.len() == 2);
-
-assert_eq!(&['a' as u8, 'b' as u8], &b[..]);
-
source

pub fn as_str(&self) -> &str

Extracts a string slice containing the entire string.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<4> = String::from("ab");
-assert!(s.as_str() == "ab");
-
-let _s = s.as_str();
-// s.push('c'); // <- cannot borrow `s` as mutable because it is also borrowed as immutable
-
source

pub fn as_mut_str(&mut self) -> &mut str

Converts a String into a mutable string slice.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<4> = String::from("ab");
-let s = s.as_mut_str();
-s.make_ascii_uppercase();
-
source

pub unsafe fn as_mut_vec(&mut self) -> &mut Vec<u8, N>

Returns a mutable reference to the contents of this String.

-
Safety
-

This function is unsafe because it does not check that the bytes passed -to it are valid UTF-8. If this constraint is violated, it may cause -memory unsafety issues with future users of the String, as the rest of -the library assumes that Strings are valid UTF-8.

-
Examples
-

Basic usage:

- -
let mut s = String::from("hello");
-
-unsafe {
-    let vec = s.as_mut_vec();
-    assert_eq!(&[104, 101, 108, 108, 111][..], &vec[..]);
-
-    vec.reverse();
-}
-assert_eq!(s, "olleh");
-
source

pub fn push_str(&mut self, string: &str) -> Result<(), ()>

Appends a given string slice onto the end of this String.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<8> = String::from("foo");
-
-assert!(s.push_str("bar").is_ok());
-
-assert_eq!("foobar", s);
-
-assert!(s.push_str("tender").is_err());
-
source

pub fn capacity(&self) -> usize

Returns the maximum number of elements the String can hold

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<4> = String::new();
-assert!(s.capacity() == 4);
-
source

pub fn push(&mut self, c: char) -> Result<(), ()>

Appends the given char to the end of this String.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<8> = String::from("abc");
-
-s.push('1').unwrap();
-s.push('2').unwrap();
-s.push('3').unwrap();
-
-assert!("abc123" == s.as_str());
-
-assert_eq!("abc123", s);
-
source

pub fn truncate(&mut self, new_len: usize)

Shortens this String to the specified length.

-

If new_len is greater than the string’s current length, this has no -effect.

-

Note that this method has no effect on the allocated capacity -of the string

-
Panics
-

Panics if new_len does not lie on a char boundary.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<8> = String::from("hello");
-
-s.truncate(2);
-
-assert_eq!("he", s);
-
source

pub fn pop(&mut self) -> Option<char>

Removes the last character from the string buffer and returns it.

-

Returns None if this String is empty.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<8> = String::from("foo");
-
-assert_eq!(s.pop(), Some('o'));
-assert_eq!(s.pop(), Some('o'));
-assert_eq!(s.pop(), Some('f'));
-
-assert_eq!(s.pop(), None);
-
source

pub fn clear(&mut self)

Truncates this String, removing all contents.

-

While this means the String will have a length of zero, it does not -touch its capacity.

-
Examples
-

Basic usage:

- -
use heapless::String;
-
-let mut s: String<8> = String::from("foo");
-
-s.clear();
-
-assert!(s.is_empty());
-assert_eq!(0, s.len());
-assert_eq!(8, s.capacity());
-

Methods from Deref<Target = str>§

1.0.0

pub fn len(&self) -> usize

Returns the length of self.

-

This length is in bytes, not chars or graphemes. In other words, -it might not be what a human considers the length of the string.

-
Examples
-
let len = "foo".len();
-assert_eq!(3, len);
-
-assert_eq!("ƒoo".len(), 4); // fancy f!
-assert_eq!("ƒoo".chars().count(), 3);
-
1.0.0

pub fn is_empty(&self) -> bool

Returns true if self has a length of zero bytes.

-
Examples
-
let s = "";
-assert!(s.is_empty());
-
-let s = "not empty";
-assert!(!s.is_empty());
-
1.9.0

pub fn is_char_boundary(&self, index: usize) -> bool

Checks that index-th byte is the first byte in a UTF-8 code point -sequence or the end of the string.

-

The start and end of the string (when index == self.len()) are -considered to be boundaries.

-

Returns false if index is greater than self.len().

-
Examples
-
let s = "Löwe 老虎 Léopard";
-assert!(s.is_char_boundary(0));
-// start of `老`
-assert!(s.is_char_boundary(6));
-assert!(s.is_char_boundary(s.len()));
-
-// second byte of `ö`
-assert!(!s.is_char_boundary(2));
-
-// third byte of `老`
-assert!(!s.is_char_boundary(8));
-

pub fn floor_char_boundary(&self, index: usize) -> usize

🔬This is a nightly-only experimental API. (round_char_boundary)

Finds the closest x not exceeding index where is_char_boundary(x) is true.

-

This method can help you truncate a string so that it’s still valid UTF-8, but doesn’t -exceed a given number of bytes. Note that this is done purely at the character level -and can still visually split graphemes, even though the underlying characters aren’t -split. For example, the emoji 🧑‍🔬 (scientist) could be split so that the string only -includes 🧑 (person) instead.

-
Examples
-
#![feature(round_char_boundary)]
-let s = "❤️🧡💛💚💙💜";
-assert_eq!(s.len(), 26);
-assert!(!s.is_char_boundary(13));
-
-let closest = s.floor_char_boundary(13);
-assert_eq!(closest, 10);
-assert_eq!(&s[..closest], "❤️🧡");
-

pub fn ceil_char_boundary(&self, index: usize) -> usize

🔬This is a nightly-only experimental API. (round_char_boundary)

Finds the closest x not below index where is_char_boundary(x) is true.

-

If index is greater than the length of the string, this returns the length of the string.

-

This method is the natural complement to floor_char_boundary. See that method -for more details.

-
Examples
-
#![feature(round_char_boundary)]
-let s = "❤️🧡💛💚💙💜";
-assert_eq!(s.len(), 26);
-assert!(!s.is_char_boundary(13));
-
-let closest = s.ceil_char_boundary(13);
-assert_eq!(closest, 14);
-assert_eq!(&s[..closest], "❤️🧡💛");
-
1.0.0

pub fn as_bytes(&self) -> &[u8]

Converts a string slice to a byte slice. To convert the byte slice back -into a string slice, use the [from_utf8] function.

-
Examples
-
let bytes = "bors".as_bytes();
-assert_eq!(b"bors", bytes);
-
1.20.0

pub unsafe fn as_bytes_mut(&mut self) -> &mut [u8]

Converts a mutable string slice to a mutable byte slice.

-
Safety
-

The caller must ensure that the content of the slice is valid UTF-8 -before the borrow ends and the underlying str is used.

-

Use of a str whose contents are not valid UTF-8 is undefined behavior.

-
Examples
-

Basic usage:

- -
let mut s = String::from("Hello");
-let bytes = unsafe { s.as_bytes_mut() };
-
-assert_eq!(b"Hello", bytes);
-

Mutability:

- -
let mut s = String::from("🗻∈🌏");
-
-unsafe {
-    let bytes = s.as_bytes_mut();
-
-    bytes[0] = 0xF0;
-    bytes[1] = 0x9F;
-    bytes[2] = 0x8D;
-    bytes[3] = 0x94;
-}
-
-assert_eq!("🍔∈🌏", s);
-
1.0.0

pub fn as_ptr(&self) -> *const u8

Converts a string slice to a raw pointer.

-

As string slices are a slice of bytes, the raw pointer points to a -[u8]. This pointer will be pointing to the first byte of the string -slice.

-

The caller must ensure that the returned pointer is never written to. -If you need to mutate the contents of the string slice, use as_mut_ptr.

-
Examples
-
let s = "Hello";
-let ptr = s.as_ptr();
-
1.36.0

pub fn as_mut_ptr(&mut self) -> *mut u8

Converts a mutable string slice to a raw pointer.

-

As string slices are a slice of bytes, the raw pointer points to a -[u8]. This pointer will be pointing to the first byte of the string -slice.

-

It is your responsibility to make sure that the string slice only gets -modified in a way that it remains valid UTF-8.

-
1.20.0

pub fn get<I>(&self, i: I) -> Option<&<I as SliceIndex<str>>::Output>where - I: SliceIndex<str>,

Returns a subslice of str.

-

This is the non-panicking alternative to indexing the str. Returns -[None] whenever equivalent indexing operation would panic.

-
Examples
-
let v = String::from("🗻∈🌏");
-
-assert_eq!(Some("🗻"), v.get(0..4));
-
-// indices not on UTF-8 sequence boundaries
-assert!(v.get(1..).is_none());
-assert!(v.get(..8).is_none());
-
-// out of bounds
-assert!(v.get(..42).is_none());
-
1.20.0

pub fn get_mut<I>( - &mut self, - i: I -) -> Option<&mut <I as SliceIndex<str>>::Output>where - I: SliceIndex<str>,

Returns a mutable subslice of str.

-

This is the non-panicking alternative to indexing the str. Returns -[None] whenever equivalent indexing operation would panic.

-
Examples
-
let mut v = String::from("hello");
-// correct length
-assert!(v.get_mut(0..5).is_some());
-// out of bounds
-assert!(v.get_mut(..42).is_none());
-assert_eq!(Some("he"), v.get_mut(0..2).map(|v| &*v));
-
-assert_eq!("hello", v);
-{
-    let s = v.get_mut(0..2);
-    let s = s.map(|s| {
-        s.make_ascii_uppercase();
-        &*s
-    });
-    assert_eq!(Some("HE"), s);
-}
-assert_eq!("HEllo", v);
-
1.20.0

pub unsafe fn get_unchecked<I>(&self, i: I) -> &<I as SliceIndex<str>>::Outputwhere - I: SliceIndex<str>,

Returns an unchecked subslice of str.

-

This is the unchecked alternative to indexing the str.

-
Safety
-

Callers of this function are responsible that these preconditions are -satisfied:

-
    -
  • The starting index must not exceed the ending index;
  • -
  • Indexes must be within bounds of the original slice;
  • -
  • Indexes must lie on UTF-8 sequence boundaries.
  • -
-

Failing that, the returned string slice may reference invalid memory or -violate the invariants communicated by the str type.

-
Examples
-
let v = "🗻∈🌏";
-unsafe {
-    assert_eq!("🗻", v.get_unchecked(0..4));
-    assert_eq!("∈", v.get_unchecked(4..7));
-    assert_eq!("🌏", v.get_unchecked(7..11));
-}
-
1.20.0

pub unsafe fn get_unchecked_mut<I>( - &mut self, - i: I -) -> &mut <I as SliceIndex<str>>::Outputwhere - I: SliceIndex<str>,

Returns a mutable, unchecked subslice of str.

-

This is the unchecked alternative to indexing the str.

-
Safety
-

Callers of this function are responsible that these preconditions are -satisfied:

-
    -
  • The starting index must not exceed the ending index;
  • -
  • Indexes must be within bounds of the original slice;
  • -
  • Indexes must lie on UTF-8 sequence boundaries.
  • -
-

Failing that, the returned string slice may reference invalid memory or -violate the invariants communicated by the str type.

-
Examples
-
let mut v = String::from("🗻∈🌏");
-unsafe {
-    assert_eq!("🗻", v.get_unchecked_mut(0..4));
-    assert_eq!("∈", v.get_unchecked_mut(4..7));
-    assert_eq!("🌏", v.get_unchecked_mut(7..11));
-}
-
1.0.0

pub unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &str

👎Deprecated since 1.29.0: use get_unchecked(begin..end) instead

Creates a string slice from another string slice, bypassing safety -checks.

-

This is generally not recommended, use with caution! For a safe -alternative see [str] and Index.

-

This new slice goes from begin to end, including begin but -excluding end.

-

To get a mutable string slice instead, see the -slice_mut_unchecked method.

-
Safety
-

Callers of this function are responsible that three preconditions are -satisfied:

-
    -
  • begin must not exceed end.
  • -
  • begin and end must be byte positions within the string slice.
  • -
  • begin and end must lie on UTF-8 sequence boundaries.
  • -
-
Examples
-
let s = "Löwe 老虎 Léopard";
-
-unsafe {
-    assert_eq!("Löwe 老虎 Léopard", s.slice_unchecked(0, 21));
-}
-
-let s = "Hello, world!";
-
-unsafe {
-    assert_eq!("world", s.slice_unchecked(7, 12));
-}
-
1.5.0

pub unsafe fn slice_mut_unchecked( - &mut self, - begin: usize, - end: usize -) -> &mut str

👎Deprecated since 1.29.0: use get_unchecked_mut(begin..end) instead

Creates a string slice from another string slice, bypassing safety -checks. -This is generally not recommended, use with caution! For a safe -alternative see [str] and IndexMut.

-

This new slice goes from begin to end, including begin but -excluding end.

-

To get an immutable string slice instead, see the -slice_unchecked method.

-
Safety
-

Callers of this function are responsible that three preconditions are -satisfied:

-
    -
  • begin must not exceed end.
  • -
  • begin and end must be byte positions within the string slice.
  • -
  • begin and end must lie on UTF-8 sequence boundaries.
  • -
-
1.4.0

pub fn split_at(&self, mid: usize) -> (&str, &str)

Divide one string slice into two at an index.

-

The argument, mid, should be a byte offset from the start of the -string. It must also be on the boundary of a UTF-8 code point.

-

The two slices returned go from the start of the string slice to mid, -and from mid to the end of the string slice.

-

To get mutable string slices instead, see the split_at_mut -method.

-
Panics
-

Panics if mid is not on a UTF-8 code point boundary, or if it is -past the end of the last code point of the string slice.

-
Examples
-
let s = "Per Martin-Löf";
-
-let (first, last) = s.split_at(3);
-
-assert_eq!("Per", first);
-assert_eq!(" Martin-Löf", last);
-
1.4.0

pub fn split_at_mut(&mut self, mid: usize) -> (&mut str, &mut str)

Divide one mutable string slice into two at an index.

-

The argument, mid, should be a byte offset from the start of the -string. It must also be on the boundary of a UTF-8 code point.

-

The two slices returned go from the start of the string slice to mid, -and from mid to the end of the string slice.

-

To get immutable string slices instead, see the split_at method.

-
Panics
-

Panics if mid is not on a UTF-8 code point boundary, or if it is -past the end of the last code point of the string slice.

-
Examples
-
let mut s = "Per Martin-Löf".to_string();
-{
-    let (first, last) = s.split_at_mut(3);
-    first.make_ascii_uppercase();
-    assert_eq!("PER", first);
-    assert_eq!(" Martin-Löf", last);
-}
-assert_eq!("PER Martin-Löf", s);
-
1.0.0

pub fn chars(&self) -> Chars<'_>

Returns an iterator over the chars of a string slice.

-

As a string slice consists of valid UTF-8, we can iterate through a -string slice by char. This method returns such an iterator.

-

It’s important to remember that char represents a Unicode Scalar -Value, and might not match your idea of what a ‘character’ is. Iteration -over grapheme clusters may be what you actually want. This functionality -is not provided by Rust’s standard library, check crates.io instead.

-
Examples
-

Basic usage:

- -
let word = "goodbye";
-
-let count = word.chars().count();
-assert_eq!(7, count);
-
-let mut chars = word.chars();
-
-assert_eq!(Some('g'), chars.next());
-assert_eq!(Some('o'), chars.next());
-assert_eq!(Some('o'), chars.next());
-assert_eq!(Some('d'), chars.next());
-assert_eq!(Some('b'), chars.next());
-assert_eq!(Some('y'), chars.next());
-assert_eq!(Some('e'), chars.next());
-
-assert_eq!(None, chars.next());
-

Remember, chars might not match your intuition about characters:

- -
let y = "y̆";
-
-let mut chars = y.chars();
-
-assert_eq!(Some('y'), chars.next()); // not 'y̆'
-assert_eq!(Some('\u{0306}'), chars.next());
-
-assert_eq!(None, chars.next());
-
1.0.0

pub fn char_indices(&self) -> CharIndices<'_>

Returns an iterator over the chars of a string slice, and their -positions.

-

As a string slice consists of valid UTF-8, we can iterate through a -string slice by char. This method returns an iterator of both -these chars, as well as their byte positions.

-

The iterator yields tuples. The position is first, the char is -second.

-
Examples
-

Basic usage:

- -
let word = "goodbye";
-
-let count = word.char_indices().count();
-assert_eq!(7, count);
-
-let mut char_indices = word.char_indices();
-
-assert_eq!(Some((0, 'g')), char_indices.next());
-assert_eq!(Some((1, 'o')), char_indices.next());
-assert_eq!(Some((2, 'o')), char_indices.next());
-assert_eq!(Some((3, 'd')), char_indices.next());
-assert_eq!(Some((4, 'b')), char_indices.next());
-assert_eq!(Some((5, 'y')), char_indices.next());
-assert_eq!(Some((6, 'e')), char_indices.next());
-
-assert_eq!(None, char_indices.next());
-

Remember, chars might not match your intuition about characters:

- -
let yes = "y̆es";
-
-let mut char_indices = yes.char_indices();
-
-assert_eq!(Some((0, 'y')), char_indices.next()); // not (0, 'y̆')
-assert_eq!(Some((1, '\u{0306}')), char_indices.next());
-
-// note the 3 here - the last character took up two bytes
-assert_eq!(Some((3, 'e')), char_indices.next());
-assert_eq!(Some((4, 's')), char_indices.next());
-
-assert_eq!(None, char_indices.next());
-
1.0.0

pub fn bytes(&self) -> Bytes<'_>

An iterator over the bytes of a string slice.

-

As a string slice consists of a sequence of bytes, we can iterate -through a string slice by byte. This method returns such an iterator.

-
Examples
-
let mut bytes = "bors".bytes();
-
-assert_eq!(Some(b'b'), bytes.next());
-assert_eq!(Some(b'o'), bytes.next());
-assert_eq!(Some(b'r'), bytes.next());
-assert_eq!(Some(b's'), bytes.next());
-
-assert_eq!(None, bytes.next());
-
1.1.0

pub fn split_whitespace(&self) -> SplitWhitespace<'_>

Splits a string slice by whitespace.

-

The iterator returned will return string slices that are sub-slices of -the original string slice, separated by any amount of whitespace.

-

‘Whitespace’ is defined according to the terms of the Unicode Derived -Core Property White_Space. If you only want to split on ASCII whitespace -instead, use split_ascii_whitespace.

-
Examples
-

Basic usage:

- -
let mut iter = "A few words".split_whitespace();
-
-assert_eq!(Some("A"), iter.next());
-assert_eq!(Some("few"), iter.next());
-assert_eq!(Some("words"), iter.next());
-
-assert_eq!(None, iter.next());
-

All kinds of whitespace are considered:

- -
let mut iter = " Mary   had\ta\u{2009}little  \n\t lamb".split_whitespace();
-assert_eq!(Some("Mary"), iter.next());
-assert_eq!(Some("had"), iter.next());
-assert_eq!(Some("a"), iter.next());
-assert_eq!(Some("little"), iter.next());
-assert_eq!(Some("lamb"), iter.next());
-
-assert_eq!(None, iter.next());
-

If the string is empty or all whitespace, the iterator yields no string slices:

- -
assert_eq!("".split_whitespace().next(), None);
-assert_eq!("   ".split_whitespace().next(), None);
-
1.34.0

pub fn split_ascii_whitespace(&self) -> SplitAsciiWhitespace<'_>

Splits a string slice by ASCII whitespace.

-

The iterator returned will return string slices that are sub-slices of -the original string slice, separated by any amount of ASCII whitespace.

-

To split by Unicode Whitespace instead, use split_whitespace.

-
Examples
-

Basic usage:

- -
let mut iter = "A few words".split_ascii_whitespace();
-
-assert_eq!(Some("A"), iter.next());
-assert_eq!(Some("few"), iter.next());
-assert_eq!(Some("words"), iter.next());
-
-assert_eq!(None, iter.next());
-

All kinds of ASCII whitespace are considered:

- -
let mut iter = " Mary   had\ta little  \n\t lamb".split_ascii_whitespace();
-assert_eq!(Some("Mary"), iter.next());
-assert_eq!(Some("had"), iter.next());
-assert_eq!(Some("a"), iter.next());
-assert_eq!(Some("little"), iter.next());
-assert_eq!(Some("lamb"), iter.next());
-
-assert_eq!(None, iter.next());
-

If the string is empty or all ASCII whitespace, the iterator yields no string slices:

- -
assert_eq!("".split_ascii_whitespace().next(), None);
-assert_eq!("   ".split_ascii_whitespace().next(), None);
-
1.0.0

pub fn lines(&self) -> Lines<'_>

An iterator over the lines of a string, as string slices.

-

Lines are split at line endings that are either newlines (\n) or -sequences of a carriage return followed by a line feed (\r\n).

-

Line terminators are not included in the lines returned by the iterator.

-

Note that any carriage return (\r) not immediately followed by a -line feed (\n) does not split a line. These carriage returns are -thereby included in the produced lines.

-

The final line ending is optional. A string that ends with a final line -ending will return the same lines as an otherwise identical string -without a final line ending.

-
Examples
-

Basic usage:

- -
let text = "foo\r\nbar\n\nbaz\r";
-let mut lines = text.lines();
-
-assert_eq!(Some("foo"), lines.next());
-assert_eq!(Some("bar"), lines.next());
-assert_eq!(Some(""), lines.next());
-// Trailing carriage return is included in the last line
-assert_eq!(Some("baz\r"), lines.next());
-
-assert_eq!(None, lines.next());
-

The final line does not require any ending:

- -
let text = "foo\nbar\n\r\nbaz";
-let mut lines = text.lines();
-
-assert_eq!(Some("foo"), lines.next());
-assert_eq!(Some("bar"), lines.next());
-assert_eq!(Some(""), lines.next());
-assert_eq!(Some("baz"), lines.next());
-
-assert_eq!(None, lines.next());
-
1.0.0

pub fn lines_any(&self) -> LinesAny<'_>

👎Deprecated since 1.4.0: use lines() instead now

An iterator over the lines of a string.

-
1.8.0

pub fn encode_utf16(&self) -> EncodeUtf16<'_>

Returns an iterator of u16 over the string encoded as UTF-16.

-
Examples
-
let text = "Zażółć gęślą jaźń";
-
-let utf8_len = text.len();
-let utf16_len = text.encode_utf16().count();
-
-assert!(utf16_len <= utf8_len);
-
1.0.0

pub fn contains<'a, P>(&'a self, pat: P) -> boolwhere - P: Pattern<'a>,

Returns true if the given pattern matches a sub-slice of -this string slice.

-

Returns false if it does not.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-
let bananas = "bananas";
-
-assert!(bananas.contains("nana"));
-assert!(!bananas.contains("apples"));
-
1.0.0

pub fn starts_with<'a, P>(&'a self, pat: P) -> boolwhere - P: Pattern<'a>,

Returns true if the given pattern matches a prefix of this -string slice.

-

Returns false if it does not.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-
let bananas = "bananas";
-
-assert!(bananas.starts_with("bana"));
-assert!(!bananas.starts_with("nana"));
-
1.0.0

pub fn ends_with<'a, P>(&'a self, pat: P) -> boolwhere - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns true if the given pattern matches a suffix of this -string slice.

-

Returns false if it does not.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-
let bananas = "bananas";
-
-assert!(bananas.ends_with("anas"));
-assert!(!bananas.ends_with("nana"));
-
1.0.0

pub fn find<'a, P>(&'a self, pat: P) -> Option<usize>where - P: Pattern<'a>,

Returns the byte index of the first character of this string slice that -matches the pattern.

-

Returns [None] if the pattern doesn’t match.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-

Simple patterns:

- -
let s = "Löwe 老虎 Léopard Gepardi";
-
-assert_eq!(s.find('L'), Some(0));
-assert_eq!(s.find('é'), Some(14));
-assert_eq!(s.find("pard"), Some(17));
-

More complex patterns using point-free style and closures:

- -
let s = "Löwe 老虎 Léopard";
-
-assert_eq!(s.find(char::is_whitespace), Some(5));
-assert_eq!(s.find(char::is_lowercase), Some(1));
-assert_eq!(s.find(|c: char| c.is_whitespace() || c.is_lowercase()), Some(1));
-assert_eq!(s.find(|c: char| (c < 'o') && (c > 'a')), Some(4));
-

Not finding the pattern:

- -
let s = "Löwe 老虎 Léopard";
-let x: &[_] = &['1', '2'];
-
-assert_eq!(s.find(x), None);
-
1.0.0

pub fn rfind<'a, P>(&'a self, pat: P) -> Option<usize>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns the byte index for the first character of the last match of the pattern in -this string slice.

-

Returns [None] if the pattern doesn’t match.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-

Simple patterns:

- -
let s = "Löwe 老虎 Léopard Gepardi";
-
-assert_eq!(s.rfind('L'), Some(13));
-assert_eq!(s.rfind('é'), Some(14));
-assert_eq!(s.rfind("pard"), Some(24));
-

More complex patterns with closures:

- -
let s = "Löwe 老虎 Léopard";
-
-assert_eq!(s.rfind(char::is_whitespace), Some(12));
-assert_eq!(s.rfind(char::is_lowercase), Some(20));
-

Not finding the pattern:

- -
let s = "Löwe 老虎 Léopard";
-let x: &[_] = &['1', '2'];
-
-assert_eq!(s.rfind(x), None);
-
1.0.0

pub fn split<'a, P>(&'a self, pat: P) -> Split<'a, P>where - P: Pattern<'a>,

An iterator over substrings of this string slice, separated by -characters matched by a pattern.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator will be a [DoubleEndedIterator] if the pattern -allows a reverse search and forward/reverse search yields the same -elements. This is true for, e.g., char, but not for &str.

-

If the pattern allows a reverse search but its results might differ -from a forward search, the rsplit method can be used.

-
Examples
-

Simple patterns:

- -
let v: Vec<&str> = "Mary had a little lamb".split(' ').collect();
-assert_eq!(v, ["Mary", "had", "a", "little", "lamb"]);
-
-let v: Vec<&str> = "".split('X').collect();
-assert_eq!(v, [""]);
-
-let v: Vec<&str> = "lionXXtigerXleopard".split('X').collect();
-assert_eq!(v, ["lion", "", "tiger", "leopard"]);
-
-let v: Vec<&str> = "lion::tiger::leopard".split("::").collect();
-assert_eq!(v, ["lion", "tiger", "leopard"]);
-
-let v: Vec<&str> = "abc1def2ghi".split(char::is_numeric).collect();
-assert_eq!(v, ["abc", "def", "ghi"]);
-
-let v: Vec<&str> = "lionXtigerXleopard".split(char::is_uppercase).collect();
-assert_eq!(v, ["lion", "tiger", "leopard"]);
-

If the pattern is a slice of chars, split on each occurrence of any of the characters:

- -
let v: Vec<&str> = "2020-11-03 23:59".split(&['-', ' ', ':', '@'][..]).collect();
-assert_eq!(v, ["2020", "11", "03", "23", "59"]);
-

A more complex pattern, using a closure:

- -
let v: Vec<&str> = "abc1defXghi".split(|c| c == '1' || c == 'X').collect();
-assert_eq!(v, ["abc", "def", "ghi"]);
-

If a string contains multiple contiguous separators, you will end up -with empty strings in the output:

- -
let x = "||||a||b|c".to_string();
-let d: Vec<_> = x.split('|').collect();
-
-assert_eq!(d, &["", "", "", "", "a", "", "b", "c"]);
-

Contiguous separators are separated by the empty string.

- -
let x = "(///)".to_string();
-let d: Vec<_> = x.split('/').collect();
-
-assert_eq!(d, &["(", "", "", ")"]);
-

Separators at the start or end of a string are neighbored -by empty strings.

- -
let d: Vec<_> = "010".split("0").collect();
-assert_eq!(d, &["", "1", ""]);
-

When the empty string is used as a separator, it separates -every character in the string, along with the beginning -and end of the string.

- -
let f: Vec<_> = "rust".split("").collect();
-assert_eq!(f, &["", "r", "u", "s", "t", ""]);
-

Contiguous separators can lead to possibly surprising behavior -when whitespace is used as the separator. This code is correct:

- -
let x = "    a  b c".to_string();
-let d: Vec<_> = x.split(' ').collect();
-
-assert_eq!(d, &["", "", "", "", "a", "", "b", "c"]);
-

It does not give you:

- -
assert_eq!(d, &["a", "b", "c"]);
-

Use split_whitespace for this behavior.

-
1.51.0

pub fn split_inclusive<'a, P>(&'a self, pat: P) -> SplitInclusive<'a, P>where - P: Pattern<'a>,

An iterator over substrings of this string slice, separated by -characters matched by a pattern. Differs from the iterator produced by -split in that split_inclusive leaves the matched part as the -terminator of the substring.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-
let v: Vec<&str> = "Mary had a little lamb\nlittle lamb\nlittle lamb."
-    .split_inclusive('\n').collect();
-assert_eq!(v, ["Mary had a little lamb\n", "little lamb\n", "little lamb."]);
-

If the last element of the string is matched, -that element will be considered the terminator of the preceding substring. -That substring will be the last item returned by the iterator.

- -
let v: Vec<&str> = "Mary had a little lamb\nlittle lamb\nlittle lamb.\n"
-    .split_inclusive('\n').collect();
-assert_eq!(v, ["Mary had a little lamb\n", "little lamb\n", "little lamb.\n"]);
-
1.0.0

pub fn rsplit<'a, P>(&'a self, pat: P) -> RSplit<'a, P>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over substrings of the given string slice, separated by -characters matched by a pattern and yielded in reverse order.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator requires that the pattern supports a reverse -search, and it will be a [DoubleEndedIterator] if a forward/reverse -search yields the same elements.

-

For iterating from the front, the split method can be used.

-
Examples
-

Simple patterns:

- -
let v: Vec<&str> = "Mary had a little lamb".rsplit(' ').collect();
-assert_eq!(v, ["lamb", "little", "a", "had", "Mary"]);
-
-let v: Vec<&str> = "".rsplit('X').collect();
-assert_eq!(v, [""]);
-
-let v: Vec<&str> = "lionXXtigerXleopard".rsplit('X').collect();
-assert_eq!(v, ["leopard", "tiger", "", "lion"]);
-
-let v: Vec<&str> = "lion::tiger::leopard".rsplit("::").collect();
-assert_eq!(v, ["leopard", "tiger", "lion"]);
-

A more complex pattern, using a closure:

- -
let v: Vec<&str> = "abc1defXghi".rsplit(|c| c == '1' || c == 'X').collect();
-assert_eq!(v, ["ghi", "def", "abc"]);
-
1.0.0

pub fn split_terminator<'a, P>(&'a self, pat: P) -> SplitTerminator<'a, P>where - P: Pattern<'a>,

An iterator over substrings of the given string slice, separated by -characters matched by a pattern.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-

Equivalent to split, except that the trailing substring -is skipped if empty.

-

This method can be used for string data that is terminated, -rather than separated by a pattern.

-
Iterator behavior
-

The returned iterator will be a [DoubleEndedIterator] if the pattern -allows a reverse search and forward/reverse search yields the same -elements. This is true for, e.g., char, but not for &str.

-

If the pattern allows a reverse search but its results might differ -from a forward search, the rsplit_terminator method can be used.

-
Examples
-
let v: Vec<&str> = "A.B.".split_terminator('.').collect();
-assert_eq!(v, ["A", "B"]);
-
-let v: Vec<&str> = "A..B..".split_terminator(".").collect();
-assert_eq!(v, ["A", "", "B", ""]);
-
-let v: Vec<&str> = "A.B:C.D".split_terminator(&['.', ':'][..]).collect();
-assert_eq!(v, ["A", "B", "C", "D"]);
-
1.0.0

pub fn rsplit_terminator<'a, P>(&'a self, pat: P) -> RSplitTerminator<'a, P>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over substrings of self, separated by characters -matched by a pattern and yielded in reverse order.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-

Equivalent to split, except that the trailing substring is -skipped if empty.

-

This method can be used for string data that is terminated, -rather than separated by a pattern.

-
Iterator behavior
-

The returned iterator requires that the pattern supports a -reverse search, and it will be double ended if a forward/reverse -search yields the same elements.

-

For iterating from the front, the split_terminator method can be -used.

-
Examples
-
let v: Vec<&str> = "A.B.".rsplit_terminator('.').collect();
-assert_eq!(v, ["B", "A"]);
-
-let v: Vec<&str> = "A..B..".rsplit_terminator(".").collect();
-assert_eq!(v, ["", "B", "", "A"]);
-
-let v: Vec<&str> = "A.B:C.D".rsplit_terminator(&['.', ':'][..]).collect();
-assert_eq!(v, ["D", "C", "B", "A"]);
-
1.0.0

pub fn splitn<'a, P>(&'a self, n: usize, pat: P) -> SplitN<'a, P>where - P: Pattern<'a>,

An iterator over substrings of the given string slice, separated by a -pattern, restricted to returning at most n items.

-

If n substrings are returned, the last substring (the nth substring) -will contain the remainder of the string.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator will not be double ended, because it is -not efficient to support.

-

If the pattern allows a reverse search, the rsplitn method can be -used.

-
Examples
-

Simple patterns:

- -
let v: Vec<&str> = "Mary had a little lambda".splitn(3, ' ').collect();
-assert_eq!(v, ["Mary", "had", "a little lambda"]);
-
-let v: Vec<&str> = "lionXXtigerXleopard".splitn(3, "X").collect();
-assert_eq!(v, ["lion", "", "tigerXleopard"]);
-
-let v: Vec<&str> = "abcXdef".splitn(1, 'X').collect();
-assert_eq!(v, ["abcXdef"]);
-
-let v: Vec<&str> = "".splitn(1, 'X').collect();
-assert_eq!(v, [""]);
-

A more complex pattern, using a closure:

- -
let v: Vec<&str> = "abc1defXghi".splitn(2, |c| c == '1' || c == 'X').collect();
-assert_eq!(v, ["abc", "defXghi"]);
-
1.0.0

pub fn rsplitn<'a, P>(&'a self, n: usize, pat: P) -> RSplitN<'a, P>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over substrings of this string slice, separated by a -pattern, starting from the end of the string, restricted to returning -at most n items.

-

If n substrings are returned, the last substring (the nth substring) -will contain the remainder of the string.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator will not be double ended, because it is not -efficient to support.

-

For splitting from the front, the splitn method can be used.

-
Examples
-

Simple patterns:

- -
let v: Vec<&str> = "Mary had a little lamb".rsplitn(3, ' ').collect();
-assert_eq!(v, ["lamb", "little", "Mary had a"]);
-
-let v: Vec<&str> = "lionXXtigerXleopard".rsplitn(3, 'X').collect();
-assert_eq!(v, ["leopard", "tiger", "lionX"]);
-
-let v: Vec<&str> = "lion::tiger::leopard".rsplitn(2, "::").collect();
-assert_eq!(v, ["leopard", "lion::tiger"]);
-

A more complex pattern, using a closure:

- -
let v: Vec<&str> = "abc1defXghi".rsplitn(2, |c| c == '1' || c == 'X').collect();
-assert_eq!(v, ["ghi", "abc1def"]);
-
1.52.0

pub fn split_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)>where - P: Pattern<'a>,

Splits the string on the first occurrence of the specified delimiter and -returns prefix before delimiter and suffix after delimiter.

-
Examples
-
assert_eq!("cfg".split_once('='), None);
-assert_eq!("cfg=".split_once('='), Some(("cfg", "")));
-assert_eq!("cfg=foo".split_once('='), Some(("cfg", "foo")));
-assert_eq!("cfg=foo=bar".split_once('='), Some(("cfg", "foo=bar")));
-
1.52.0

pub fn rsplit_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Splits the string on the last occurrence of the specified delimiter and -returns prefix before delimiter and suffix after delimiter.

-
Examples
-
assert_eq!("cfg".rsplit_once('='), None);
-assert_eq!("cfg=foo".rsplit_once('='), Some(("cfg", "foo")));
-assert_eq!("cfg=foo=bar".rsplit_once('='), Some(("cfg=foo", "bar")));
-
1.2.0

pub fn matches<'a, P>(&'a self, pat: P) -> Matches<'a, P>where - P: Pattern<'a>,

An iterator over the disjoint matches of a pattern within the given string -slice.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator will be a [DoubleEndedIterator] if the pattern -allows a reverse search and forward/reverse search yields the same -elements. This is true for, e.g., char, but not for &str.

-

If the pattern allows a reverse search but its results might differ -from a forward search, the rmatches method can be used.

-
Examples
-
let v: Vec<&str> = "abcXXXabcYYYabc".matches("abc").collect();
-assert_eq!(v, ["abc", "abc", "abc"]);
-
-let v: Vec<&str> = "1abc2abc3".matches(char::is_numeric).collect();
-assert_eq!(v, ["1", "2", "3"]);
-
1.2.0

pub fn rmatches<'a, P>(&'a self, pat: P) -> RMatches<'a, P>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over the disjoint matches of a pattern within this string slice, -yielded in reverse order.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator requires that the pattern supports a reverse -search, and it will be a [DoubleEndedIterator] if a forward/reverse -search yields the same elements.

-

For iterating from the front, the matches method can be used.

-
Examples
-
let v: Vec<&str> = "abcXXXabcYYYabc".rmatches("abc").collect();
-assert_eq!(v, ["abc", "abc", "abc"]);
-
-let v: Vec<&str> = "1abc2abc3".rmatches(char::is_numeric).collect();
-assert_eq!(v, ["3", "2", "1"]);
-
1.5.0

pub fn match_indices<'a, P>(&'a self, pat: P) -> MatchIndices<'a, P>where - P: Pattern<'a>,

An iterator over the disjoint matches of a pattern within this string -slice as well as the index that the match starts at.

-

For matches of pat within self that overlap, only the indices -corresponding to the first match are returned.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator will be a [DoubleEndedIterator] if the pattern -allows a reverse search and forward/reverse search yields the same -elements. This is true for, e.g., char, but not for &str.

-

If the pattern allows a reverse search but its results might differ -from a forward search, the rmatch_indices method can be used.

-
Examples
-
let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect();
-assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]);
-
-let v: Vec<_> = "1abcabc2".match_indices("abc").collect();
-assert_eq!(v, [(1, "abc"), (4, "abc")]);
-
-let v: Vec<_> = "ababa".match_indices("aba").collect();
-assert_eq!(v, [(0, "aba")]); // only the first `aba`
-
1.5.0

pub fn rmatch_indices<'a, P>(&'a self, pat: P) -> RMatchIndices<'a, P>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

An iterator over the disjoint matches of a pattern within self, -yielded in reverse order along with the index of the match.

-

For matches of pat within self that overlap, only the indices -corresponding to the last match are returned.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Iterator behavior
-

The returned iterator requires that the pattern supports a reverse -search, and it will be a [DoubleEndedIterator] if a forward/reverse -search yields the same elements.

-

For iterating from the front, the match_indices method can be used.

-
Examples
-
let v: Vec<_> = "abcXXXabcYYYabc".rmatch_indices("abc").collect();
-assert_eq!(v, [(12, "abc"), (6, "abc"), (0, "abc")]);
-
-let v: Vec<_> = "1abcabc2".rmatch_indices("abc").collect();
-assert_eq!(v, [(4, "abc"), (1, "abc")]);
-
-let v: Vec<_> = "ababa".rmatch_indices("aba").collect();
-assert_eq!(v, [(2, "aba")]); // only the last `aba`
-
1.0.0

pub fn trim(&self) -> &str

Returns a string slice with leading and trailing whitespace removed.

-

‘Whitespace’ is defined according to the terms of the Unicode Derived -Core Property White_Space, which includes newlines.

-
Examples
-
let s = "\n Hello\tworld\t\n";
-
-assert_eq!("Hello\tworld", s.trim());
-
1.30.0

pub fn trim_start(&self) -> &str

Returns a string slice with leading whitespace removed.

-

‘Whitespace’ is defined according to the terms of the Unicode Derived -Core Property White_Space, which includes newlines.

-
Text directionality
-

A string is a sequence of bytes. start in this context means the first -position of that byte string; for a left-to-right language like English or -Russian, this will be left side, and for right-to-left languages like -Arabic or Hebrew, this will be the right side.

-
Examples
-

Basic usage:

- -
let s = "\n Hello\tworld\t\n";
-assert_eq!("Hello\tworld\t\n", s.trim_start());
-

Directionality:

- -
let s = "  English  ";
-assert!(Some('E') == s.trim_start().chars().next());
-
-let s = "  עברית  ";
-assert!(Some('ע') == s.trim_start().chars().next());
-
1.30.0

pub fn trim_end(&self) -> &str

Returns a string slice with trailing whitespace removed.

-

‘Whitespace’ is defined according to the terms of the Unicode Derived -Core Property White_Space, which includes newlines.

-
Text directionality
-

A string is a sequence of bytes. end in this context means the last -position of that byte string; for a left-to-right language like English or -Russian, this will be right side, and for right-to-left languages like -Arabic or Hebrew, this will be the left side.

-
Examples
-

Basic usage:

- -
let s = "\n Hello\tworld\t\n";
-assert_eq!("\n Hello\tworld", s.trim_end());
-

Directionality:

- -
let s = "  English  ";
-assert!(Some('h') == s.trim_end().chars().rev().next());
-
-let s = "  עברית  ";
-assert!(Some('ת') == s.trim_end().chars().rev().next());
-
1.0.0

pub fn trim_left(&self) -> &str

👎Deprecated since 1.33.0: superseded by trim_start

Returns a string slice with leading whitespace removed.

-

‘Whitespace’ is defined according to the terms of the Unicode Derived -Core Property White_Space.

-
Text directionality
-

A string is a sequence of bytes. ‘Left’ in this context means the first -position of that byte string; for a language like Arabic or Hebrew -which are ‘right to left’ rather than ‘left to right’, this will be -the right side, not the left.

-
Examples
-

Basic usage:

- -
let s = " Hello\tworld\t";
-
-assert_eq!("Hello\tworld\t", s.trim_left());
-

Directionality:

- -
let s = "  English";
-assert!(Some('E') == s.trim_left().chars().next());
-
-let s = "  עברית";
-assert!(Some('ע') == s.trim_left().chars().next());
-
1.0.0

pub fn trim_right(&self) -> &str

👎Deprecated since 1.33.0: superseded by trim_end

Returns a string slice with trailing whitespace removed.

-

‘Whitespace’ is defined according to the terms of the Unicode Derived -Core Property White_Space.

-
Text directionality
-

A string is a sequence of bytes. ‘Right’ in this context means the last -position of that byte string; for a language like Arabic or Hebrew -which are ‘right to left’ rather than ‘left to right’, this will be -the left side, not the right.

-
Examples
-

Basic usage:

- -
let s = " Hello\tworld\t";
-
-assert_eq!(" Hello\tworld", s.trim_right());
-

Directionality:

- -
let s = "English  ";
-assert!(Some('h') == s.trim_right().chars().rev().next());
-
-let s = "עברית  ";
-assert!(Some('ת') == s.trim_right().chars().rev().next());
-
1.0.0

pub fn trim_matches<'a, P>(&'a self, pat: P) -> &'a strwhere - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: DoubleEndedSearcher<'a>,

Returns a string slice with all prefixes and suffixes that match a -pattern repeatedly removed.

-

The pattern can be a char, a slice of chars, or a function -or closure that determines if a character matches.

-
Examples
-

Simple patterns:

- -
assert_eq!("11foo1bar11".trim_matches('1'), "foo1bar");
-assert_eq!("123foo1bar123".trim_matches(char::is_numeric), "foo1bar");
-
-let x: &[_] = &['1', '2'];
-assert_eq!("12foo1bar12".trim_matches(x), "foo1bar");
-

A more complex pattern, using a closure:

- -
assert_eq!("1foo1barXX".trim_matches(|c| c == '1' || c == 'X'), "foo1bar");
-
1.30.0

pub fn trim_start_matches<'a, P>(&'a self, pat: P) -> &'a strwhere - P: Pattern<'a>,

Returns a string slice with all prefixes that match a pattern -repeatedly removed.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Text directionality
-

A string is a sequence of bytes. start in this context means the first -position of that byte string; for a left-to-right language like English or -Russian, this will be left side, and for right-to-left languages like -Arabic or Hebrew, this will be the right side.

-
Examples
-
assert_eq!("11foo1bar11".trim_start_matches('1'), "foo1bar11");
-assert_eq!("123foo1bar123".trim_start_matches(char::is_numeric), "foo1bar123");
-
-let x: &[_] = &['1', '2'];
-assert_eq!("12foo1bar12".trim_start_matches(x), "foo1bar12");
-
1.45.0

pub fn strip_prefix<'a, P>(&'a self, prefix: P) -> Option<&'a str>where - P: Pattern<'a>,

Returns a string slice with the prefix removed.

-

If the string starts with the pattern prefix, returns substring after the prefix, wrapped -in Some. Unlike trim_start_matches, this method removes the prefix exactly once.

-

If the string does not start with prefix, returns None.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-
assert_eq!("foo:bar".strip_prefix("foo:"), Some("bar"));
-assert_eq!("foo:bar".strip_prefix("bar"), None);
-assert_eq!("foofoo".strip_prefix("foo"), Some("foo"));
-
1.45.0

pub fn strip_suffix<'a, P>(&'a self, suffix: P) -> Option<&'a str>where - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns a string slice with the suffix removed.

-

If the string ends with the pattern suffix, returns the substring before the suffix, -wrapped in Some. Unlike trim_end_matches, this method removes the suffix exactly once.

-

If the string does not end with suffix, returns None.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Examples
-
assert_eq!("bar:foo".strip_suffix(":foo"), Some("bar"));
-assert_eq!("bar:foo".strip_suffix("bar"), None);
-assert_eq!("foofoo".strip_suffix("foo"), Some("foo"));
-
1.30.0

pub fn trim_end_matches<'a, P>(&'a self, pat: P) -> &'a strwhere - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

Returns a string slice with all suffixes that match a pattern -repeatedly removed.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Text directionality
-

A string is a sequence of bytes. end in this context means the last -position of that byte string; for a left-to-right language like English or -Russian, this will be right side, and for right-to-left languages like -Arabic or Hebrew, this will be the left side.

-
Examples
-

Simple patterns:

- -
assert_eq!("11foo1bar11".trim_end_matches('1'), "11foo1bar");
-assert_eq!("123foo1bar123".trim_end_matches(char::is_numeric), "123foo1bar");
-
-let x: &[_] = &['1', '2'];
-assert_eq!("12foo1bar12".trim_end_matches(x), "12foo1bar");
-

A more complex pattern, using a closure:

- -
assert_eq!("1fooX".trim_end_matches(|c| c == '1' || c == 'X'), "1foo");
-
1.0.0

pub fn trim_left_matches<'a, P>(&'a self, pat: P) -> &'a strwhere - P: Pattern<'a>,

👎Deprecated since 1.33.0: superseded by trim_start_matches

Returns a string slice with all prefixes that match a pattern -repeatedly removed.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Text directionality
-

A string is a sequence of bytes. ‘Left’ in this context means the first -position of that byte string; for a language like Arabic or Hebrew -which are ‘right to left’ rather than ‘left to right’, this will be -the right side, not the left.

-
Examples
-
assert_eq!("11foo1bar11".trim_left_matches('1'), "foo1bar11");
-assert_eq!("123foo1bar123".trim_left_matches(char::is_numeric), "foo1bar123");
-
-let x: &[_] = &['1', '2'];
-assert_eq!("12foo1bar12".trim_left_matches(x), "foo1bar12");
-
1.0.0

pub fn trim_right_matches<'a, P>(&'a self, pat: P) -> &'a strwhere - P: Pattern<'a>, - <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,

👎Deprecated since 1.33.0: superseded by trim_end_matches

Returns a string slice with all suffixes that match a pattern -repeatedly removed.

-

The pattern can be a &str, char, a slice of chars, or a -function or closure that determines if a character matches.

-
Text directionality
-

A string is a sequence of bytes. ‘Right’ in this context means the last -position of that byte string; for a language like Arabic or Hebrew -which are ‘right to left’ rather than ‘left to right’, this will be -the left side, not the right.

-
Examples
-

Simple patterns:

- -
assert_eq!("11foo1bar11".trim_right_matches('1'), "11foo1bar");
-assert_eq!("123foo1bar123".trim_right_matches(char::is_numeric), "123foo1bar");
-
-let x: &[_] = &['1', '2'];
-assert_eq!("12foo1bar12".trim_right_matches(x), "12foo1bar");
-

A more complex pattern, using a closure:

- -
assert_eq!("1fooX".trim_right_matches(|c| c == '1' || c == 'X'), "1foo");
-
1.0.0

pub fn parse<F>(&self) -> Result<F, <F as FromStr>::Err>where - F: FromStr,

Parses this string slice into another type.

-

Because parse is so general, it can cause problems with type -inference. As such, parse is one of the few times you’ll see -the syntax affectionately known as the ‘turbofish’: ::<>. This -helps the inference algorithm understand specifically which type -you’re trying to parse into.

-

parse can parse into any type that implements the [FromStr] trait.

-
Errors
-

Will return Err if it’s not possible to parse this string slice into -the desired type.

-
Examples
-

Basic usage

- -
let four: u32 = "4".parse().unwrap();
-
-assert_eq!(4, four);
-

Using the ‘turbofish’ instead of annotating four:

- -
let four = "4".parse::<u32>();
-
-assert_eq!(Ok(4), four);
-

Failing to parse:

- -
let nope = "j".parse::<u32>();
-
-assert!(nope.is_err());
-
1.23.0

pub fn is_ascii(&self) -> bool

Checks if all characters in this string are within the ASCII range.

-
Examples
-
let ascii = "hello!\n";
-let non_ascii = "Grüße, Jürgen ❤";
-
-assert!(ascii.is_ascii());
-assert!(!non_ascii.is_ascii());
-

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this string slice is_ascii, returns it as a slice -of ASCII characters, otherwise returns None.

-
1.23.0

pub fn eq_ignore_ascii_case(&self, other: &str) -> bool

Checks that two strings are an ASCII case-insensitive match.

-

Same as to_ascii_lowercase(a) == to_ascii_lowercase(b), -but without allocating and copying temporaries.

-
Examples
-
assert!("Ferris".eq_ignore_ascii_case("FERRIS"));
-assert!("Ferrös".eq_ignore_ascii_case("FERRöS"));
-assert!(!"Ferrös".eq_ignore_ascii_case("FERRÖS"));
-
1.23.0

pub fn make_ascii_uppercase(&mut self)

Converts this string to its ASCII upper case equivalent in-place.

-

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, -but non-ASCII letters are unchanged.

-

To return a new uppercased value without modifying the existing one, use -to_ascii_uppercase().

-
Examples
-
let mut s = String::from("Grüße, Jürgen ❤");
-
-s.make_ascii_uppercase();
-
-assert_eq!("GRüßE, JüRGEN ❤", s);
-
1.23.0

pub fn make_ascii_lowercase(&mut self)

Converts this string to its ASCII lower case equivalent in-place.

-

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, -but non-ASCII letters are unchanged.

-

To return a new lowercased value without modifying the existing one, use -to_ascii_lowercase().

-
Examples
-
let mut s = String::from("GRÜßE, JÜRGEN ❤");
-
-s.make_ascii_lowercase();
-
-assert_eq!("grÜße, jÜrgen ❤", s);
-
1.34.0

pub fn escape_debug(&self) -> EscapeDebug<'_>

Return an iterator that escapes each char in self with [char::escape_debug].

-

Note: only extended grapheme codepoints that begin the string will be -escaped.

-
Examples
-

As an iterator:

- -
for c in "❤\n!".escape_debug() {
-    print!("{c}");
-}
-println!();
-

Using println! directly:

- -
println!("{}", "❤\n!".escape_debug());
-

Both are equivalent to:

- -
println!("❤\\n!");
-

Using to_string:

- -
assert_eq!("❤\n!".escape_debug().to_string(), "❤\\n!");
-
1.34.0

pub fn escape_default(&self) -> EscapeDefault<'_>

Return an iterator that escapes each char in self with [char::escape_default].

-
Examples
-

As an iterator:

- -
for c in "❤\n!".escape_default() {
-    print!("{c}");
-}
-println!();
-

Using println! directly:

- -
println!("{}", "❤\n!".escape_default());
-

Both are equivalent to:

- -
println!("\\u{{2764}}\\n!");
-

Using to_string:

- -
assert_eq!("❤\n!".escape_default().to_string(), "\\u{2764}\\n!");
-
1.34.0

pub fn escape_unicode(&self) -> EscapeUnicode<'_>

Return an iterator that escapes each char in self with [char::escape_unicode].

-
Examples
-

As an iterator:

- -
for c in "❤\n!".escape_unicode() {
-    print!("{c}");
-}
-println!();
-

Using println! directly:

- -
println!("{}", "❤\n!".escape_unicode());
-

Both are equivalent to:

- -
println!("\\u{{2764}}\\u{{a}}\\u{{21}}");
-

Using to_string:

- -
assert_eq!("❤\n!".escape_unicode().to_string(), "\\u{2764}\\u{a}\\u{21}");
-

Trait Implementations§

source§

impl<const N: usize> AsRef<[u8]> for String<N>

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<const N: usize> AsRef<str> for String<N>

source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<const N: usize> Clone for String<N>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<const N: usize> Debug for String<N>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<const N: usize> Default for String<N>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<const N: usize> Deref for String<N>

§

type Target = str

The resulting type after dereferencing.
source§

fn deref(&self) -> &str

Dereferences the value.
source§

impl<const N: usize> DerefMut for String<N>

source§

fn deref_mut(&mut self) -> &mut str

Mutably dereferences the value.
source§

impl<const N: usize> Display for String<N>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, const N: usize> From<&'a str> for String<N>

source§

fn from(s: &'a str) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<i16> for String<N>

source§

fn from(s: i16) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<i32> for String<N>

source§

fn from(s: i32) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<i64> for String<N>

source§

fn from(s: i64) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<i8> for String<N>

source§

fn from(s: i8) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<u16> for String<N>

source§

fn from(s: u16) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<u32> for String<N>

source§

fn from(s: u32) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<u64> for String<N>

source§

fn from(s: u64) -> Self

Converts to this type from the input type.
source§

impl<const N: usize> From<u8> for String<N>

source§

fn from(s: u8) -> Self

Converts to this type from the input type.
source§

impl<'a, const N: usize> FromIterator<&'a char> for String<N>

source§

fn from_iter<T: IntoIterator<Item = &'a char>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl<'a, const N: usize> FromIterator<&'a str> for String<N>

source§

fn from_iter<T: IntoIterator<Item = &'a str>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl<const N: usize> FromIterator<char> for String<N>

source§

fn from_iter<T: IntoIterator<Item = char>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl<const N: usize> FromStr for String<N>

§

type Err = ()

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<const N: usize> Hash for String<N>

source§

fn hash<H: Hasher>(&self, hasher: &mut H)

Feeds this value into the given Hasher.
source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher.
source§

impl<const N: usize> Hash for String<N>

source§

fn hash<H: Hasher>(&self, hasher: &mut H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl<const N: usize> Ord for String<N>

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<const N: usize> PartialEq<&str> for String<N>

source§

fn eq(&self, other: &&str) -> bool

This method tests for self and other values to be equal, and is used -by ==.
source§

fn ne(&self, other: &&str) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<const N: usize> PartialEq<String<N>> for &str

source§

fn eq(&self, other: &String<N>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
source§

fn ne(&self, other: &String<N>) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<const N: usize> PartialEq<String<N>> for str

source§

fn eq(&self, other: &String<N>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
source§

fn ne(&self, other: &String<N>) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<const N1: usize, const N2: usize> PartialEq<String<N2>> for String<N1>

source§

fn eq(&self, rhs: &String<N2>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
source§

fn ne(&self, rhs: &String<N2>) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<const N: usize> PartialEq<str> for String<N>

source§

fn eq(&self, other: &str) -> bool

This method tests for self and other values to be equal, and is used -by ==.
source§

fn ne(&self, other: &str) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<const N1: usize, const N2: usize> PartialOrd<String<N2>> for String<N1>

source§

fn partial_cmp(&self, other: &String<N2>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl<const N: usize> Write for String<N>

source§

fn write_str(&mut self, s: &str) -> Result<(), Error>

Writes a string slice into this writer, returning whether the write -succeeded. Read more
source§

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a [char] into this writer, returning whether the write succeeded. Read more
1.0.0§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the [write!] macro with implementors of this trait. Read more
source§

impl<const N: usize> Eq for String<N>

Auto Trait Implementations§

§

impl<const N: usize> RefUnwindSafe for String<N>

§

impl<const N: usize> Send for String<N>

§

impl<const N: usize> Sync for String<N>

§

impl<const N: usize> Unpin for String<N>

§

impl<const N: usize> UnwindSafe for String<N>

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/struct.VacantEntry.html b/docs/doc/heapless/struct.VacantEntry.html deleted file mode 100644 index 094b6cb..0000000 --- a/docs/doc/heapless/struct.VacantEntry.html +++ /dev/null @@ -1,24 +0,0 @@ -VacantEntry in heapless - Rust

Struct heapless::VacantEntry

source ·
pub struct VacantEntry<'a, K, V, const N: usize> { /* private fields */ }
Expand description

A view into an empty slot in the underlying map

-

Implementations§

source§

impl<'a, K, V, const N: usize> VacantEntry<'a, K, V, N>where - K: Eq + Hash,

source

pub fn key(&self) -> &K

Get the key associated with this entry

-
source

pub fn into_key(self) -> K

Consumes this entry to yield to key associated with it

-
source

pub fn insert(self, value: V) -> Result<&'a mut V, V>

Inserts this entry into to underlying map, yields a mutable reference to the inserted value. -If the map is at capacity the value is returned instead.

-

Auto Trait Implementations§

§

impl<'a, K, V, const N: usize> RefUnwindSafe for VacantEntry<'a, K, V, N>where - K: RefUnwindSafe, - V: RefUnwindSafe,

§

impl<'a, K, V, const N: usize> Send for VacantEntry<'a, K, V, N>where - K: Send, - V: Send,

§

impl<'a, K, V, const N: usize> Sync for VacantEntry<'a, K, V, N>where - K: Sync, - V: Sync,

§

impl<'a, K, V, const N: usize> Unpin for VacantEntry<'a, K, V, N>where - K: Unpin,

§

impl<'a, K, V, const N: usize> !UnwindSafe for VacantEntry<'a, K, V, N>

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/struct.Vec.html b/docs/doc/heapless/struct.Vec.html deleted file mode 100644 index 6b0dc73..0000000 --- a/docs/doc/heapless/struct.Vec.html +++ /dev/null @@ -1,2528 +0,0 @@ -Vec in heapless - Rust

Struct heapless::Vec

source ·
pub struct Vec<T, const N: usize> { /* private fields */ }
Expand description

A fixed capacity Vec

-

Examples

-
use heapless::Vec;
-
-
-// A vector with a fixed capacity of 8 elements allocated on the stack
-let mut vec = Vec::<_, 8>::new();
-vec.push(1);
-vec.push(2);
-
-assert_eq!(vec.len(), 2);
-assert_eq!(vec[0], 1);
-
-assert_eq!(vec.pop(), Some(2));
-assert_eq!(vec.len(), 1);
-
-vec[0] = 7;
-assert_eq!(vec[0], 7);
-
-vec.extend([1, 2, 3].iter().cloned());
-
-for x in &vec {
-    println!("{}", x);
-}
-assert_eq!(*vec, [7, 1, 2, 3]);
-

Implementations§

source§

impl<T, const N: usize> Vec<T, N>

source

pub const fn new() -> Self

Constructs a new, empty vector with a fixed capacity of N

-
Examples
-
use heapless::Vec;
-
-// allocate the vector on the stack
-let mut x: Vec<u8, 16> = Vec::new();
-
-// allocate the vector in a static variable
-static mut X: Vec<u8, 16> = Vec::new();
-

Vec const constructor; wrap the returned value in Vec

-
source

pub fn from_slice(other: &[T]) -> Result<Self, ()>where - T: Clone,

Constructs a new vector with a fixed capacity of N and fills it -with the provided slice.

-

This is equivalent to the following code:

- -
use heapless::Vec;
-
-let mut v: Vec<u8, 16> = Vec::new();
-v.extend_from_slice(&[1, 2, 3]).unwrap();
-
source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the vector’s buffer.

-
source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns a raw pointer to the vector’s buffer, which may be mutated through.

-
source

pub fn as_slice(&self) -> &[T]

Extracts a slice containing the entire vector.

-

Equivalent to &s[..].

-
Examples
-
use heapless::Vec;
-let buffer: Vec<u8, 5> = Vec::from_slice(&[1, 2, 3, 5, 8]).unwrap();
-assert_eq!(buffer.as_slice(), &[1, 2, 3, 5, 8]);
-
source

pub fn into_array<const M: usize>(self) -> Result<[T; M], Self>

Returns the contents of the vector as an array of length M if the length -of the vector is exactly M, otherwise returns Err(self).

-
Examples
-
use heapless::Vec;
-let buffer: Vec<u8, 42> = Vec::from_slice(&[1, 2, 3, 5, 8]).unwrap();
-let array: [u8; 5] = buffer.into_array().unwrap();
-assert_eq!(array, [1, 2, 3, 5, 8]);
-
source

pub const fn capacity(&self) -> usize

Returns the maximum number of elements the vector can hold.

-
source

pub fn clear(&mut self)

Clears the vector, removing all values.

-
source

pub fn extend<I>(&mut self, iter: I)where - I: IntoIterator<Item = T>,

Extends the vec from an iterator.

-
Panic
-

Panics if the vec cannot hold all elements of the iterator.

-
source

pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), ()>where - T: Clone,

Clones and appends all elements in a slice to the Vec.

-

Iterates over the slice other, clones each element, and then appends -it to this Vec. The other vector is traversed in-order.

-
Examples
-
use heapless::Vec;
-
-let mut vec = Vec::<u8, 8>::new();
-vec.push(1).unwrap();
-vec.extend_from_slice(&[2, 3, 4]).unwrap();
-assert_eq!(*vec, [1, 2, 3, 4]);
-
source

pub fn pop(&mut self) -> Option<T>

Removes the last element from a vector and returns it, or None if it’s empty

-
source

pub fn push(&mut self, item: T) -> Result<(), T>

Appends an item to the back of the collection

-

Returns back the item if the vector is full

-
source

pub unsafe fn pop_unchecked(&mut self) -> T

Removes the last element from a vector and returns it

-
Safety
-

This assumes the vec to have at least one element.

-
source

pub unsafe fn push_unchecked(&mut self, item: T)

Appends an item to the back of the collection

-
Safety
-

This assumes the vec is not full.

-
source

pub fn truncate(&mut self, len: usize)

Shortens the vector, keeping the first len elements and dropping the rest.

-
source

pub fn resize(&mut self, new_len: usize, value: T) -> Result<(), ()>where - T: Clone,

Resizes the Vec in-place so that len is equal to new_len.

-

If new_len is greater than len, the Vec is extended by the -difference, with each additional slot filled with value. If -new_len is less than len, the Vec is simply truncated.

-

See also resize_default.

-
source

pub fn resize_default(&mut self, new_len: usize) -> Result<(), ()>where - T: Clone + Default,

Resizes the Vec in-place so that len is equal to new_len.

-

If new_len is greater than len, the Vec is extended by the -difference, with each additional slot filled with Default::default(). -If new_len is less than len, the Vec is simply truncated.

-

See also resize.

-
source

pub unsafe fn set_len(&mut self, new_len: usize)

Forces the length of the vector to new_len.

-

This is a low-level operation that maintains none of the normal -invariants of the type. Normally changing the length of a vector -is done using one of the safe operations instead, such as -truncate, resize, extend, or clear.

-
Safety
-
    -
  • new_len must be less than or equal to capacity().
  • -
  • The elements at old_len..new_len must be initialized.
  • -
-
Examples
-

This method can be useful for situations in which the vector -is serving as a buffer for other code, particularly over FFI:

- -
use heapless::Vec;
-
-pub fn get_dictionary(&self) -> Option<Vec<u8, 32768>> {
-    // Per the FFI method's docs, "32768 bytes is always enough".
-    let mut dict = Vec::new();
-    let mut dict_length = 0;
-    // SAFETY: When `deflateGetDictionary` returns `Z_OK`, it holds that:
-    // 1. `dict_length` elements were initialized.
-    // 2. `dict_length` <= the capacity (32_768)
-    // which makes `set_len` safe to call.
-    unsafe {
-        // Make the FFI call...
-        let r = deflateGetDictionary(self.strm, dict.as_mut_ptr(), &mut dict_length);
-        if r == Z_OK {
-            // ...and update the length to what was initialized.
-            dict.set_len(dict_length);
-            Some(dict)
-        } else {
-            None
-        }
-    }
-}
-

While the following example is sound, there is a memory leak since -the inner vectors were not freed prior to the set_len call:

- -
use core::iter::FromIterator;
-use heapless::Vec;
-
-let mut vec = Vec::<Vec<u8, 3>, 3>::from_iter(
-    [
-        Vec::from_iter([1, 0, 0].iter().cloned()),
-        Vec::from_iter([0, 1, 0].iter().cloned()),
-        Vec::from_iter([0, 0, 1].iter().cloned()),
-    ]
-    .iter()
-    .cloned()
-);
-// SAFETY:
-// 1. `old_len..0` is empty so no elements need to be initialized.
-// 2. `0 <= capacity` always holds whatever `capacity` is.
-unsafe {
-    vec.set_len(0);
-}
-

Normally, here, one would use clear instead to correctly drop -the contents and thus not leak memory.

-
source

pub fn swap_remove(&mut self, index: usize) -> T

Removes an element from the vector and returns it.

-

The removed element is replaced by the last element of the vector.

-

This does not preserve ordering, but is O(1).

-
Panics
-

Panics if index is out of bounds.

-
Examples
-
use heapless::Vec;
-
-let mut v: Vec<_, 8> = Vec::new();
-v.push("foo").unwrap();
-v.push("bar").unwrap();
-v.push("baz").unwrap();
-v.push("qux").unwrap();
-
-assert_eq!(v.swap_remove(1), "bar");
-assert_eq!(&*v, ["foo", "qux", "baz"]);
-
-assert_eq!(v.swap_remove(0), "foo");
-assert_eq!(&*v, ["baz", "qux"]);
-
source

pub unsafe fn swap_remove_unchecked(&mut self, index: usize) -> T

Removes an element from the vector and returns it.

-

The removed element is replaced by the last element of the vector.

-

This does not preserve ordering, but is O(1).

-
Safety
-

Assumes index within bounds.

-
Examples
-
use heapless::Vec;
-
-let mut v: Vec<_, 8> = Vec::new();
-v.push("foo").unwrap();
-v.push("bar").unwrap();
-v.push("baz").unwrap();
-v.push("qux").unwrap();
-
-assert_eq!(unsafe { v.swap_remove_unchecked(1) }, "bar");
-assert_eq!(&*v, ["foo", "qux", "baz"]);
-
-assert_eq!(unsafe { v.swap_remove_unchecked(0) }, "foo");
-assert_eq!(&*v, ["baz", "qux"]);
-
source

pub fn is_full(&self) -> bool

Returns true if the vec is full

-
source

pub fn is_empty(&self) -> bool

Returns true if the vec is empty

-
source

pub fn starts_with(&self, needle: &[T]) -> boolwhere - T: PartialEq,

Returns true if needle is a prefix of the Vec.

-

Always returns true if needle is an empty slice.

-
Examples
-
use heapless::Vec;
-
-let v: Vec<_, 8> = Vec::from_slice(b"abc").unwrap();
-assert_eq!(v.starts_with(b""), true);
-assert_eq!(v.starts_with(b"ab"), true);
-assert_eq!(v.starts_with(b"bc"), false);
-
source

pub fn ends_with(&self, needle: &[T]) -> boolwhere - T: PartialEq,

Returns true if needle is a suffix of the Vec.

-

Always returns true if needle is an empty slice.

-
Examples
-
use heapless::Vec;
-
-let v: Vec<_, 8> = Vec::from_slice(b"abc").unwrap();
-assert_eq!(v.ends_with(b""), true);
-assert_eq!(v.ends_with(b"ab"), false);
-assert_eq!(v.ends_with(b"bc"), true);
-
source

pub fn insert(&mut self, index: usize, element: T) -> Result<(), T>

Inserts an element at position index within the vector, shifting all -elements after it to the right.

-

Returns back the element if the vector is full.

-
Panics
-

Panics if index > len.

-
Examples
-
use heapless::Vec;
-
-let mut vec: Vec<_, 8> = Vec::from_slice(&[1, 2, 3]).unwrap();
-vec.insert(1, 4);
-assert_eq!(vec, [1, 4, 2, 3]);
-vec.insert(4, 5);
-assert_eq!(vec, [1, 4, 2, 3, 5]);
-
source

pub fn remove(&mut self, index: usize) -> T

Removes and returns the element at position index within the vector, -shifting all elements after it to the left.

-

Note: Because this shifts over the remaining elements, it has a -worst-case performance of O(n). If you don’t need the order of -elements to be preserved, use swap_remove instead. If you’d like to -remove elements from the beginning of the Vec, consider using -Deque::pop_front instead.

-
Panics
-

Panics if index is out of bounds.

-
Examples
-
use heapless::Vec;
-
-let mut v: Vec<_, 8> = Vec::from_slice(&[1, 2, 3]).unwrap();
-assert_eq!(v.remove(1), 2);
-assert_eq!(v, [1, 3]);
-
source

pub fn retain<F>(&mut self, f: F)where - F: FnMut(&T) -> bool,

Retains only the elements specified by the predicate.

-

In other words, remove all elements e for which f(&e) returns false. -This method operates in place, visiting each element exactly once in the -original order, and preserves the order of the retained elements.

-
Examples
-
use heapless::Vec;
-
-let mut vec: Vec<_, 8> = Vec::from_slice(&[1, 2, 3, 4]).unwrap();
-vec.retain(|&x| x % 2 == 0);
-assert_eq!(vec, [2, 4]);
-

Because the elements are visited exactly once in the original order, -external state may be used to decide which elements to keep.

- -
use heapless::Vec;
-
-let mut vec: Vec<_, 8> = Vec::from_slice(&[1, 2, 3, 4, 5]).unwrap();
-let keep = [false, true, true, false, true];
-let mut iter = keep.iter();
-vec.retain(|_| *iter.next().unwrap());
-assert_eq!(vec, [2, 3, 5]);
-
source

pub fn retain_mut<F>(&mut self, f: F)where - F: FnMut(&mut T) -> bool,

Retains only the elements specified by the predicate, passing a mutable reference to it.

-

In other words, remove all elements e such that f(&mut e) returns false. -This method operates in place, visiting each element exactly once in the -original order, and preserves the order of the retained elements.

-
Examples
-
use heapless::Vec;
-
-let mut vec: Vec<_, 8> = Vec::from_slice(&[1, 2, 3, 4]).unwrap();
-vec.retain_mut(|x| if *x <= 3 {
-    *x += 1;
-    true
-} else {
-    false
-});
-assert_eq!(vec, [2, 3, 4]);
-

Methods from Deref<Target = [T]>§

pub fn flatten(&self) -> &[T]

🔬This is a nightly-only experimental API. (slice_flatten)

Takes a &[[T; N]], and flattens it to a &[T].

-
Panics
-

This panics if the length of the resulting slice would overflow a usize.

-

This is only possible when flattening a slice of arrays of zero-sized -types, and thus tends to be irrelevant in practice. If -size_of::<T>() > 0, this will never panic.

-
Examples
-
#![feature(slice_flatten)]
-
-assert_eq!([[1, 2, 3], [4, 5, 6]].flatten(), &[1, 2, 3, 4, 5, 6]);
-
-assert_eq!(
-    [[1, 2, 3], [4, 5, 6]].flatten(),
-    [[1, 2], [3, 4], [5, 6]].flatten(),
-);
-
-let slice_of_empty_arrays: &[[i32; 0]] = &[[], [], [], [], []];
-assert!(slice_of_empty_arrays.flatten().is_empty());
-
-let empty_slice_of_arrays: &[[u32; 10]] = &[];
-assert!(empty_slice_of_arrays.flatten().is_empty());
-

pub fn flatten_mut(&mut self) -> &mut [T]

🔬This is a nightly-only experimental API. (slice_flatten)

Takes a &mut [[T; N]], and flattens it to a &mut [T].

-
Panics
-

This panics if the length of the resulting slice would overflow a usize.

-

This is only possible when flattening a slice of arrays of zero-sized -types, and thus tends to be irrelevant in practice. If -size_of::<T>() > 0, this will never panic.

-
Examples
-
#![feature(slice_flatten)]
-
-fn add_5_to_all(slice: &mut [i32]) {
-    for i in slice {
-        *i += 5;
-    }
-}
-
-let mut array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
-add_5_to_all(array.flatten_mut());
-assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
-
1.23.0

pub fn is_ascii(&self) -> bool

Checks if all bytes in this slice are within the ASCII range.

-

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this slice is_ascii, returns it as a slice of -ASCII characters, otherwise returns None.

-

pub unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar]

🔬This is a nightly-only experimental API. (ascii_char)

Converts this slice of bytes into a slice of ASCII characters, -without checking whether they’re valid.

-
Safety
-

Every byte in the slice must be in 0..=127, or else this is UB.

-
1.23.0

pub fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool

Checks that two slices are an ASCII case-insensitive match.

-

Same as to_ascii_lowercase(a) == to_ascii_lowercase(b), -but without allocating and copying temporaries.

-
1.23.0

pub fn make_ascii_uppercase(&mut self)

Converts this slice to its ASCII upper case equivalent in-place.

-

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, -but non-ASCII letters are unchanged.

-

To return a new uppercased value without modifying the existing one, use -to_ascii_uppercase.

-
1.23.0

pub fn make_ascii_lowercase(&mut self)

Converts this slice to its ASCII lower case equivalent in-place.

-

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, -but non-ASCII letters are unchanged.

-

To return a new lowercased value without modifying the existing one, use -to_ascii_lowercase.

-
1.60.0

pub fn escape_ascii(&self) -> EscapeAscii<'_>

Returns an iterator that produces an escaped version of this slice, -treating it as an ASCII string.

-
Examples
-

-let s = b"0\t\r\n'\"\\\x9d";
-let escaped = s.escape_ascii().to_string();
-assert_eq!(escaped, "0\\t\\r\\n\\'\\\"\\\\\\x9d");
-

pub fn trim_ascii_start(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with leading ASCII whitespace bytes removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b" \t hello world\n".trim_ascii_start(), b"hello world\n");
-assert_eq!(b"  ".trim_ascii_start(), b"");
-assert_eq!(b"".trim_ascii_start(), b"");
-

pub fn trim_ascii_end(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with trailing ASCII whitespace bytes removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b"\r hello world\n ".trim_ascii_end(), b"\r hello world");
-assert_eq!(b"  ".trim_ascii_end(), b"");
-assert_eq!(b"".trim_ascii_end(), b"");
-

pub fn trim_ascii(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with leading and trailing ASCII whitespace bytes -removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b"\r hello world\n ".trim_ascii(), b"hello world");
-assert_eq!(b"  ".trim_ascii(), b"");
-assert_eq!(b"".trim_ascii(), b"");
-

pub fn as_str(&self) -> &str

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a UTF-8 str.

-

pub fn as_bytes(&self) -> &[u8]

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a slice of u8 bytes.

-
1.0.0

pub fn len(&self) -> usize

Returns the number of elements in the slice.

-
Examples
-
let a = [1, 2, 3];
-assert_eq!(a.len(), 3);
-
1.0.0

pub fn is_empty(&self) -> bool

Returns true if the slice has a length of 0.

-
Examples
-
let a = [1, 2, 3];
-assert!(!a.is_empty());
-
1.0.0

pub fn first(&self) -> Option<&T>

Returns the first element of the slice, or None if it is empty.

-
Examples
-
let v = [10, 40, 30];
-assert_eq!(Some(&10), v.first());
-
-let w: &[i32] = &[];
-assert_eq!(None, w.first());
-
1.0.0

pub fn first_mut(&mut self) -> Option<&mut T>

Returns a mutable pointer to the first element of the slice, or None if it is empty.

-
Examples
-
let x = &mut [0, 1, 2];
-
-if let Some(first) = x.first_mut() {
-    *first = 5;
-}
-assert_eq!(x, &[5, 1, 2]);
-
1.5.0

pub fn split_first(&self) -> Option<(&T, &[T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
let x = &[0, 1, 2];
-
-if let Some((first, elements)) = x.split_first() {
-    assert_eq!(first, &0);
-    assert_eq!(elements, &[1, 2]);
-}
-
1.5.0

pub fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
let x = &mut [0, 1, 2];
-
-if let Some((first, elements)) = x.split_first_mut() {
-    *first = 3;
-    elements[0] = 4;
-    elements[1] = 5;
-}
-assert_eq!(x, &[3, 4, 5]);
-
1.5.0

pub fn split_last(&self) -> Option<(&T, &[T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
let x = &[0, 1, 2];
-
-if let Some((last, elements)) = x.split_last() {
-    assert_eq!(last, &2);
-    assert_eq!(elements, &[0, 1]);
-}
-
1.5.0

pub fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
let x = &mut [0, 1, 2];
-
-if let Some((last, elements)) = x.split_last_mut() {
-    *last = 3;
-    elements[0] = 4;
-    elements[1] = 5;
-}
-assert_eq!(x, &[4, 5, 3]);
-
1.0.0

pub fn last(&self) -> Option<&T>

Returns the last element of the slice, or None if it is empty.

-
Examples
-
let v = [10, 40, 30];
-assert_eq!(Some(&30), v.last());
-
-let w: &[i32] = &[];
-assert_eq!(None, w.last());
-
1.0.0

pub fn last_mut(&mut self) -> Option<&mut T>

Returns a mutable pointer to the last item in the slice.

-
Examples
-
let x = &mut [0, 1, 2];
-
-if let Some(last) = x.last_mut() {
-    *last = 10;
-}
-assert_eq!(x, &[0, 1, 10]);
-

pub fn first_chunk<const N: usize>(&self) -> Option<&[T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the first N elements of the slice, or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let u = [10, 40, 30];
-assert_eq!(Some(&[10, 40]), u.first_chunk::<2>());
-
-let v: &[i32] = &[10];
-assert_eq!(None, v.first_chunk::<2>());
-
-let w: &[i32] = &[];
-assert_eq!(Some(&[]), w.first_chunk::<0>());
-

pub fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns a mutable reference to the first N elements of the slice, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &mut [0, 1, 2];
-
-if let Some(first) = x.first_chunk_mut::<2>() {
-    first[0] = 5;
-    first[1] = 4;
-}
-assert_eq!(x, &[5, 4, 2]);
-

pub fn split_first_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the first N elements of the slice and the remainder, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &[0, 1, 2];
-
-if let Some((first, elements)) = x.split_first_chunk::<2>() {
-    assert_eq!(first, &[0, 1]);
-    assert_eq!(elements, &[2]);
-}
-

pub fn split_first_chunk_mut<const N: usize>( - &mut self -) -> Option<(&mut [T; N], &mut [T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns a mutable reference to the first N elements of the slice and the remainder, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &mut [0, 1, 2];
-
-if let Some((first, elements)) = x.split_first_chunk_mut::<2>() {
-    first[0] = 3;
-    first[1] = 4;
-    elements[0] = 5;
-}
-assert_eq!(x, &[3, 4, 5]);
-

pub fn split_last_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the last N elements of the slice and the remainder, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &[0, 1, 2];
-
-if let Some((last, elements)) = x.split_last_chunk::<2>() {
-    assert_eq!(last, &[1, 2]);
-    assert_eq!(elements, &[0]);
-}
-

pub fn split_last_chunk_mut<const N: usize>( - &mut self -) -> Option<(&mut [T; N], &mut [T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the last and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &mut [0, 1, 2];
-
-if let Some((last, elements)) = x.split_last_chunk_mut::<2>() {
-    last[0] = 3;
-    last[1] = 4;
-    elements[0] = 5;
-}
-assert_eq!(x, &[5, 3, 4]);
-

pub fn last_chunk<const N: usize>(&self) -> Option<&[T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the last element of the slice, or None if it is empty.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let u = [10, 40, 30];
-assert_eq!(Some(&[40, 30]), u.last_chunk::<2>());
-
-let v: &[i32] = &[10];
-assert_eq!(None, v.last_chunk::<2>());
-
-let w: &[i32] = &[];
-assert_eq!(Some(&[]), w.last_chunk::<0>());
-

pub fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns a mutable pointer to the last item in the slice.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &mut [0, 1, 2];
-
-if let Some(last) = x.last_chunk_mut::<2>() {
-    last[0] = 10;
-    last[1] = 20;
-}
-assert_eq!(x, &[0, 10, 20]);
-
1.0.0

pub fn get<I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output>where - I: SliceIndex<[T]>,

Returns a reference to an element or subslice depending on the type of -index.

-
    -
  • If given a position, returns a reference to the element at that -position or None if out of bounds.
  • -
  • If given a range, returns the subslice corresponding to that range, -or None if out of bounds.
  • -
-
Examples
-
let v = [10, 40, 30];
-assert_eq!(Some(&40), v.get(1));
-assert_eq!(Some(&[10, 40][..]), v.get(0..2));
-assert_eq!(None, v.get(3));
-assert_eq!(None, v.get(0..4));
-
1.0.0

pub fn get_mut<I>( - &mut self, - index: I -) -> Option<&mut <I as SliceIndex<[T]>>::Output>where - I: SliceIndex<[T]>,

Returns a mutable reference to an element or subslice depending on the -type of index (see get) or None if the index is out of bounds.

-
Examples
-
let x = &mut [0, 1, 2];
-
-if let Some(elem) = x.get_mut(1) {
-    *elem = 42;
-}
-assert_eq!(x, &[0, 42, 2]);
-
1.0.0

pub unsafe fn get_unchecked<I>( - &self, - index: I -) -> &<I as SliceIndex<[T]>>::Outputwhere - I: SliceIndex<[T]>,

Returns a reference to an element or subslice, without doing bounds -checking.

-

For a safe alternative see get.

-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior -even if the resulting reference is not used.

-
Examples
-
let x = &[1, 2, 4];
-
-unsafe {
-    assert_eq!(x.get_unchecked(1), &2);
-}
-
1.0.0

pub unsafe fn get_unchecked_mut<I>( - &mut self, - index: I -) -> &mut <I as SliceIndex<[T]>>::Outputwhere - I: SliceIndex<[T]>,

Returns a mutable reference to an element or subslice, without doing -bounds checking.

-

For a safe alternative see get_mut.

-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior -even if the resulting reference is not used.

-
Examples
-
let x = &mut [1, 2, 4];
-
-unsafe {
-    let elem = x.get_unchecked_mut(1);
-    *elem = 13;
-}
-assert_eq!(x, &[1, 13, 4]);
-
1.0.0

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the slice’s buffer.

-

The caller must ensure that the slice outlives the pointer this -function returns, or else it will end up pointing to garbage.

-

The caller must also ensure that the memory the pointer (non-transitively) points to -is never written to (except inside an UnsafeCell) using this pointer or any pointer -derived from it. If you need to mutate the contents of the slice, use as_mut_ptr.

-

Modifying the container referenced by this slice may cause its buffer -to be reallocated, which would also make any pointers to it invalid.

-
Examples
-
let x = &[1, 2, 4];
-let x_ptr = x.as_ptr();
-
-unsafe {
-    for i in 0..x.len() {
-        assert_eq!(x.get_unchecked(i), &*x_ptr.add(i));
-    }
-}
-
1.0.0

pub fn as_mut_ptr(&mut self) -> *mut T

Returns an unsafe mutable pointer to the slice’s buffer.

-

The caller must ensure that the slice outlives the pointer this -function returns, or else it will end up pointing to garbage.

-

Modifying the container referenced by this slice may cause its buffer -to be reallocated, which would also make any pointers to it invalid.

-
Examples
-
let x = &mut [1, 2, 4];
-let x_ptr = x.as_mut_ptr();
-
-unsafe {
-    for i in 0..x.len() {
-        *x_ptr.add(i) += 2;
-    }
-}
-assert_eq!(x, &[3, 4, 6]);
-
1.48.0

pub fn as_ptr_range(&self) -> Range<*const T>

Returns the two raw pointers spanning the slice.

-

The returned range is half-open, which means that the end pointer -points one past the last element of the slice. This way, an empty -slice is represented by two equal pointers, and the difference between -the two pointers represents the size of the slice.

-

See as_ptr for warnings on using these pointers. The end pointer -requires extra caution, as it does not point to a valid element in the -slice.

-

This function is useful for interacting with foreign interfaces which -use two pointers to refer to a range of elements in memory, as is -common in C++.

-

It can also be useful to check if a pointer to an element refers to an -element of this slice:

- -
let a = [1, 2, 3];
-let x = &a[1] as *const _;
-let y = &5 as *const _;
-
-assert!(a.as_ptr_range().contains(&x));
-assert!(!a.as_ptr_range().contains(&y));
-
1.48.0

pub fn as_mut_ptr_range(&mut self) -> Range<*mut T>

Returns the two unsafe mutable pointers spanning the slice.

-

The returned range is half-open, which means that the end pointer -points one past the last element of the slice. This way, an empty -slice is represented by two equal pointers, and the difference between -the two pointers represents the size of the slice.

-

See as_mut_ptr for warnings on using these pointers. The end -pointer requires extra caution, as it does not point to a valid element -in the slice.

-

This function is useful for interacting with foreign interfaces which -use two pointers to refer to a range of elements in memory, as is -common in C++.

-
1.0.0

pub fn swap(&mut self, a: usize, b: usize)

Swaps two elements in the slice.

-

If a equals to b, it’s guaranteed that elements won’t change value.

-
Arguments
-
    -
  • a - The index of the first element
  • -
  • b - The index of the second element
  • -
-
Panics
-

Panics if a or b are out of bounds.

-
Examples
-
let mut v = ["a", "b", "c", "d", "e"];
-v.swap(2, 4);
-assert!(v == ["a", "b", "e", "d", "c"]);
-

pub unsafe fn swap_unchecked(&mut self, a: usize, b: usize)

🔬This is a nightly-only experimental API. (slice_swap_unchecked)

Swaps two elements in the slice, without doing bounds checking.

-

For a safe alternative see swap.

-
Arguments
-
    -
  • a - The index of the first element
  • -
  • b - The index of the second element
  • -
-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior. -The caller has to ensure that a < self.len() and b < self.len().

-
Examples
-
#![feature(slice_swap_unchecked)]
-
-let mut v = ["a", "b", "c", "d"];
-// SAFETY: we know that 1 and 3 are both indices of the slice
-unsafe { v.swap_unchecked(1, 3) };
-assert!(v == ["a", "d", "c", "b"]);
-
1.0.0

pub fn reverse(&mut self)

Reverses the order of elements in the slice, in place.

-
Examples
-
let mut v = [1, 2, 3];
-v.reverse();
-assert!(v == [3, 2, 1]);
-
1.0.0

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the slice.

-

The iterator yields all items from start to end.

-
Examples
-
let x = &[1, 2, 4];
-let mut iterator = x.iter();
-
-assert_eq!(iterator.next(), Some(&1));
-assert_eq!(iterator.next(), Some(&2));
-assert_eq!(iterator.next(), Some(&4));
-assert_eq!(iterator.next(), None);
-
1.0.0

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns an iterator that allows modifying each value.

-

The iterator yields all items from start to end.

-
Examples
-
let x = &mut [1, 2, 4];
-for elem in x.iter_mut() {
-    *elem += 2;
-}
-assert_eq!(x, &[3, 4, 6]);
-
1.0.0

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length -size. The windows overlap. If the slice is shorter than -size, the iterator returns no values.

-
Panics
-

Panics if size is 0.

-
Examples
-
let slice = ['r', 'u', 's', 't'];
-let mut iter = slice.windows(2);
-assert_eq!(iter.next().unwrap(), &['r', 'u']);
-assert_eq!(iter.next().unwrap(), &['u', 's']);
-assert_eq!(iter.next().unwrap(), &['s', 't']);
-assert!(iter.next().is_none());
-

If the slice is shorter than size:

- -
let slice = ['f', 'o', 'o'];
-let mut iter = slice.windows(4);
-assert!(iter.next().is_none());
-

There’s no windows_mut, as that existing would let safe code violate the -“only one &mut at a time to the same thing” rule. However, you can sometimes -use Cell::as_slice_of_cells in -conjunction with windows to accomplish something similar:

- -
use std::cell::Cell;
-
-let mut array = ['R', 'u', 's', 't', ' ', '2', '0', '1', '5'];
-let slice = &mut array[..];
-let slice_of_cells: &[Cell<char>] = Cell::from_mut(slice).as_slice_of_cells();
-for w in slice_of_cells.windows(3) {
-    Cell::swap(&w[0], &w[2]);
-}
-assert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
-
1.0.0

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last chunk will not have length chunk_size.

-

See chunks_exact for a variant of this iterator that returns chunks of always exactly -chunk_size elements, and rchunks for the same iterator but starting at the end of the -slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.chunks(2);
-assert_eq!(iter.next().unwrap(), &['l', 'o']);
-assert_eq!(iter.next().unwrap(), &['r', 'e']);
-assert_eq!(iter.next().unwrap(), &['m']);
-assert!(iter.next().is_none());
-
1.0.0

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the -length of the slice, then the last chunk will not have length chunk_size.

-

See chunks_exact_mut for a variant of this iterator that returns chunks of always -exactly chunk_size elements, and rchunks_mut for the same iterator but starting at -the end of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-for chunk in v.chunks_mut(2) {
-    for elem in chunk.iter_mut() {
-        *elem += count;
-    }
-    count += 1;
-}
-assert_eq!(v, &[1, 1, 2, 2, 3]);
-
1.31.0

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved -from the remainder function of the iterator.

-

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the -resulting code better than in the case of chunks.

-

See chunks for a variant of this iterator that also returns the remainder as a smaller -chunk, and rchunks_exact for the same iterator but starting at the end of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.chunks_exact(2);
-assert_eq!(iter.next().unwrap(), &['l', 'o']);
-assert_eq!(iter.next().unwrap(), &['r', 'e']);
-assert!(iter.next().is_none());
-assert_eq!(iter.remainder(), &['m']);
-
1.31.0

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the -length of the slice, then the last up to chunk_size-1 elements will be omitted and can be -retrieved from the into_remainder function of the iterator.

-

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the -resulting code better than in the case of chunks_mut.

-

See chunks_mut for a variant of this iterator that also returns the remainder as a -smaller chunk, and rchunks_exact_mut for the same iterator but starting at the end of -the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-for chunk in v.chunks_exact_mut(2) {
-    for elem in chunk.iter_mut() {
-        *elem += count;
-    }
-    count += 1;
-}
-assert_eq!(v, &[1, 1, 2, 2, 0]);
-

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -assuming that there’s no remainder.

-
Safety
-

This may only be called when

-
    -
  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • -
  • N != 0.
  • -
-
Examples
-
#![feature(slice_as_chunks)]
-let slice: &[char] = &['l', 'o', 'r', 'e', 'm', '!'];
-let chunks: &[[char; 1]] =
-    // SAFETY: 1-element chunks never have remainder
-    unsafe { slice.as_chunks_unchecked() };
-assert_eq!(chunks, &[['l'], ['o'], ['r'], ['e'], ['m'], ['!']]);
-let chunks: &[[char; 3]] =
-    // SAFETY: The slice length (6) is a multiple of 3
-    unsafe { slice.as_chunks_unchecked() };
-assert_eq!(chunks, &[['l', 'o', 'r'], ['e', 'm', '!']]);
-
-// These would be unsound:
-// let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5
-// let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed
-

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -starting at the beginning of the slice, -and a remainder slice with length strictly less than N.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(slice_as_chunks)]
-let slice = ['l', 'o', 'r', 'e', 'm'];
-let (chunks, remainder) = slice.as_chunks();
-assert_eq!(chunks, &[['l', 'o'], ['r', 'e']]);
-assert_eq!(remainder, &['m']);
-

If you expect the slice to be an exact multiple, you can combine -let-else with an empty slice pattern:

- -
#![feature(slice_as_chunks)]
-let slice = ['R', 'u', 's', 't'];
-let (chunks, []) = slice.as_chunks::<2>() else {
-    panic!("slice didn't have even length")
-};
-assert_eq!(chunks, &[['R', 'u'], ['s', 't']]);
-

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -starting at the end of the slice, -and a remainder slice with length strictly less than N.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(slice_as_chunks)]
-let slice = ['l', 'o', 'r', 'e', 'm'];
-let (remainder, chunks) = slice.as_rchunks();
-assert_eq!(remainder, &['l']);
-assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]);
-

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are array references and do not overlap. If N does not divide the -length of the slice, then the last up to N-1 elements will be omitted and can be -retrieved from the remainder function of the iterator.

-

This method is the const generic equivalent of chunks_exact.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(array_chunks)]
-let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.array_chunks();
-assert_eq!(iter.next().unwrap(), &['l', 'o']);
-assert_eq!(iter.next().unwrap(), &['r', 'e']);
-assert!(iter.next().is_none());
-assert_eq!(iter.remainder(), &['m']);
-

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( - &mut self -) -> &mut [[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -assuming that there’s no remainder.

-
Safety
-

This may only be called when

-
    -
  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • -
  • N != 0.
  • -
-
Examples
-
#![feature(slice_as_chunks)]
-let slice: &mut [char] = &mut ['l', 'o', 'r', 'e', 'm', '!'];
-let chunks: &mut [[char; 1]] =
-    // SAFETY: 1-element chunks never have remainder
-    unsafe { slice.as_chunks_unchecked_mut() };
-chunks[0] = ['L'];
-assert_eq!(chunks, &[['L'], ['o'], ['r'], ['e'], ['m'], ['!']]);
-let chunks: &mut [[char; 3]] =
-    // SAFETY: The slice length (6) is a multiple of 3
-    unsafe { slice.as_chunks_unchecked_mut() };
-chunks[1] = ['a', 'x', '?'];
-assert_eq!(slice, &['L', 'o', 'r', 'a', 'x', '?']);
-
-// These would be unsound:
-// let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut() // The slice length is not a multiple of 5
-// let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed
-

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -starting at the beginning of the slice, -and a remainder slice with length strictly less than N.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(slice_as_chunks)]
-let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-let (chunks, remainder) = v.as_chunks_mut();
-remainder[0] = 9;
-for chunk in chunks {
-    *chunk = [count; 2];
-    count += 1;
-}
-assert_eq!(v, &[1, 1, 2, 2, 9]);
-

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, -starting at the end of the slice, -and a remainder slice with length strictly less than N.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(slice_as_chunks)]
-let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-let (remainder, chunks) = v.as_rchunks_mut();
-remainder[0] = 9;
-for chunk in chunks {
-    *chunk = [count; 2];
-    count += 1;
-}
-assert_eq!(v, &[9, 1, 1, 2, 2]);
-

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the -beginning of the slice.

-

The chunks are mutable array references and do not overlap. If N does not divide -the length of the slice, then the last up to N-1 elements will be omitted and -can be retrieved from the into_remainder function of the iterator.

-

This method is the const generic equivalent of chunks_exact_mut.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(array_chunks)]
-let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-for chunk in v.array_chunks_mut() {
-    *chunk = [count; 2];
-    count += 1;
-}
-assert_eq!(v, &[1, 1, 2, 2, 0]);
-

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, -starting at the beginning of the slice.

-

This is the const generic equivalent of windows.

-

If N is greater than the size of the slice, it will return no windows.

-
Panics
-

Panics if N is 0. This check will most probably get changed to a compile time -error before this method gets stabilized.

-
Examples
-
#![feature(array_windows)]
-let slice = [0, 1, 2, 3];
-let mut iter = slice.array_windows();
-assert_eq!(iter.next().unwrap(), &[0, 1]);
-assert_eq!(iter.next().unwrap(), &[1, 2]);
-assert_eq!(iter.next().unwrap(), &[2, 3]);
-assert!(iter.next().is_none());
-
1.31.0

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end -of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last chunk will not have length chunk_size.

-

See rchunks_exact for a variant of this iterator that returns chunks of always exactly -chunk_size elements, and chunks for the same iterator but starting at the beginning -of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.rchunks(2);
-assert_eq!(iter.next().unwrap(), &['e', 'm']);
-assert_eq!(iter.next().unwrap(), &['o', 'r']);
-assert_eq!(iter.next().unwrap(), &['l']);
-assert!(iter.next().is_none());
-
1.31.0

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end -of the slice.

-

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the -length of the slice, then the last chunk will not have length chunk_size.

-

See rchunks_exact_mut for a variant of this iterator that returns chunks of always -exactly chunk_size elements, and chunks_mut for the same iterator but starting at the -beginning of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-for chunk in v.rchunks_mut(2) {
-    for elem in chunk.iter_mut() {
-        *elem += count;
-    }
-    count += 1;
-}
-assert_eq!(v, &[3, 2, 2, 1, 1]);
-
1.31.0

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the -end of the slice.

-

The chunks are slices and do not overlap. If chunk_size does not divide the length of the -slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved -from the remainder function of the iterator.

-

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the -resulting code better than in the case of rchunks.

-

See rchunks for a variant of this iterator that also returns the remainder as a smaller -chunk, and chunks_exact for the same iterator but starting at the beginning of the -slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let slice = ['l', 'o', 'r', 'e', 'm'];
-let mut iter = slice.rchunks_exact(2);
-assert_eq!(iter.next().unwrap(), &['e', 'm']);
-assert_eq!(iter.next().unwrap(), &['o', 'r']);
-assert!(iter.next().is_none());
-assert_eq!(iter.remainder(), &['l']);
-
1.31.0

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end -of the slice.

-

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the -length of the slice, then the last up to chunk_size-1 elements will be omitted and can be -retrieved from the into_remainder function of the iterator.

-

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the -resulting code better than in the case of chunks_mut.

-

See rchunks_mut for a variant of this iterator that also returns the remainder as a -smaller chunk, and chunks_exact_mut for the same iterator but starting at the beginning -of the slice.

-
Panics
-

Panics if chunk_size is 0.

-
Examples
-
let v = &mut [0, 0, 0, 0, 0];
-let mut count = 1;
-
-for chunk in v.rchunks_exact_mut(2) {
-    for elem in chunk.iter_mut() {
-        *elem += count;
-    }
-    count += 1;
-}
-assert_eq!(v, &[0, 2, 2, 1, 1]);
-

pub fn group_by<F>(&self, pred: F) -> GroupBy<'_, T, F>where - F: FnMut(&T, &T) -> bool,

🔬This is a nightly-only experimental API. (slice_group_by)

Returns an iterator over the slice producing non-overlapping runs -of elements using the predicate to separate them.

-

The predicate is called on two elements following themselves, -it means the predicate is called on slice[0] and slice[1] -then on slice[1] and slice[2] and so on.

-
Examples
-
#![feature(slice_group_by)]
-
-let slice = &[1, 1, 1, 3, 3, 2, 2, 2];
-
-let mut iter = slice.group_by(|a, b| a == b);
-
-assert_eq!(iter.next(), Some(&[1, 1, 1][..]));
-assert_eq!(iter.next(), Some(&[3, 3][..]));
-assert_eq!(iter.next(), Some(&[2, 2, 2][..]));
-assert_eq!(iter.next(), None);
-

This method can be used to extract the sorted subslices:

- -
#![feature(slice_group_by)]
-
-let slice = &[1, 1, 2, 3, 2, 3, 2, 3, 4];
-
-let mut iter = slice.group_by(|a, b| a <= b);
-
-assert_eq!(iter.next(), Some(&[1, 1, 2, 3][..]));
-assert_eq!(iter.next(), Some(&[2, 3][..]));
-assert_eq!(iter.next(), Some(&[2, 3, 4][..]));
-assert_eq!(iter.next(), None);
-

pub fn group_by_mut<F>(&mut self, pred: F) -> GroupByMut<'_, T, F>where - F: FnMut(&T, &T) -> bool,

🔬This is a nightly-only experimental API. (slice_group_by)

Returns an iterator over the slice producing non-overlapping mutable -runs of elements using the predicate to separate them.

-

The predicate is called on two elements following themselves, -it means the predicate is called on slice[0] and slice[1] -then on slice[1] and slice[2] and so on.

-
Examples
-
#![feature(slice_group_by)]
-
-let slice = &mut [1, 1, 1, 3, 3, 2, 2, 2];
-
-let mut iter = slice.group_by_mut(|a, b| a == b);
-
-assert_eq!(iter.next(), Some(&mut [1, 1, 1][..]));
-assert_eq!(iter.next(), Some(&mut [3, 3][..]));
-assert_eq!(iter.next(), Some(&mut [2, 2, 2][..]));
-assert_eq!(iter.next(), None);
-

This method can be used to extract the sorted subslices:

- -
#![feature(slice_group_by)]
-
-let slice = &mut [1, 1, 2, 3, 2, 3, 2, 3, 4];
-
-let mut iter = slice.group_by_mut(|a, b| a <= b);
-
-assert_eq!(iter.next(), Some(&mut [1, 1, 2, 3][..]));
-assert_eq!(iter.next(), Some(&mut [2, 3][..]));
-assert_eq!(iter.next(), Some(&mut [2, 3, 4][..]));
-assert_eq!(iter.next(), None);
-
1.0.0

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

-

The first will contain all indices from [0, mid) (excluding -the index mid itself) and the second will contain all -indices from [mid, len) (excluding the index len itself).

-
Panics
-

Panics if mid > len.

-
Examples
-
let v = [1, 2, 3, 4, 5, 6];
-
-{
-   let (left, right) = v.split_at(0);
-   assert_eq!(left, []);
-   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_at(2);
-    assert_eq!(left, [1, 2]);
-    assert_eq!(right, [3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_at(6);
-    assert_eq!(left, [1, 2, 3, 4, 5, 6]);
-    assert_eq!(right, []);
-}
-
1.0.0

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

-

The first will contain all indices from [0, mid) (excluding -the index mid itself) and the second will contain all -indices from [mid, len) (excluding the index len itself).

-
Panics
-

Panics if mid > len.

-
Examples
-
let mut v = [1, 0, 3, 0, 5, 6];
-let (left, right) = v.split_at_mut(2);
-assert_eq!(left, [1, 0]);
-assert_eq!(right, [3, 0, 5, 6]);
-left[1] = 2;
-right[1] = 4;
-assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

🔬This is a nightly-only experimental API. (slice_split_at_unchecked)

Divides one slice into two at an index, without doing bounds checking.

-

The first will contain all indices from [0, mid) (excluding -the index mid itself) and the second will contain all -indices from [mid, len) (excluding the index len itself).

-

For a safe alternative see split_at.

-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior -even if the resulting reference is not used. The caller has to ensure that -0 <= mid <= self.len().

-
Examples
-
#![feature(slice_split_at_unchecked)]
-
-let v = [1, 2, 3, 4, 5, 6];
-
-unsafe {
-   let (left, right) = v.split_at_unchecked(0);
-   assert_eq!(left, []);
-   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
-}
-
-unsafe {
-    let (left, right) = v.split_at_unchecked(2);
-    assert_eq!(left, [1, 2]);
-    assert_eq!(right, [3, 4, 5, 6]);
-}
-
-unsafe {
-    let (left, right) = v.split_at_unchecked(6);
-    assert_eq!(left, [1, 2, 3, 4, 5, 6]);
-    assert_eq!(right, []);
-}
-

pub unsafe fn split_at_mut_unchecked( - &mut self, - mid: usize -) -> (&mut [T], &mut [T])

🔬This is a nightly-only experimental API. (slice_split_at_unchecked)

Divides one mutable slice into two at an index, without doing bounds checking.

-

The first will contain all indices from [0, mid) (excluding -the index mid itself) and the second will contain all -indices from [mid, len) (excluding the index len itself).

-

For a safe alternative see split_at_mut.

-
Safety
-

Calling this method with an out-of-bounds index is undefined behavior -even if the resulting reference is not used. The caller has to ensure that -0 <= mid <= self.len().

-
Examples
-
#![feature(slice_split_at_unchecked)]
-
-let mut v = [1, 0, 3, 0, 5, 6];
-// scoped to restrict the lifetime of the borrows
-unsafe {
-    let (left, right) = v.split_at_mut_unchecked(2);
-    assert_eq!(left, [1, 0]);
-    assert_eq!(right, [3, 0, 5, 6]);
-    left[1] = 2;
-    right[1] = 4;
-}
-assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-

pub fn split_array_ref<const N: usize>(&self) -> (&[T; N], &[T])

🔬This is a nightly-only experimental API. (split_array)

Divides one slice into an array and a remainder slice at an index.

-

The array will contain all indices from [0, N) (excluding -the index N itself) and the slice will contain all -indices from [N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let v = &[1, 2, 3, 4, 5, 6][..];
-
-{
-   let (left, right) = v.split_array_ref::<0>();
-   assert_eq!(left, &[]);
-   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_array_ref::<2>();
-    assert_eq!(left, &[1, 2]);
-    assert_eq!(right, [3, 4, 5, 6]);
-}
-
-{
-    let (left, right) = v.split_array_ref::<6>();
-    assert_eq!(left, &[1, 2, 3, 4, 5, 6]);
-    assert_eq!(right, []);
-}
-

pub fn split_array_mut<const N: usize>(&mut self) -> (&mut [T; N], &mut [T])

🔬This is a nightly-only experimental API. (split_array)

Divides one mutable slice into an array and a remainder slice at an index.

-

The array will contain all indices from [0, N) (excluding -the index N itself) and the slice will contain all -indices from [N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let mut v = &mut [1, 0, 3, 0, 5, 6][..];
-let (left, right) = v.split_array_mut::<2>();
-assert_eq!(left, &mut [1, 0]);
-assert_eq!(right, [3, 0, 5, 6]);
-left[1] = 2;
-right[1] = 4;
-assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-

pub fn rsplit_array_ref<const N: usize>(&self) -> (&[T], &[T; N])

🔬This is a nightly-only experimental API. (split_array)

Divides one slice into an array and a remainder slice at an index from -the end.

-

The slice will contain all indices from [0, len - N) (excluding -the index len - N itself) and the array will contain all -indices from [len - N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let v = &[1, 2, 3, 4, 5, 6][..];
-
-{
-   let (left, right) = v.rsplit_array_ref::<0>();
-   assert_eq!(left, [1, 2, 3, 4, 5, 6]);
-   assert_eq!(right, &[]);
-}
-
-{
-    let (left, right) = v.rsplit_array_ref::<2>();
-    assert_eq!(left, [1, 2, 3, 4]);
-    assert_eq!(right, &[5, 6]);
-}
-
-{
-    let (left, right) = v.rsplit_array_ref::<6>();
-    assert_eq!(left, []);
-    assert_eq!(right, &[1, 2, 3, 4, 5, 6]);
-}
-

pub fn rsplit_array_mut<const N: usize>(&mut self) -> (&mut [T], &mut [T; N])

🔬This is a nightly-only experimental API. (split_array)

Divides one mutable slice into an array and a remainder slice at an -index from the end.

-

The slice will contain all indices from [0, len - N) (excluding -the index N itself) and the array will contain all -indices from [len - N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let mut v = &mut [1, 0, 3, 0, 5, 6][..];
-let (left, right) = v.rsplit_array_mut::<4>();
-assert_eq!(left, [1, 0]);
-assert_eq!(right, &mut [3, 0, 5, 6]);
-left[1] = 2;
-right[1] = 4;
-assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
1.0.0

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred. The matched element is not contained in the subslices.

-
Examples
-
let slice = [10, 40, 33, 20];
-let mut iter = slice.split(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10, 40]);
-assert_eq!(iter.next().unwrap(), &[20]);
-assert!(iter.next().is_none());
-

If the first element is matched, an empty slice will be the first item -returned by the iterator. Similarly, if the last element in the slice -is matched, an empty slice will be the last item returned by the -iterator:

- -
let slice = [10, 40, 33];
-let mut iter = slice.split(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10, 40]);
-assert_eq!(iter.next().unwrap(), &[]);
-assert!(iter.next().is_none());
-

If two matched elements are directly adjacent, an empty slice will be -present between them:

- -
let slice = [10, 6, 33, 20];
-let mut iter = slice.split(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10]);
-assert_eq!(iter.next().unwrap(), &[]);
-assert_eq!(iter.next().unwrap(), &[20]);
-assert!(iter.next().is_none());
-
1.0.0

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that -match pred. The matched element is not contained in the subslices.

-
Examples
-
let mut v = [10, 40, 30, 20, 60, 50];
-
-for group in v.split_mut(|num| *num % 3 == 0) {
-    group[0] = 1;
-}
-assert_eq!(v, [1, 40, 30, 1, 60, 1]);
-
1.51.0

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred. The matched element is contained in the end of the previous -subslice as a terminator.

-
Examples
-
let slice = [10, 40, 33, 20];
-let mut iter = slice.split_inclusive(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[10, 40, 33]);
-assert_eq!(iter.next().unwrap(), &[20]);
-assert!(iter.next().is_none());
-

If the last element of the slice is matched, -that element will be considered the terminator of the preceding slice. -That slice will be the last item returned by the iterator.

- -
let slice = [3, 10, 40, 33];
-let mut iter = slice.split_inclusive(|num| num % 3 == 0);
-
-assert_eq!(iter.next().unwrap(), &[3]);
-assert_eq!(iter.next().unwrap(), &[10, 40, 33]);
-assert!(iter.next().is_none());
-
1.51.0

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that -match pred. The matched element is contained in the previous -subslice as a terminator.

-
Examples
-
let mut v = [10, 40, 30, 20, 60, 50];
-
-for group in v.split_inclusive_mut(|num| *num % 3 == 0) {
-    let terminator_idx = group.len()-1;
-    group[terminator_idx] = 1;
-}
-assert_eq!(v, [10, 40, 1, 20, 1, 1]);
-
1.27.0

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred, starting at the end of the slice and working backwards. -The matched element is not contained in the subslices.

-
Examples
-
let slice = [11, 22, 33, 0, 44, 55];
-let mut iter = slice.rsplit(|num| *num == 0);
-
-assert_eq!(iter.next().unwrap(), &[44, 55]);
-assert_eq!(iter.next().unwrap(), &[11, 22, 33]);
-assert_eq!(iter.next(), None);
-

As with split(), if the first or last element is matched, an empty -slice will be the first (or last) item returned by the iterator.

- -
let v = &[0, 1, 1, 2, 3, 5, 8];
-let mut it = v.rsplit(|n| *n % 2 == 0);
-assert_eq!(it.next().unwrap(), &[]);
-assert_eq!(it.next().unwrap(), &[3, 5]);
-assert_eq!(it.next().unwrap(), &[1, 1]);
-assert_eq!(it.next().unwrap(), &[]);
-assert_eq!(it.next(), None);
-
1.27.0

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that -match pred, starting at the end of the slice and working -backwards. The matched element is not contained in the subslices.

-
Examples
-
let mut v = [100, 400, 300, 200, 600, 500];
-
-let mut count = 0;
-for group in v.rsplit_mut(|num| *num % 3 == 0) {
-    count += 1;
-    group[0] = count;
-}
-assert_eq!(v, [3, 400, 300, 2, 600, 1]);
-
1.0.0

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred, limited to returning at most n items. The matched element is -not contained in the subslices.

-

The last element returned, if any, will contain the remainder of the -slice.

-
Examples
-

Print the slice split once by numbers divisible by 3 (i.e., [10, 40], -[20, 60, 50]):

- -
let v = [10, 40, 30, 20, 60, 50];
-
-for group in v.splitn(2, |num| *num % 3 == 0) {
-    println!("{group:?}");
-}
-
1.0.0

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match -pred, limited to returning at most n items. The matched element is -not contained in the subslices.

-

The last element returned, if any, will contain the remainder of the -slice.

-
Examples
-
let mut v = [10, 40, 30, 20, 60, 50];
-
-for group in v.splitn_mut(2, |num| *num % 3 == 0) {
-    group[0] = 1;
-}
-assert_eq!(v, [1, 40, 30, 1, 60, 50]);
-
1.0.0

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred limited to returning at most n items. This starts at the end of -the slice and works backwards. The matched element is not contained in -the subslices.

-

The last element returned, if any, will contain the remainder of the -slice.

-
Examples
-

Print the slice split once, starting from the end, by numbers divisible -by 3 (i.e., [50], [10, 40, 30, 20]):

- -
let v = [10, 40, 30, 20, 60, 50];
-
-for group in v.rsplitn(2, |num| *num % 3 == 0) {
-    println!("{group:?}");
-}
-
1.0.0

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>where - F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match -pred limited to returning at most n items. This starts at the end of -the slice and works backwards. The matched element is not contained in -the subslices.

-

The last element returned, if any, will contain the remainder of the -slice.

-
Examples
-
let mut s = [10, 40, 30, 20, 60, 50];
-
-for group in s.rsplitn_mut(2, |num| *num % 3 == 0) {
-    group[0] = 1;
-}
-assert_eq!(s, [1, 40, 30, 20, 60, 1]);
-
1.0.0

pub fn contains(&self, x: &T) -> boolwhere - T: PartialEq<T>,

Returns true if the slice contains an element with the given value.

-

This operation is O(n).

-

Note that if you have a sorted slice, binary_search may be faster.

-
Examples
-
let v = [10, 40, 30];
-assert!(v.contains(&30));
-assert!(!v.contains(&50));
-

If you do not have a &T, but some other value that you can compare -with one (for example, String implements PartialEq<str>), you can -use iter().any:

- -
let v = [String::from("hello"), String::from("world")]; // slice of `String`
-assert!(v.iter().any(|e| e == "hello")); // search with `&str`
-assert!(!v.iter().any(|e| e == "hi"));
-
1.0.0

pub fn starts_with(&self, needle: &[T]) -> boolwhere - T: PartialEq<T>,

Returns true if needle is a prefix of the slice.

-
Examples
-
let v = [10, 40, 30];
-assert!(v.starts_with(&[10]));
-assert!(v.starts_with(&[10, 40]));
-assert!(!v.starts_with(&[50]));
-assert!(!v.starts_with(&[10, 50]));
-

Always returns true if needle is an empty slice:

- -
let v = &[10, 40, 30];
-assert!(v.starts_with(&[]));
-let v: &[u8] = &[];
-assert!(v.starts_with(&[]));
-
1.0.0

pub fn ends_with(&self, needle: &[T]) -> boolwhere - T: PartialEq<T>,

Returns true if needle is a suffix of the slice.

-
Examples
-
let v = [10, 40, 30];
-assert!(v.ends_with(&[30]));
-assert!(v.ends_with(&[40, 30]));
-assert!(!v.ends_with(&[50]));
-assert!(!v.ends_with(&[50, 30]));
-

Always returns true if needle is an empty slice:

- -
let v = &[10, 40, 30];
-assert!(v.ends_with(&[]));
-let v: &[u8] = &[];
-assert!(v.ends_with(&[]));
-
1.51.0

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>where - P: SlicePattern<Item = T> + ?Sized, - T: PartialEq<T>,

Returns a subslice with the prefix removed.

-

If the slice starts with prefix, returns the subslice after the prefix, wrapped in Some. -If prefix is empty, simply returns the original slice.

-

If the slice does not start with prefix, returns None.

-
Examples
-
let v = &[10, 40, 30];
-assert_eq!(v.strip_prefix(&[10]), Some(&[40, 30][..]));
-assert_eq!(v.strip_prefix(&[10, 40]), Some(&[30][..]));
-assert_eq!(v.strip_prefix(&[50]), None);
-assert_eq!(v.strip_prefix(&[10, 50]), None);
-
-let prefix : &str = "he";
-assert_eq!(b"hello".strip_prefix(prefix.as_bytes()),
-           Some(b"llo".as_ref()));
-
1.51.0

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>where - P: SlicePattern<Item = T> + ?Sized, - T: PartialEq<T>,

Returns a subslice with the suffix removed.

-

If the slice ends with suffix, returns the subslice before the suffix, wrapped in Some. -If suffix is empty, simply returns the original slice.

-

If the slice does not end with suffix, returns None.

-
Examples
-
let v = &[10, 40, 30];
-assert_eq!(v.strip_suffix(&[30]), Some(&[10, 40][..]));
-assert_eq!(v.strip_suffix(&[40, 30]), Some(&[10][..]));
-assert_eq!(v.strip_suffix(&[50]), None);
-assert_eq!(v.strip_suffix(&[50, 30]), None);
-

Binary searches this slice for a given element. -If the slice is not sorted, the returned result is unspecified and -meaningless.

-

If the value is found then [Result::Ok] is returned, containing the -index of the matching element. If there are multiple matches, then any -one of the matches could be returned. The index is chosen -deterministically, but is subject to change in future versions of Rust. -If the value is not found then [Result::Err] is returned, containing -the index where a matching element could be inserted while maintaining -sorted order.

-

See also binary_search_by, binary_search_by_key, and partition_point.

-
Examples
-

Looks up a series of four elements. The first is found, with a -uniquely determined position; the second and third are not -found; the fourth could match any position in [1, 4].

- -
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-
-assert_eq!(s.binary_search(&13),  Ok(9));
-assert_eq!(s.binary_search(&4),   Err(7));
-assert_eq!(s.binary_search(&100), Err(13));
-let r = s.binary_search(&1);
-assert!(match r { Ok(1..=4) => true, _ => false, });
-

If you want to find that whole range of matching items, rather than -an arbitrary matching one, that can be done using partition_point:

- -
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-
-let low = s.partition_point(|x| x < &1);
-assert_eq!(low, 1);
-let high = s.partition_point(|x| x <= &1);
-assert_eq!(high, 5);
-let r = s.binary_search(&1);
-assert!((low..high).contains(&r.unwrap()));
-
-assert!(s[..low].iter().all(|&x| x < 1));
-assert!(s[low..high].iter().all(|&x| x == 1));
-assert!(s[high..].iter().all(|&x| x > 1));
-
-// For something not found, the "range" of equal items is empty
-assert_eq!(s.partition_point(|x| x < &11), 9);
-assert_eq!(s.partition_point(|x| x <= &11), 9);
-assert_eq!(s.binary_search(&11), Err(9));
-

If you want to insert an item to a sorted vector, while maintaining -sort order, consider using partition_point:

- -
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-let num = 42;
-let idx = s.partition_point(|&x| x < num);
-// The above is equivalent to `let idx = s.binary_search(&num).unwrap_or_else(|x| x);`
-s.insert(idx, num);
-assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
1.0.0

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>where - F: FnMut(&'a T) -> Ordering,

Binary searches this slice with a comparator function.

-

The comparator function should return an order code that indicates -whether its argument is Less, Equal or Greater the desired -target. -If the slice is not sorted or if the comparator function does not -implement an order consistent with the sort order of the underlying -slice, the returned result is unspecified and meaningless.

-

If the value is found then [Result::Ok] is returned, containing the -index of the matching element. If there are multiple matches, then any -one of the matches could be returned. The index is chosen -deterministically, but is subject to change in future versions of Rust. -If the value is not found then [Result::Err] is returned, containing -the index where a matching element could be inserted while maintaining -sorted order.

-

See also binary_search, binary_search_by_key, and partition_point.

-
Examples
-

Looks up a series of four elements. The first is found, with a -uniquely determined position; the second and third are not -found; the fourth could match any position in [1, 4].

- -
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-
-let seek = 13;
-assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Ok(9));
-let seek = 4;
-assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(7));
-let seek = 100;
-assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(13));
-let seek = 1;
-let r = s.binary_search_by(|probe| probe.cmp(&seek));
-assert!(match r { Ok(1..=4) => true, _ => false, });
-
1.10.0

pub fn binary_search_by_key<'a, B, F>( - &'a self, - b: &B, - f: F -) -> Result<usize, usize>where - F: FnMut(&'a T) -> B, - B: Ord,

Binary searches this slice with a key extraction function.

-

Assumes that the slice is sorted by the key, for instance with -sort_by_key using the same key extraction function. -If the slice is not sorted by the key, the returned result is -unspecified and meaningless.

-

If the value is found then [Result::Ok] is returned, containing the -index of the matching element. If there are multiple matches, then any -one of the matches could be returned. The index is chosen -deterministically, but is subject to change in future versions of Rust. -If the value is not found then [Result::Err] is returned, containing -the index where a matching element could be inserted while maintaining -sorted order.

-

See also binary_search, binary_search_by, and partition_point.

-
Examples
-

Looks up a series of four elements in a slice of pairs sorted by -their second elements. The first is found, with a uniquely -determined position; the second and third are not found; the -fourth could match any position in [1, 4].

- -
let s = [(0, 0), (2, 1), (4, 1), (5, 1), (3, 1),
-         (1, 2), (2, 3), (4, 5), (5, 8), (3, 13),
-         (1, 21), (2, 34), (4, 55)];
-
-assert_eq!(s.binary_search_by_key(&13, |&(a, b)| b),  Ok(9));
-assert_eq!(s.binary_search_by_key(&4, |&(a, b)| b),   Err(7));
-assert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13));
-let r = s.binary_search_by_key(&1, |&(a, b)| b);
-assert!(match r { Ok(1..=4) => true, _ => false, });
-
1.20.0

pub fn sort_unstable(&mut self)where - T: Ord,

Sorts the slice, but might not preserve the order of equal elements.

-

This sort is unstable (i.e., may reorder equal elements), in-place -(i.e., does not allocate), and O(n * log(n)) worst-case.

-
Current implementation
-

The current algorithm is based on pattern-defeating quicksort by Orson Peters, -which combines the fast average case of randomized quicksort with the fast worst case of -heapsort, while achieving linear time on slices with certain patterns. It uses some -randomization to avoid degenerate cases, but with a fixed seed to always provide -deterministic behavior.

-

It is typically faster than stable sorting, except in a few special cases, e.g., when the -slice consists of several concatenated sorted sequences.

-
Examples
-
let mut v = [-5, 4, 1, -3, 2];
-
-v.sort_unstable();
-assert!(v == [-5, -3, 1, 2, 4]);
-
1.20.0

pub fn sort_unstable_by<F>(&mut self, compare: F)where - F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparator function, but might not preserve the order of equal -elements.

-

This sort is unstable (i.e., may reorder equal elements), in-place -(i.e., does not allocate), and O(n * log(n)) worst-case.

-

The comparator function must define a total ordering for the elements in the slice. If -the ordering is not total, the order of the elements is unspecified. An order is a -total order if it is (for all a, b and c):

-
    -
  • total and antisymmetric: exactly one of a < b, a == b or a > b is true, and
  • -
  • transitive, a < b and b < c implies a < c. The same must hold for both == and >.
  • -
-

For example, while [f64] doesn’t implement [Ord] because NaN != NaN, we can use -partial_cmp as our sort function when we know the slice doesn’t contain a NaN.

- -
let mut floats = [5f64, 4.0, 1.0, 3.0, 2.0];
-floats.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());
-assert_eq!(floats, [1.0, 2.0, 3.0, 4.0, 5.0]);
-
Current implementation
-

The current algorithm is based on pattern-defeating quicksort by Orson Peters, -which combines the fast average case of randomized quicksort with the fast worst case of -heapsort, while achieving linear time on slices with certain patterns. It uses some -randomization to avoid degenerate cases, but with a fixed seed to always provide -deterministic behavior.

-

It is typically faster than stable sorting, except in a few special cases, e.g., when the -slice consists of several concatenated sorted sequences.

-
Examples
-
let mut v = [5, 4, 1, 3, 2];
-v.sort_unstable_by(|a, b| a.cmp(b));
-assert!(v == [1, 2, 3, 4, 5]);
-
-// reverse sorting
-v.sort_unstable_by(|a, b| b.cmp(a));
-assert!(v == [5, 4, 3, 2, 1]);
-
1.20.0

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)where - F: FnMut(&T) -> K, - K: Ord,

Sorts the slice with a key extraction function, but might not preserve the order of equal -elements.

-

This sort is unstable (i.e., may reorder equal elements), in-place -(i.e., does not allocate), and O(m * n * log(n)) worst-case, where the key function is -O(m).

-
Current implementation
-

The current algorithm is based on pattern-defeating quicksort by Orson Peters, -which combines the fast average case of randomized quicksort with the fast worst case of -heapsort, while achieving linear time on slices with certain patterns. It uses some -randomization to avoid degenerate cases, but with a fixed seed to always provide -deterministic behavior.

-

Due to its key calling strategy, sort_unstable_by_key -is likely to be slower than sort_by_cached_key in -cases where the key function is expensive.

-
Examples
-
let mut v = [-5i32, 4, 1, -3, 2];
-
-v.sort_unstable_by_key(|k| k.abs());
-assert!(v == [1, 2, -3, 4, -5]);
-
1.49.0

pub fn select_nth_unstable( - &mut self, - index: usize -) -> (&mut [T], &mut T, &mut [T])where - T: Ord,

Reorder the slice such that the element at index is at its final sorted position.

-

This reordering has the additional property that any value at position i < index will be -less than or equal to any value at a position j > index. Additionally, this reordering is -unstable (i.e. any number of equal elements may end up at position index), in-place -(i.e. does not allocate), and runs in O(n) time. -This function is also known as “kth element” in other libraries.

-

It returns a triplet of the following from the reordered slice: -the subslice prior to index, the element at index, and the subslice after index; -accordingly, the values in those two subslices will respectively all be less-than-or-equal-to -and greater-than-or-equal-to the value of the element at index.

-
Current implementation
-

The current algorithm is an introselect implementation based on Pattern Defeating Quicksort, which is also -the basis for sort_unstable. The fallback algorithm is Median of Medians using Tukey’s Ninther for -pivot selection, which guarantees linear runtime for all inputs.

-
Panics
-

Panics when index >= len(), meaning it always panics on empty slices.

-
Examples
-
let mut v = [-5i32, 4, 1, -3, 2];
-
-// Find the median
-v.select_nth_unstable(2);
-
-// We are only guaranteed the slice will be one of the following, based on the way we sort
-// about the specified index.
-assert!(v == [-3, -5, 1, 2, 4] ||
-        v == [-5, -3, 1, 2, 4] ||
-        v == [-3, -5, 1, 4, 2] ||
-        v == [-5, -3, 1, 4, 2]);
-
1.49.0

pub fn select_nth_unstable_by<F>( - &mut self, - index: usize, - compare: F -) -> (&mut [T], &mut T, &mut [T])where - F: FnMut(&T, &T) -> Ordering,

Reorder the slice with a comparator function such that the element at index is at its -final sorted position.

-

This reordering has the additional property that any value at position i < index will be -less than or equal to any value at a position j > index using the comparator function. -Additionally, this reordering is unstable (i.e. any number of equal elements may end up at -position index), in-place (i.e. does not allocate), and runs in O(n) time. -This function is also known as “kth element” in other libraries.

-

It returns a triplet of the following from -the slice reordered according to the provided comparator function: the subslice prior to -index, the element at index, and the subslice after index; accordingly, the values in -those two subslices will respectively all be less-than-or-equal-to and greater-than-or-equal-to -the value of the element at index.

-
Current implementation
-

The current algorithm is an introselect implementation based on Pattern Defeating Quicksort, which is also -the basis for sort_unstable. The fallback algorithm is Median of Medians using Tukey’s Ninther for -pivot selection, which guarantees linear runtime for all inputs.

-
Panics
-

Panics when index >= len(), meaning it always panics on empty slices.

-
Examples
-
let mut v = [-5i32, 4, 1, -3, 2];
-
-// Find the median as if the slice were sorted in descending order.
-v.select_nth_unstable_by(2, |a, b| b.cmp(a));
-
-// We are only guaranteed the slice will be one of the following, based on the way we sort
-// about the specified index.
-assert!(v == [2, 4, 1, -5, -3] ||
-        v == [2, 4, 1, -3, -5] ||
-        v == [4, 2, 1, -5, -3] ||
-        v == [4, 2, 1, -3, -5]);
-
1.49.0

pub fn select_nth_unstable_by_key<K, F>( - &mut self, - index: usize, - f: F -) -> (&mut [T], &mut T, &mut [T])where - F: FnMut(&T) -> K, - K: Ord,

Reorder the slice with a key extraction function such that the element at index is at its -final sorted position.

-

This reordering has the additional property that any value at position i < index will be -less than or equal to any value at a position j > index using the key extraction function. -Additionally, this reordering is unstable (i.e. any number of equal elements may end up at -position index), in-place (i.e. does not allocate), and runs in O(n) time. -This function is also known as “kth element” in other libraries.

-

It returns a triplet of the following from -the slice reordered according to the provided key extraction function: the subslice prior to -index, the element at index, and the subslice after index; accordingly, the values in -those two subslices will respectively all be less-than-or-equal-to and greater-than-or-equal-to -the value of the element at index.

-
Current implementation
-

The current algorithm is an introselect implementation based on Pattern Defeating Quicksort, which is also -the basis for sort_unstable. The fallback algorithm is Median of Medians using Tukey’s Ninther for -pivot selection, which guarantees linear runtime for all inputs.

-
Panics
-

Panics when index >= len(), meaning it always panics on empty slices.

-
Examples
-
let mut v = [-5i32, 4, 1, -3, 2];
-
-// Return the median as if the array were sorted according to absolute value.
-v.select_nth_unstable_by_key(2, |a| a.abs());
-
-// We are only guaranteed the slice will be one of the following, based on the way we sort
-// about the specified index.
-assert!(v == [1, 2, -3, 4, -5] ||
-        v == [1, 2, -3, -5, 4] ||
-        v == [2, 1, -3, 4, -5] ||
-        v == [2, 1, -3, -5, 4]);
-

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])where - T: PartialEq<T>,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all consecutive repeated elements to the end of the slice according to the -[PartialEq] trait implementation.

-

Returns two slices. The first contains no consecutive repeated elements. -The second contains all the duplicates in no specified order.

-

If the slice is sorted, the first returned slice contains no duplicates.

-
Examples
-
#![feature(slice_partition_dedup)]
-
-let mut slice = [1, 2, 2, 3, 3, 2, 1, 1];
-
-let (dedup, duplicates) = slice.partition_dedup();
-
-assert_eq!(dedup, [1, 2, 3, 2, 1]);
-assert_eq!(duplicates, [2, 3, 1]);
-

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])where - F: FnMut(&mut T, &mut T) -> bool,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice satisfying -a given equality relation.

-

Returns two slices. The first contains no consecutive repeated elements. -The second contains all the duplicates in no specified order.

-

The same_bucket function is passed references to two elements from the slice and -must determine if the elements compare equal. The elements are passed in opposite order -from their order in the slice, so if same_bucket(a, b) returns true, a is moved -at the end of the slice.

-

If the slice is sorted, the first returned slice contains no duplicates.

-
Examples
-
#![feature(slice_partition_dedup)]
-
-let mut slice = ["foo", "Foo", "BAZ", "Bar", "bar", "baz", "BAZ"];
-
-let (dedup, duplicates) = slice.partition_dedup_by(|a, b| a.eq_ignore_ascii_case(b));
-
-assert_eq!(dedup, ["foo", "BAZ", "Bar", "baz"]);
-assert_eq!(duplicates, ["bar", "Foo", "BAZ"]);
-

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])where - F: FnMut(&mut T) -> K, - K: PartialEq<K>,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice that resolve -to the same key.

-

Returns two slices. The first contains no consecutive repeated elements. -The second contains all the duplicates in no specified order.

-

If the slice is sorted, the first returned slice contains no duplicates.

-
Examples
-
#![feature(slice_partition_dedup)]
-
-let mut slice = [10, 20, 21, 30, 30, 20, 11, 13];
-
-let (dedup, duplicates) = slice.partition_dedup_by_key(|i| *i / 10);
-
-assert_eq!(dedup, [10, 20, 30, 20, 11]);
-assert_eq!(duplicates, [21, 30, 13]);
-
1.26.0

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the -slice move to the end while the last self.len() - mid elements move to -the front. After calling rotate_left, the element previously at index -mid will become the first element in the slice.

-
Panics
-

This function will panic if mid is greater than the length of the -slice. Note that mid == self.len() does not panic and is a no-op -rotation.

-
Complexity
-

Takes linear (in self.len()) time.

-
Examples
-
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
-a.rotate_left(2);
-assert_eq!(a, ['c', 'd', 'e', 'f', 'a', 'b']);
-

Rotating a subslice:

- -
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
-a[1..5].rotate_left(1);
-assert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']);
-
1.26.0

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k -elements of the slice move to the end while the last k elements move -to the front. After calling rotate_right, the element previously at -index self.len() - k will become the first element in the slice.

-
Panics
-

This function will panic if k is greater than the length of the -slice. Note that k == self.len() does not panic and is a no-op -rotation.

-
Complexity
-

Takes linear (in self.len()) time.

-
Examples
-
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
-a.rotate_right(2);
-assert_eq!(a, ['e', 'f', 'a', 'b', 'c', 'd']);
-

Rotate a subslice:

- -
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
-a[1..5].rotate_right(1);
-assert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']);
-
1.50.0

pub fn fill(&mut self, value: T)where - T: Clone,

Fills self with elements by cloning value.

-
Examples
-
let mut buf = vec![0; 10];
-buf.fill(1);
-assert_eq!(buf, vec![1; 10]);
-
1.51.0

pub fn fill_with<F>(&mut self, f: F)where - F: FnMut() -> T,

Fills self with elements returned by calling a closure repeatedly.

-

This method uses a closure to create new values. If you’d rather -[Clone] a given value, use fill. If you want to use the [Default] -trait to generate values, you can pass [Default::default] as the -argument.

-
Examples
-
let mut buf = vec![1; 10];
-buf.fill_with(Default::default);
-assert_eq!(buf, vec![0; 10]);
-
1.7.0

pub fn clone_from_slice(&mut self, src: &[T])where - T: Clone,

Copies the elements from src into self.

-

The length of src must be the same as self.

-
Panics
-

This function will panic if the two slices have different lengths.

-
Examples
-

Cloning two elements from a slice into another:

- -
let src = [1, 2, 3, 4];
-let mut dst = [0, 0];
-
-// Because the slices have to be the same length,
-// we slice the source slice from four elements
-// to two. It will panic if we don't do this.
-dst.clone_from_slice(&src[2..]);
-
-assert_eq!(src, [1, 2, 3, 4]);
-assert_eq!(dst, [3, 4]);
-

Rust enforces that there can only be one mutable reference with no -immutable references to a particular piece of data in a particular -scope. Because of this, attempting to use clone_from_slice on a -single slice will result in a compile failure:

- -
let mut slice = [1, 2, 3, 4, 5];
-
-slice[..2].clone_from_slice(&slice[3..]); // compile fail!
-

To work around this, we can use split_at_mut to create two distinct -sub-slices from a slice:

- -
let mut slice = [1, 2, 3, 4, 5];
-
-{
-    let (left, right) = slice.split_at_mut(2);
-    left.clone_from_slice(&right[1..]);
-}
-
-assert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.9.0

pub fn copy_from_slice(&mut self, src: &[T])where - T: Copy,

Copies all elements from src into self, using a memcpy.

-

The length of src must be the same as self.

-

If T does not implement Copy, use clone_from_slice.

-
Panics
-

This function will panic if the two slices have different lengths.

-
Examples
-

Copying two elements from a slice into another:

- -
let src = [1, 2, 3, 4];
-let mut dst = [0, 0];
-
-// Because the slices have to be the same length,
-// we slice the source slice from four elements
-// to two. It will panic if we don't do this.
-dst.copy_from_slice(&src[2..]);
-
-assert_eq!(src, [1, 2, 3, 4]);
-assert_eq!(dst, [3, 4]);
-

Rust enforces that there can only be one mutable reference with no -immutable references to a particular piece of data in a particular -scope. Because of this, attempting to use copy_from_slice on a -single slice will result in a compile failure:

- -
let mut slice = [1, 2, 3, 4, 5];
-
-slice[..2].copy_from_slice(&slice[3..]); // compile fail!
-

To work around this, we can use split_at_mut to create two distinct -sub-slices from a slice:

- -
let mut slice = [1, 2, 3, 4, 5];
-
-{
-    let (left, right) = slice.split_at_mut(2);
-    left.copy_from_slice(&right[1..]);
-}
-
-assert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.37.0

pub fn copy_within<R>(&mut self, src: R, dest: usize)where - R: RangeBounds<usize>, - T: Copy,

Copies elements from one part of the slice to another part of itself, -using a memmove.

-

src is the range within self to copy from. dest is the starting -index of the range within self to copy to, which will have the same -length as src. The two ranges may overlap. The ends of the two ranges -must be less than or equal to self.len().

-
Panics
-

This function will panic if either range exceeds the end of the slice, -or if the end of src is before the start.

-
Examples
-

Copying four bytes within a slice:

- -
let mut bytes = *b"Hello, World!";
-
-bytes.copy_within(1..5, 8);
-
-assert_eq!(&bytes, b"Hello, Wello!");
-
1.27.0

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

-

The length of other must be the same as self.

-
Panics
-

This function will panic if the two slices have different lengths.

-
Example
-

Swapping two elements across slices:

- -
let mut slice1 = [0, 0];
-let mut slice2 = [1, 2, 3, 4];
-
-slice1.swap_with_slice(&mut slice2[2..]);
-
-assert_eq!(slice1, [3, 4]);
-assert_eq!(slice2, [1, 2, 0, 0]);
-

Rust enforces that there can only be one mutable reference to a -particular piece of data in a particular scope. Because of this, -attempting to use swap_with_slice on a single slice will result in -a compile failure:

- -
let mut slice = [1, 2, 3, 4, 5];
-slice[..2].swap_with_slice(&mut slice[3..]); // compile fail!
-

To work around this, we can use split_at_mut to create two distinct -mutable sub-slices from a slice:

- -
let mut slice = [1, 2, 3, 4, 5];
-
-{
-    let (left, right) = slice.split_at_mut(2);
-    left.swap_with_slice(&mut right[1..]);
-}
-
-assert_eq!(slice, [4, 5, 3, 1, 2]);
-
1.30.0

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmute the slice to a slice of another type, ensuring alignment of the types is -maintained.

-

This method splits the slice into three distinct slices: prefix, correctly aligned middle -slice of a new type, and the suffix slice. How exactly the slice is split up is not -specified; the middle part may be smaller than necessary. However, if this fails to return a -maximal middle part, that is because code is running in a context where performance does not -matter, such as a sanitizer attempting to find alignment bugs. Regular code running -in a default (debug or release) execution will return a maximal middle part.

-

This method has no purpose when either input element T or output element U are -zero-sized and will return the original slice without splitting anything.

-
Safety
-

This method is essentially a transmute with respect to the elements in the returned -middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

-
Examples
-

Basic usage:

- -
unsafe {
-    let bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];
-    let (prefix, shorts, suffix) = bytes.align_to::<u16>();
-    // less_efficient_algorithm_for_bytes(prefix);
-    // more_efficient_algorithm_for_aligned_shorts(shorts);
-    // less_efficient_algorithm_for_bytes(suffix);
-}
-
1.30.0

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmute the mutable slice to a mutable slice of another type, ensuring alignment of the -types is maintained.

-

This method splits the slice into three distinct slices: prefix, correctly aligned middle -slice of a new type, and the suffix slice. How exactly the slice is split up is not -specified; the middle part may be smaller than necessary. However, if this fails to return a -maximal middle part, that is because code is running in a context where performance does not -matter, such as a sanitizer attempting to find alignment bugs. Regular code running -in a default (debug or release) execution will return a maximal middle part.

-

This method has no purpose when either input element T or output element U are -zero-sized and will return the original slice without splitting anything.

-
Safety
-

This method is essentially a transmute with respect to the elements in the returned -middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

-
Examples
-

Basic usage:

- -
unsafe {
-    let mut bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];
-    let (prefix, shorts, suffix) = bytes.align_to_mut::<u16>();
-    // less_efficient_algorithm_for_bytes(prefix);
-    // more_efficient_algorithm_for_aligned_shorts(shorts);
-    // less_efficient_algorithm_for_bytes(suffix);
-}
-

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])where - Simd<T, LANES>: AsRef<[T; LANES]>, - T: SimdElement, - LaneCount<LANES>: SupportedLaneCount,

🔬This is a nightly-only experimental API. (portable_simd)

Split a slice into a prefix, a middle of aligned SIMD types, and a suffix.

-

This is a safe wrapper around [slice::align_to], so has the same weak -postconditions as that method. You’re only assured that -self.len() == prefix.len() + middle.len() * LANES + suffix.len().

-

Notably, all of the following are possible:

-
    -
  • prefix.len() >= LANES.
  • -
  • middle.is_empty() despite self.len() >= 3 * LANES.
  • -
  • suffix.len() >= LANES.
  • -
-

That said, this is a safe method, so if you’re only writing safe code, -then this can at most cause incorrect logic, not unsoundness.

-
Panics
-

This will panic if the size of the SIMD type is different from -LANES times that of the scalar.

-

At the time of writing, the trait restrictions on Simd<T, LANES> keeps -that from ever happening, as only power-of-two numbers of lanes are -supported. It’s possible that, in the future, those restrictions might -be lifted in a way that would make it possible to see panics from this -method for something like LANES == 3.

-
Examples
-
#![feature(portable_simd)]
-use core::simd::SimdFloat;
-
-let short = &[1, 2, 3];
-let (prefix, middle, suffix) = short.as_simd::<4>();
-assert_eq!(middle, []); // Not enough elements for anything in the middle
-
-// They might be split in any possible way between prefix and suffix
-let it = prefix.iter().chain(suffix).copied();
-assert_eq!(it.collect::<Vec<_>>(), vec![1, 2, 3]);
-
-fn basic_simd_sum(x: &[f32]) -> f32 {
-    use std::ops::Add;
-    use std::simd::f32x4;
-    let (prefix, middle, suffix) = x.as_simd();
-    let sums = f32x4::from_array([
-        prefix.iter().copied().sum(),
-        0.0,
-        0.0,
-        suffix.iter().copied().sum(),
-    ]);
-    let sums = middle.iter().copied().fold(sums, f32x4::add);
-    sums.reduce_sum()
-}
-
-let numbers: Vec<f32> = (1..101).map(|x| x as _).collect();
-assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0);
-

pub fn as_simd_mut<const LANES: usize>( - &mut self -) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T])where - Simd<T, LANES>: AsMut<[T; LANES]>, - T: SimdElement, - LaneCount<LANES>: SupportedLaneCount,

🔬This is a nightly-only experimental API. (portable_simd)

Split a mutable slice into a mutable prefix, a middle of aligned SIMD types, -and a mutable suffix.

-

This is a safe wrapper around [slice::align_to_mut], so has the same weak -postconditions as that method. You’re only assured that -self.len() == prefix.len() + middle.len() * LANES + suffix.len().

-

Notably, all of the following are possible:

-
    -
  • prefix.len() >= LANES.
  • -
  • middle.is_empty() despite self.len() >= 3 * LANES.
  • -
  • suffix.len() >= LANES.
  • -
-

That said, this is a safe method, so if you’re only writing safe code, -then this can at most cause incorrect logic, not unsoundness.

-

This is the mutable version of [slice::as_simd]; see that for examples.

-
Panics
-

This will panic if the size of the SIMD type is different from -LANES times that of the scalar.

-

At the time of writing, the trait restrictions on Simd<T, LANES> keeps -that from ever happening, as only power-of-two numbers of lanes are -supported. It’s possible that, in the future, those restrictions might -be lifted in a way that would make it possible to see panics from this -method for something like LANES == 3.

-

pub fn is_sorted(&self) -> boolwhere - T: PartialOrd<T>,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted.

-

That is, for each element a and its following element b, a <= b must hold. If the -slice yields exactly zero or one element, true is returned.

-

Note that if Self::Item is only PartialOrd, but not Ord, the above definition -implies that this function returns false if any two consecutive items are not -comparable.

-
Examples
-
#![feature(is_sorted)]
-let empty: [i32; 0] = [];
-
-assert!([1, 2, 2, 9].is_sorted());
-assert!(![1, 3, 2, 4].is_sorted());
-assert!([0].is_sorted());
-assert!(empty.is_sorted());
-assert!(![0.0, 1.0, f32::NAN].is_sorted());
-

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> boolwhere - F: FnMut(&'a T, &'a T) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given comparator function.

-

Instead of using PartialOrd::partial_cmp, this function uses the given compare -function to determine the ordering of two elements. Apart from that, it’s equivalent to -is_sorted; see its documentation for more information.

-

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> boolwhere - F: FnMut(&'a T) -> K, - K: PartialOrd<K>,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given key extraction function.

-

Instead of comparing the slice’s elements directly, this function compares the keys of the -elements, as determined by f. Apart from that, it’s equivalent to is_sorted; see its -documentation for more information.

-
Examples
-
#![feature(is_sorted)]
-
-assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
-assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
-
1.52.0

pub fn partition_point<P>(&self, pred: P) -> usizewhere - P: FnMut(&T) -> bool,

Returns the index of the partition point according to the given predicate -(the index of the first element of the second partition).

-

The slice is assumed to be partitioned according to the given predicate. -This means that all elements for which the predicate returns true are at the start of the slice -and all elements for which the predicate returns false are at the end. -For example, [7, 15, 3, 5, 4, 12, 6] is partitioned under the predicate x % 2 != 0 -(all odd numbers are at the start, all even at the end).

-

If this slice is not partitioned, the returned result is unspecified and meaningless, -as this method performs a kind of binary search.

-

See also binary_search, binary_search_by, and binary_search_by_key.

-
Examples
-
let v = [1, 2, 3, 3, 5, 6, 7];
-let i = v.partition_point(|&x| x < 5);
-
-assert_eq!(i, 4);
-assert!(v[..i].iter().all(|&x| x < 5));
-assert!(v[i..].iter().all(|&x| !(x < 5)));
-

If all elements of the slice match the predicate, including if the slice -is empty, then the length of the slice will be returned:

- -
let a = [2, 4, 8];
-assert_eq!(a.partition_point(|x| x < &100), a.len());
-let a: [i32; 0] = [];
-assert_eq!(a.partition_point(|x| x < &100), 0);
-

If you want to insert an item to a sorted vector, while maintaining -sort order:

- -
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
-let num = 42;
-let idx = s.partition_point(|&x| x < num);
-s.insert(idx, num);
-assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-

pub fn take<R, 'a>(self: &mut &'a [T], range: R) -> Option<&'a [T]>where - R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range -and returns a reference to it.

-

Returns None and does not modify the slice if the given -range is out of bounds.

-

Note that this method only accepts one-sided ranges such as -2.. or ..6, but not 2..6.

-
Examples
-

Taking the first three elements of a slice:

- -
#![feature(slice_take)]
-
-let mut slice: &[_] = &['a', 'b', 'c', 'd'];
-let mut first_three = slice.take(..3).unwrap();
-
-assert_eq!(slice, &['d']);
-assert_eq!(first_three, &['a', 'b', 'c']);
-

Taking the last two elements of a slice:

- -
#![feature(slice_take)]
-
-let mut slice: &[_] = &['a', 'b', 'c', 'd'];
-let mut tail = slice.take(2..).unwrap();
-
-assert_eq!(slice, &['a', 'b']);
-assert_eq!(tail, &['c', 'd']);
-

Getting None when range is out of bounds:

- -
#![feature(slice_take)]
-
-let mut slice: &[_] = &['a', 'b', 'c', 'd'];
-
-assert_eq!(None, slice.take(5..));
-assert_eq!(None, slice.take(..5));
-assert_eq!(None, slice.take(..=4));
-let expected: &[char] = &['a', 'b', 'c', 'd'];
-assert_eq!(Some(expected), slice.take(..4));
-

pub fn take_mut<R, 'a>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>where - R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range -and returns a mutable reference to it.

-

Returns None and does not modify the slice if the given -range is out of bounds.

-

Note that this method only accepts one-sided ranges such as -2.. or ..6, but not 2..6.

-
Examples
-

Taking the first three elements of a slice:

- -
#![feature(slice_take)]
-
-let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
-let mut first_three = slice.take_mut(..3).unwrap();
-
-assert_eq!(slice, &mut ['d']);
-assert_eq!(first_three, &mut ['a', 'b', 'c']);
-

Taking the last two elements of a slice:

- -
#![feature(slice_take)]
-
-let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
-let mut tail = slice.take_mut(2..).unwrap();
-
-assert_eq!(slice, &mut ['a', 'b']);
-assert_eq!(tail, &mut ['c', 'd']);
-

Getting None when range is out of bounds:

- -
#![feature(slice_take)]
-
-let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
-
-assert_eq!(None, slice.take_mut(5..));
-assert_eq!(None, slice.take_mut(..5));
-assert_eq!(None, slice.take_mut(..=4));
-let expected: &mut [_] = &mut ['a', 'b', 'c', 'd'];
-assert_eq!(Some(expected), slice.take_mut(..4));
-

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference -to it.

-

Returns None if the slice is empty.

-
Examples
-
#![feature(slice_take)]
-
-let mut slice: &[_] = &['a', 'b', 'c'];
-let first = slice.take_first().unwrap();
-
-assert_eq!(slice, &['b', 'c']);
-assert_eq!(first, &'a');
-

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable -reference to it.

-

Returns None if the slice is empty.

-
Examples
-
#![feature(slice_take)]
-
-let mut slice: &mut [_] = &mut ['a', 'b', 'c'];
-let first = slice.take_first_mut().unwrap();
-*first = 'd';
-
-assert_eq!(slice, &['b', 'c']);
-assert_eq!(first, &'d');
-

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference -to it.

-

Returns None if the slice is empty.

-
Examples
-
#![feature(slice_take)]
-
-let mut slice: &[_] = &['a', 'b', 'c'];
-let last = slice.take_last().unwrap();
-
-assert_eq!(slice, &['a', 'b']);
-assert_eq!(last, &'c');
-

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable -reference to it.

-

Returns None if the slice is empty.

-
Examples
-
#![feature(slice_take)]
-
-let mut slice: &mut [_] = &mut ['a', 'b', 'c'];
-let last = slice.take_last_mut().unwrap();
-*last = 'd';
-
-assert_eq!(slice, &['a', 'b']);
-assert_eq!(last, &'d');
-

pub unsafe fn get_many_unchecked_mut<const N: usize>( - &mut self, - indices: [usize; N] -) -> [&mut T; N]

🔬This is a nightly-only experimental API. (get_many_mut)

Returns mutable references to many indices at once, without doing any checks.

-

For a safe alternative see get_many_mut.

-
Safety
-

Calling this method with overlapping or out-of-bounds indices is undefined behavior -even if the resulting references are not used.

-
Examples
-
#![feature(get_many_mut)]
-
-let x = &mut [1, 2, 4];
-
-unsafe {
-    let [a, b] = x.get_many_unchecked_mut([0, 2]);
-    *a *= 10;
-    *b *= 100;
-}
-assert_eq!(x, &[10, 2, 400]);
-

pub fn get_many_mut<const N: usize>( - &mut self, - indices: [usize; N] -) -> Result<[&mut T; N], GetManyMutError<N>>

🔬This is a nightly-only experimental API. (get_many_mut)

Returns mutable references to many indices at once.

-

Returns an error if any index is out-of-bounds, or if the same index was -passed more than once.

-
Examples
-
#![feature(get_many_mut)]
-
-let v = &mut [1, 2, 3];
-if let Ok([a, b]) = v.get_many_mut([0, 2]) {
-    *a = 413;
-    *b = 612;
-}
-assert_eq!(v, &[413, 2, 612]);
-

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

-

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses -the ordering defined by [f64::total_cmp].

-
Current implementation
-

This uses the same sorting algorithm as sort_unstable_by.

-
Examples
-
#![feature(sort_floats)]
-let mut v = [2.6, -5e-8, f64::NAN, 8.29, f64::INFINITY, -1.0, 0.0, -f64::INFINITY, -0.0];
-
-v.sort_floats();
-let sorted = [-f64::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f64::INFINITY, f64::NAN];
-assert_eq!(&v[..8], &sorted[..8]);
-assert!(v[8].is_nan());
-

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

-

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses -the ordering defined by [f32::total_cmp].

-
Current implementation
-

This uses the same sorting algorithm as sort_unstable_by.

-
Examples
-
#![feature(sort_floats)]
-let mut v = [2.6, -5e-8, f32::NAN, 8.29, f32::INFINITY, -1.0, 0.0, -f32::INFINITY, -0.0];
-
-v.sort_floats();
-let sorted = [-f32::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f32::INFINITY, f32::NAN];
-assert_eq!(&v[..8], &sorted[..8]);
-assert!(v[8].is_nan());
-

Trait Implementations§

source§

impl<T, const N: usize> AsMut<[T]> for Vec<T, N>

source§

fn as_mut(&mut self) -> &mut [T]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T, const N: usize> AsMut<Vec<T, N>> for Vec<T, N>

source§

fn as_mut(&mut self) -> &mut Self

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T, const N: usize> AsRef<[T]> for Vec<T, N>

source§

fn as_ref(&self) -> &[T]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T, const N: usize> AsRef<Vec<T, N>> for Vec<T, N>

source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T, const N: usize> Clone for Vec<T, N>where - T: Clone,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, const N: usize> Debug for Vec<T, N>where - T: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, const N: usize> Default for Vec<T, N>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<T, const N: usize> Deref for Vec<T, N>

§

type Target = [T]

The resulting type after dereferencing.
source§

fn deref(&self) -> &[T]

Dereferences the value.
source§

impl<T, const N: usize> DerefMut for Vec<T, N>

source§

fn deref_mut(&mut self) -> &mut [T]

Mutably dereferences the value.
source§

impl<T, const N: usize> Drop for Vec<T, N>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'a, T, const N: usize> Extend<&'a T> for Vec<T, N>where - T: 'a + Copy,

source§

fn extend<I>(&mut self, iter: I)where - I: IntoIterator<Item = &'a T>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, const N: usize> Extend<T> for Vec<T, N>

source§

fn extend<I>(&mut self, iter: I)where - I: IntoIterator<Item = T>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, const N: usize> FromIterator<T> for Vec<T, N>

source§

fn from_iter<I>(iter: I) -> Selfwhere - I: IntoIterator<Item = T>,

Creates a value from an iterator. Read more
source§

impl<T, const N: usize> Hash for Vec<T, N>where - T: Hash,

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
source§

impl<T, const N: usize> Hash for Vec<T, N>where - T: Hash,

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher.
source§

fn hash_slice<H>(data: &[Self], state: &mut H)where - H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher.
source§

impl<'a, T, const N: usize> IntoIterator for &'a Vec<T, N>

§

type Item = &'a T

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, T, const N: usize> IntoIterator for &'a mut Vec<T, N>

§

type Item = &'a mut T

The type of the elements being iterated over.
§

type IntoIter = IterMut<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, const N: usize> IntoIterator for Vec<T, N>

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T, N>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, const N: usize> Ord for Vec<T, N>where - T: Ord,

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Selfwhere - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<A, B, const N: usize> PartialEq<&[B]> for Vec<A, N>where - A: PartialEq<B>,

source§

fn eq(&self, other: &&[B]) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize, const M: usize> PartialEq<&[B; M]> for Vec<A, N>where - A: PartialEq<B>,

source§

fn eq(&self, other: &&[B; M]) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<&mut [B]> for Vec<A, N>where - A: PartialEq<B>,

source§

fn eq(&self, other: &&mut [B]) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<[B]> for Vec<A, N>where - A: PartialEq<B>,

source§

fn eq(&self, other: &[B]) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize, const M: usize> PartialEq<[B; M]> for Vec<A, N>where - A: PartialEq<B>,

source§

fn eq(&self, other: &[B; M]) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<Vec<A, N>> for &[B]where - A: PartialEq<B>,

source§

fn eq(&self, other: &Vec<A, N>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for &[B; M]where - A: PartialEq<B>,

source§

fn eq(&self, other: &Vec<A, N>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<Vec<A, N>> for &mut [B]where - A: PartialEq<B>,

source§

fn eq(&self, other: &Vec<A, N>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<Vec<A, N>> for [B]where - A: PartialEq<B>,

source§

fn eq(&self, other: &Vec<A, N>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where - A: PartialEq<B>,

source§

fn eq(&self, other: &Vec<A, N>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N1: usize, const N2: usize> PartialEq<Vec<B, N2>> for Vec<A, N1>where - A: PartialEq<B>,

source§

fn eq(&self, other: &Vec<B, N2>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<T, const N1: usize, const N2: usize> PartialOrd<Vec<T, N2>> for Vec<T, N1>where - T: PartialOrd,

source§

fn partial_cmp(&self, other: &Vec<T, N2>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl<'a, T: Clone, const N: usize> TryFrom<&'a [T]> for Vec<T, N>

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(slice: &'a [T]) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<const N: usize> Write for Vec<u8, N>

source§

fn write_str(&mut self, s: &str) -> Result

Writes a string slice into this writer, returning whether the write -succeeded. Read more
1.1.0§

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a [char] into this writer, returning whether the write succeeded. Read more
1.0.0§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the [write!] macro with implementors of this trait. Read more
source§

impl<T, const N: usize> Eq for Vec<T, N>where - T: Eq,

Auto Trait Implementations§

§

impl<T, const N: usize> RefUnwindSafe for Vec<T, N>where - T: RefUnwindSafe,

§

impl<T, const N: usize> Send for Vec<T, N>where - T: Send,

§

impl<T, const N: usize> Sync for Vec<T, N>where - T: Sync,

§

impl<T, const N: usize> Unpin for Vec<T, N>where - T: Unpin,

§

impl<T, const N: usize> UnwindSafe for Vec<T, N>where - T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for Twhere - T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for Twhere - T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

-
§

impl<T, U> Into<U> for Twhere - U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

-

That is, this conversion is whatever the implementation of -[From]<T> for U chooses to do.

-
§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/docs/doc/heapless/type.FnvIndexMap.html b/docs/doc/heapless/type.FnvIndexMap.html deleted file mode 100644 index ec84c62..0000000 --- a/docs/doc/heapless/type.FnvIndexMap.html +++ /dev/null @@ -1,272 +0,0 @@ -FnvIndexMap in heapless - Rust

Type Alias heapless::FnvIndexMap

source ·
pub type FnvIndexMap<K, V, const N: usize> = IndexMap<K, V, BuildHasherDefault<FnvHasher>, N>;
Expand description

A heapless::IndexMap using the default FNV hasher

-

A list of all Methods and Traits available for FnvIndexMap can be found in -the heapless::IndexMap documentation.

-

Examples

-
use heapless::FnvIndexMap;
-
-// A hash map with a capacity of 16 key-value pairs allocated on the stack
-let mut book_reviews = FnvIndexMap::<_, _, 16>::new();
-
-// review some books.
-book_reviews.insert("Adventures of Huckleberry Finn",    "My favorite book.").unwrap();
-book_reviews.insert("Grimms' Fairy Tales",               "Masterpiece.").unwrap();
-book_reviews.insert("Pride and Prejudice",               "Very enjoyable.").unwrap();
-book_reviews.insert("The Adventures of Sherlock Holmes", "Eye lyked it alot.").unwrap();
-
-// check for a specific one.
-if !book_reviews.contains_key("Les Misérables") {
-    println!("We've got {} reviews, but Les Misérables ain't one.",
-             book_reviews.len());
-}
-
-// oops, this review has a lot of spelling mistakes, let's delete it.
-book_reviews.remove("The Adventures of Sherlock Holmes");
-
-// look up the values associated with some keys.
-let to_find = ["Pride and Prejudice", "Alice's Adventure in Wonderland"];
-for book in &to_find {
-    match book_reviews.get(book) {
-        Some(review) => println!("{}: {}", book, review),
-        None => println!("{} is unreviewed.", book)
-    }
-}
-
-// iterate over everything.
-for (book, review) in &book_reviews {
-    println!("{}: \"{}\"", book, review);
-}
-

Aliased Type§

struct FnvIndexMap<K, V, const N: usize> { /* private fields */ }

Implementations§

source§

impl<K, V, S, const N: usize> IndexMap<K, V, BuildHasherDefault<S>, N>

source

pub const fn new() -> Self

Creates an empty IndexMap.

-
source§

impl<K, V, S, const N: usize> IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher,

source

pub fn capacity(&self) -> usize

Returns the number of elements the map can hold

-
source

pub fn keys(&self) -> impl Iterator<Item = &K>

Return an iterator over the keys of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for key in map.keys() {
-    println!("{}", key);
-}
-
source

pub fn values(&self) -> impl Iterator<Item = &V>

Return an iterator over the values of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for val in map.values() {
-    println!("{}", val);
-}
-
source

pub fn values_mut(&mut self) -> impl Iterator<Item = &mut V>

Return an iterator over mutable references to the the values of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for val in map.values_mut() {
-    *val += 10;
-}
-
-for val in map.values() {
-    println!("{}", val);
-}
-
source

pub fn iter(&self) -> Iter<'_, K, V>

Return an iterator over the key-value pairs of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for (key, val) in map.iter() {
-    println!("key: {} val: {}", key, val);
-}
-
source

pub fn iter_mut(&mut self) -> IterMut<'_, K, V>

Return an iterator over the key-value pairs of the map, in their order

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert("a", 1).unwrap();
-map.insert("b", 2).unwrap();
-map.insert("c", 3).unwrap();
-
-for (_, val) in map.iter_mut() {
-    *val = 2;
-}
-
-for (key, val) in &map {
-    println!("key: {} val: {}", key, val);
-}
-
source

pub fn first(&self) -> Option<(&K, &V)>

Get the first key-value pair

-

Computes in O(1) time

-
source

pub fn first_mut(&mut self) -> Option<(&K, &mut V)>

Get the first key-value pair, with mutable access to the value

-

Computes in O(1) time

-
source

pub fn last(&self) -> Option<(&K, &V)>

Get the last key-value pair

-

Computes in O(1) time

-
source

pub fn last_mut(&mut self) -> Option<(&K, &mut V)>

Get the last key-value pair, with mutable access to the value

-

Computes in O(1) time

-
source

pub fn entry(&mut self, key: K) -> Entry<'_, K, V, N>

Returns an entry for the corresponding key

- -
use heapless::FnvIndexMap;
-use heapless::Entry;
-let mut map = FnvIndexMap::<_, _, 16>::new();
-if let Entry::Vacant(v) = map.entry("a") {
-    v.insert(1).unwrap();
-}
-if let Entry::Occupied(mut o) = map.entry("a") {
-    println!("found {}", *o.get()); // Prints 1
-    o.insert(2);
-}
-// Prints 2
-println!("val: {}", *map.get("a").unwrap());
-
source

pub fn len(&self) -> usize

Return the number of key-value pairs in the map.

-

Computes in O(1) time.

- -
use heapless::FnvIndexMap;
-
-let mut a = FnvIndexMap::<_, _, 16>::new();
-assert_eq!(a.len(), 0);
-a.insert(1, "a").unwrap();
-assert_eq!(a.len(), 1);
-
source

pub fn is_empty(&self) -> bool

Returns true if the map contains no elements.

-

Computes in O(1) time.

- -
use heapless::FnvIndexMap;
-
-let mut a = FnvIndexMap::<_, _, 16>::new();
-assert!(a.is_empty());
-a.insert(1, "a");
-assert!(!a.is_empty());
-
source

pub fn clear(&mut self)

Remove all key-value pairs in the map, while preserving its capacity.

-

Computes in O(n) time.

- -
use heapless::FnvIndexMap;
-
-let mut a = FnvIndexMap::<_, _, 16>::new();
-a.insert(1, "a");
-a.clear();
-assert!(a.is_empty());
-
source

pub fn get<Q>(&self, key: &Q) -> Option<&V>where - K: Borrow<Q>, - Q: ?Sized + Hash + Eq,

Returns a reference to the value corresponding to the key.

-

The key may be any borrowed form of the map’s key type, but Hash and Eq on the borrowed -form must match those for the key type.

-

Computes in O(1) time (average).

- -
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 16>::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.get(&1), Some(&"a"));
-assert_eq!(map.get(&2), None);
-
source

pub fn contains_key<Q>(&self, key: &Q) -> boolwhere - K: Borrow<Q>, - Q: ?Sized + Eq + Hash,

Returns true if the map contains a value for the specified key.

-

The key may be any borrowed form of the map’s key type, but Hash and Eq on the borrowed -form must match those for the key type.

-

Computes in O(1) time (average).

-
Examples
-
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 8>::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.contains_key(&1), true);
-assert_eq!(map.contains_key(&2), false);
-
source

pub fn get_mut<'v, Q>(&'v mut self, key: &Q) -> Option<&'v mut V>where - K: Borrow<Q>, - Q: ?Sized + Hash + Eq,

Returns a mutable reference to the value corresponding to the key.

-

The key may be any borrowed form of the map’s key type, but Hash and Eq on the borrowed -form must match those for the key type.

-

Computes in O(1) time (average).

-
Examples
-
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 8>::new();
-map.insert(1, "a").unwrap();
-if let Some(x) = map.get_mut(&1) {
-    *x = "b";
-}
-assert_eq!(map[&1], "b");
-
source

pub fn insert(&mut self, key: K, value: V) -> Result<Option<V>, (K, V)>

Inserts a key-value pair into the map.

-

If an equivalent key already exists in the map: the key remains and retains in its place in -the order, its corresponding value is updated with value and the older value is returned -inside Some(_).

-

If no equivalent key existed in the map: the new key-value pair is inserted, last in order, -and None is returned.

-

Computes in O(1) time (average).

-

See also entry if you you want to insert or modify or if you need to get the index of the -corresponding key-value pair.

-
Examples
-
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 8>::new();
-assert_eq!(map.insert(37, "a"), Ok(None));
-assert_eq!(map.is_empty(), false);
-
-map.insert(37, "b");
-assert_eq!(map.insert(37, "c"), Ok(Some("b")));
-assert_eq!(map[&37], "c");
-
source

pub fn remove<Q>(&mut self, key: &Q) -> Option<V>where - K: Borrow<Q>, - Q: ?Sized + Hash + Eq,

Same as swap_remove

-

Computes in O(1) time (average).

-
Examples
-
use heapless::FnvIndexMap;
-
-let mut map = FnvIndexMap::<_, _, 8>::new();
-map.insert(1, "a").unwrap();
-assert_eq!(map.remove(&1), Some("a"));
-assert_eq!(map.remove(&1), None);
-
source

pub fn swap_remove<Q>(&mut self, key: &Q) -> Option<V>where - K: Borrow<Q>, - Q: ?Sized + Hash + Eq,

Remove the key-value pair equivalent to key and return its value.

-

Like Vec::swap_remove, the pair is removed by swapping it with the last element of the map -and popping it off. This perturbs the postion of what used to be the last element!

-

Return None if key is not in map.

-

Computes in O(1) time (average).

-

Trait Implementations§

source§

impl<K, V, S, const N: usize> Clone for IndexMap<K, V, S, N>where - K: Eq + Hash + Clone, - V: Clone, - S: Clone,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<K, V, S, const N: usize> Debug for IndexMap<K, V, S, N>where - K: Eq + Hash + Debug, - V: Debug, - S: BuildHasher,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<K, V, S, const N: usize> Default for IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher + Default,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'a, K, V, S, const N: usize> Extend<(&'a K, &'a V)> for IndexMap<K, V, S, N>where - K: Eq + Hash + Copy, - V: Copy, - S: BuildHasher,

source§

fn extend<I>(&mut self, iterable: I)where - I: IntoIterator<Item = (&'a K, &'a V)>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<K, V, S, const N: usize> Extend<(K, V)> for IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher,

source§

fn extend<I>(&mut self, iterable: I)where - I: IntoIterator<Item = (K, V)>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<K, V, S, const N: usize> FromIterator<(K, V)> for IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher + Default,

source§

fn from_iter<I>(iterable: I) -> Selfwhere - I: IntoIterator<Item = (K, V)>,

Creates a value from an iterator. Read more
source§

impl<'a, K, Q, V, S, const N: usize> Index<&'a Q> for IndexMap<K, V, S, N>where - K: Eq + Hash + Borrow<Q>, - Q: ?Sized + Eq + Hash, - S: BuildHasher,

§

type Output = V

The returned type after indexing.
source§

fn index(&self, key: &Q) -> &V

Performs the indexing (container[index]) operation. Read more
source§

impl<'a, K, Q, V, S, const N: usize> IndexMut<&'a Q> for IndexMap<K, V, S, N>where - K: Eq + Hash + Borrow<Q>, - Q: ?Sized + Eq + Hash, - S: BuildHasher,

source§

fn index_mut(&mut self, key: &Q) -> &mut V

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<K, V, S, const N: usize> IntoIterator for IndexMap<K, V, S, N>where - K: Eq + Hash, - S: BuildHasher,

§

type Item = (K, V)

The type of the elements being iterated over.
§

type IntoIter = IntoIter<K, V, N>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<K, V, S, S2, const N: usize, const N2: usize> PartialEq<IndexMap<K, V, S2, N2>> for IndexMap<K, V, S, N>where - K: Eq + Hash, - V: Eq, - S: BuildHasher, - S2: BuildHasher,

source§

fn eq(&self, other: &IndexMap<K, V, S2, N2>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<K, V, S, const N: usize> Eq for IndexMap<K, V, S, N>where - K: Eq + Hash, - V: Eq, - S: BuildHasher,

\ No newline at end of file diff --git a/docs/doc/heapless/type.FnvIndexSet.html b/docs/doc/heapless/type.FnvIndexSet.html deleted file mode 100644 index 1a87088..0000000 --- a/docs/doc/heapless/type.FnvIndexSet.html +++ /dev/null @@ -1,270 +0,0 @@ -FnvIndexSet in heapless - Rust

Type Alias heapless::FnvIndexSet

source ·
pub type FnvIndexSet<T, const N: usize> = IndexSet<T, BuildHasherDefault<FnvHasher>, N>;
Expand description

A heapless::IndexSet using the -default FNV hasher. -A list of all Methods and Traits available for FnvIndexSet can be found in -the heapless::IndexSet documentation.

-

Examples

-
use heapless::FnvIndexSet;
-
-// A hash set with a capacity of 16 elements allocated on the stack
-let mut books = FnvIndexSet::<_, 16>::new();
-
-// Add some books.
-books.insert("A Dance With Dragons").unwrap();
-books.insert("To Kill a Mockingbird").unwrap();
-books.insert("The Odyssey").unwrap();
-books.insert("The Great Gatsby").unwrap();
-
-// Check for a specific one.
-if !books.contains("The Winds of Winter") {
-    println!("We have {} books, but The Winds of Winter ain't one.",
-             books.len());
-}
-
-// Remove a book.
-books.remove("The Odyssey");
-
-// Iterate over everything.
-for book in &books {
-    println!("{}", book);
-}
-

Aliased Type§

struct FnvIndexSet<T, const N: usize> { /* private fields */ }

Implementations§

source§

impl<T, S, const N: usize> IndexSet<T, BuildHasherDefault<S>, N>

source

pub const fn new() -> Self

Creates an empty IndexSet

-
source§

impl<T, S, const N: usize> IndexSet<T, S, N>where - T: Eq + Hash, - S: BuildHasher,

source

pub fn capacity(&self) -> usize

Returns the number of elements the set can hold

-
Examples
-
use heapless::FnvIndexSet;
-
-let set = FnvIndexSet::<i32, 16>::new();
-assert_eq!(set.capacity(), 16);
-
source

pub fn iter(&self) -> Iter<'_, T>

Return an iterator over the values of the set, in their order

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut set = FnvIndexSet::<_, 16>::new();
-set.insert("a").unwrap();
-set.insert("b").unwrap();
-
-// Will print in an arbitrary order.
-for x in set.iter() {
-    println!("{}", x);
-}
-
source

pub fn first(&self) -> Option<&T>

Get the first value

-

Computes in O(1) time

-
source

pub fn last(&self) -> Option<&T>

Get the last value

-

Computes in O(1) time

-
source

pub fn difference<'a, S2, const N2: usize>( - &'a self, - other: &'a IndexSet<T, S2, N2> -) -> Difference<'a, T, S2, N2>where - S2: BuildHasher,

Visits the values representing the difference, i.e. the values that are in self but not in -other.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-
-// Can be seen as `a - b`.
-for x in a.difference(&b) {
-    println!("{}", x); // Print 1
-}
-
-let diff: FnvIndexSet<_, 16> = a.difference(&b).collect();
-assert_eq!(diff, [1].iter().collect::<FnvIndexSet<_, 16>>());
-
-// Note that difference is not symmetric,
-// and `b - a` means something else:
-let diff: FnvIndexSet<_, 16> = b.difference(&a).collect();
-assert_eq!(diff, [4].iter().collect::<FnvIndexSet<_, 16>>());
-
source

pub fn symmetric_difference<'a, S2, const N2: usize>( - &'a self, - other: &'a IndexSet<T, S2, N2> -) -> impl Iterator<Item = &'a T>where - S2: BuildHasher,

Visits the values representing the symmetric difference, i.e. the values that are in self -or in other but not in both.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-
-// Print 1, 4 in that order order.
-for x in a.symmetric_difference(&b) {
-    println!("{}", x);
-}
-
-let diff1: FnvIndexSet<_, 16> = a.symmetric_difference(&b).collect();
-let diff2: FnvIndexSet<_, 16> = b.symmetric_difference(&a).collect();
-
-assert_eq!(diff1, diff2);
-assert_eq!(diff1, [1, 4].iter().collect::<FnvIndexSet<_, 16>>());
-
source

pub fn intersection<'a, S2, const N2: usize>( - &'a self, - other: &'a IndexSet<T, S2, N2> -) -> Intersection<'a, T, S2, N2>where - S2: BuildHasher,

Visits the values representing the intersection, i.e. the values that are both in self and -other.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-
-// Print 2, 3 in that order.
-for x in a.intersection(&b) {
-    println!("{}", x);
-}
-
-let intersection: FnvIndexSet<_, 16> = a.intersection(&b).collect();
-assert_eq!(intersection, [2, 3].iter().collect::<FnvIndexSet<_, 16>>());
-
source

pub fn union<'a, S2, const N2: usize>( - &'a self, - other: &'a IndexSet<T, S2, N2> -) -> impl Iterator<Item = &'a T>where - S2: BuildHasher,

Visits the values representing the union, i.e. all the values in self or other, without -duplicates.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-
-// Print 1, 2, 3, 4 in that order.
-for x in a.union(&b) {
-    println!("{}", x);
-}
-
-let union: FnvIndexSet<_, 16> = a.union(&b).collect();
-assert_eq!(union, [1, 2, 3, 4].iter().collect::<FnvIndexSet<_, 16>>());
-
source

pub fn len(&self) -> usize

Returns the number of elements in the set.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut v: FnvIndexSet<_, 16> = FnvIndexSet::new();
-assert_eq!(v.len(), 0);
-v.insert(1).unwrap();
-assert_eq!(v.len(), 1);
-
source

pub fn is_empty(&self) -> bool

Returns true if the set contains no elements.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut v: FnvIndexSet<_, 16> = FnvIndexSet::new();
-assert!(v.is_empty());
-v.insert(1).unwrap();
-assert!(!v.is_empty());
-
source

pub fn clear(&mut self)

Clears the set, removing all values.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut v: FnvIndexSet<_, 16> = FnvIndexSet::new();
-v.insert(1).unwrap();
-v.clear();
-assert!(v.is_empty());
-
source

pub fn contains<Q>(&self, value: &Q) -> boolwhere - T: Borrow<Q>, - Q: ?Sized + Eq + Hash,

Returns true if the set contains a value.

-

The value may be any borrowed form of the set’s value type, but Hash and Eq on the -borrowed form must match those for the value type.

-
Examples
-
use heapless::FnvIndexSet;
-
-let set: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-assert_eq!(set.contains(&1), true);
-assert_eq!(set.contains(&4), false);
-
source

pub fn is_disjoint<S2, const N2: usize>( - &self, - other: &IndexSet<T, S2, N2> -) -> boolwhere - S2: BuildHasher,

Returns true if self has no elements in common with other. This is equivalent to -checking for an empty intersection.

-
Examples
-
use heapless::FnvIndexSet;
-
-let a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut b = FnvIndexSet::<_, 16>::new();
-
-assert_eq!(a.is_disjoint(&b), true);
-b.insert(4).unwrap();
-assert_eq!(a.is_disjoint(&b), true);
-b.insert(1).unwrap();
-assert_eq!(a.is_disjoint(&b), false);
-
source

pub fn is_subset<S2, const N2: usize>( - &self, - other: &IndexSet<T, S2, N2> -) -> boolwhere - S2: BuildHasher,

Returns true if the set is a subset of another, i.e. other contains at least all the -values in self.

-
Examples
-
use heapless::FnvIndexSet;
-
-let sup: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-let mut set = FnvIndexSet::<_, 16>::new();
-
-assert_eq!(set.is_subset(&sup), true);
-set.insert(2).unwrap();
-assert_eq!(set.is_subset(&sup), true);
-set.insert(4).unwrap();
-assert_eq!(set.is_subset(&sup), false);
-
source

pub fn is_superset<S2, const N2: usize>( - &self, - other: &IndexSet<T, S2, N2> -) -> boolwhere - S2: BuildHasher,

Examples
-
use heapless::FnvIndexSet;
-
-let sub: FnvIndexSet<_, 16> = [1, 2].iter().cloned().collect();
-let mut set = FnvIndexSet::<_, 16>::new();
-
-assert_eq!(set.is_superset(&sub), false);
-
-set.insert(0).unwrap();
-set.insert(1).unwrap();
-assert_eq!(set.is_superset(&sub), false);
-
-set.insert(2).unwrap();
-assert_eq!(set.is_superset(&sub), true);
-
source

pub fn insert(&mut self, value: T) -> Result<bool, T>

Adds a value to the set.

-

If the set did not have this value present, true is returned.

-

If the set did have this value present, false is returned.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut set = FnvIndexSet::<_, 16>::new();
-
-assert_eq!(set.insert(2).unwrap(), true);
-assert_eq!(set.insert(2).unwrap(), false);
-assert_eq!(set.len(), 1);
-
source

pub fn remove<Q>(&mut self, value: &Q) -> boolwhere - T: Borrow<Q>, - Q: ?Sized + Eq + Hash,

Removes a value from the set. Returns true if the value was present in the set.

-

The value may be any borrowed form of the set’s value type, but Hash and Eq on the -borrowed form must match those for the value type.

-
Examples
-
use heapless::FnvIndexSet;
-
-let mut set = FnvIndexSet::<_, 16>::new();
-
-set.insert(2).unwrap();
-assert_eq!(set.remove(&2), true);
-assert_eq!(set.remove(&2), false);
-

Trait Implementations§

source§

impl<T, S, const N: usize> Clone for IndexSet<T, S, N>where - T: Eq + Hash + Clone, - S: Clone,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, S, const N: usize> Debug for IndexSet<T, S, N>where - T: Eq + Hash + Debug, - S: BuildHasher,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, S, const N: usize> Default for IndexSet<T, S, N>where - T: Eq + Hash, - S: BuildHasher + Default,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'a, T, S, const N: usize> Extend<&'a T> for IndexSet<T, S, N>where - T: 'a + Eq + Hash + Copy, - S: BuildHasher,

source§

fn extend<I>(&mut self, iterable: I)where - I: IntoIterator<Item = &'a T>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, S, const N: usize> Extend<T> for IndexSet<T, S, N>where - T: Eq + Hash, - S: BuildHasher,

source§

fn extend<I>(&mut self, iterable: I)where - I: IntoIterator<Item = T>,

Extends a collection with the contents of an iterator. Read more
§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, S, const N: usize> FromIterator<T> for IndexSet<T, S, N>where - T: Eq + Hash, - S: BuildHasher + Default,

source§

fn from_iter<I>(iter: I) -> Selfwhere - I: IntoIterator<Item = T>,

Creates a value from an iterator. Read more
source§

impl<T, S1, S2, const N1: usize, const N2: usize> PartialEq<IndexSet<T, S2, N2>> for IndexSet<T, S1, N1>where - T: Eq + Hash, - S1: BuildHasher, - S2: BuildHasher,

source§

fn eq(&self, other: &IndexSet<T, S2, N2>) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
\ No newline at end of file diff --git a/docs/doc/heapless/vec/struct.Vec.html b/docs/doc/heapless/vec/struct.Vec.html deleted file mode 100644 index 92b036d..0000000 --- a/docs/doc/heapless/vec/struct.Vec.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Redirection - - -

Redirecting to ../../heapless/struct.Vec.html...

- - - \ No newline at end of file diff --git a/docs/doc/help.html b/docs/doc/help.html deleted file mode 100644 index 6953eb6..0000000 --- a/docs/doc/help.html +++ /dev/null @@ -1 +0,0 @@ -Rustdoc help

Rustdoc help

Back
\ No newline at end of file diff --git a/docs/doc/implementors/arduboy_rust/print/trait.Printable.js b/docs/doc/implementors/arduboy_rust/print/trait.Printable.js deleted file mode 100644 index 96f73be..0000000 --- a/docs/doc/implementors/arduboy_rust/print/trait.Printable.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/arduboy_rust/serial_print/trait.Serialprintable.js b/docs/doc/implementors/arduboy_rust/serial_print/trait.Serialprintable.js deleted file mode 100644 index 96f73be..0000000 --- a/docs/doc/implementors/arduboy_rust/serial_print/trait.Serialprintable.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/arduboy_rust/serial_print/trait.Serialprintlnable.js b/docs/doc/implementors/arduboy_rust/serial_print/trait.Serialprintlnable.js deleted file mode 100644 index 96f73be..0000000 --- a/docs/doc/implementors/arduboy_rust/serial_print/trait.Serialprintlnable.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/byteorder/trait.ByteOrder.js b/docs/doc/implementors/byteorder/trait.ByteOrder.js deleted file mode 100644 index 7b4af58..0000000 --- a/docs/doc/implementors/byteorder/trait.ByteOrder.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"byteorder":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/clone/trait.Clone.js b/docs/doc/implementors/core/clone/trait.Clone.js deleted file mode 100644 index 230dc43..0000000 --- a/docs/doc/implementors/core/clone/trait.Clone.js +++ /dev/null @@ -1,7 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[["impl Clone for Point"],["impl Clone for Color"],["impl Clone for Base"],["impl Clone for Rect"],["impl Clone for ButtonSet"]], -"byteorder":[["impl Clone for LittleEndian"],["impl Clone for BigEndian"]], -"critical_section":[["impl<'cs> Clone for CriticalSection<'cs>"],["impl Clone for RestoreState"]], -"hash32":[["impl<H> Clone for BuildHasherDefault<H>where\n H: Default + Hasher,"]], -"heapless":[["impl<K, V, S, const N: usize> Clone for IndexMap<K, V, S, N>where\n K: Eq + Hash + Clone,\n V: Clone,\n S: Clone,"],["impl<T, const N: usize> Clone for Deque<T, N>where\n T: Clone,"],["impl<T, S, const N: usize> Clone for IndexSet<T, S, N>where\n T: Eq + Hash + Clone,\n S: Clone,"],["impl<const N: usize> Clone for String<N>"],["impl<K, V, const N: usize> Clone for LinearMap<K, V, N>where\n K: Eq + Clone,\n V: Clone,"],["impl<'a, T: Clone, const N: usize> Clone for OldestOrdered<'a, T, N>"],["impl<T, K, const N: usize> Clone for BinaryHeap<T, K, N>where\n K: Kind,\n T: Ord + Clone,"],["impl Clone for LinkedIndexU16"],["impl Clone for LinkedIndexU8"],["impl<T, const N: usize> Clone for Vec<T, N>where\n T: Clone,"],["impl Clone for LinkedIndexUsize"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/cmp/trait.Eq.js b/docs/doc/implementors/core/cmp/trait.Eq.js deleted file mode 100644 index 2233fd1..0000000 --- a/docs/doc/implementors/core/cmp/trait.Eq.js +++ /dev/null @@ -1,6 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[["impl Eq for Base"],["impl Eq for ButtonSet"],["impl Eq for Color"]], -"byteorder":[["impl Eq for BigEndian"],["impl Eq for LittleEndian"]], -"hash32":[["impl<H: Default + Hasher> Eq for BuildHasherDefault<H>"]], -"heapless":[["impl Eq for LinkedIndexUsize"],["impl<T, const N: usize> Eq for Vec<T, N>where\n T: Eq,"],["impl<K, V, S, const N: usize> Eq for IndexMap<K, V, S, N>where\n K: Eq + Hash,\n V: Eq,\n S: BuildHasher,"],["impl<K, V, const N: usize> Eq for LinearMap<K, V, N>where\n K: Eq,\n V: PartialEq,"],["impl Eq for LinkedIndexU16"],["impl<const N: usize> Eq for String<N>"],["impl Eq for LinkedIndexU8"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/cmp/trait.Ord.js b/docs/doc/implementors/core/cmp/trait.Ord.js deleted file mode 100644 index cfb8185..0000000 --- a/docs/doc/implementors/core/cmp/trait.Ord.js +++ /dev/null @@ -1,5 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[["impl Ord for ButtonSet"],["impl Ord for Base"],["impl Ord for Color"]], -"byteorder":[["impl Ord for LittleEndian"],["impl Ord for BigEndian"]], -"heapless":[["impl<const N: usize> Ord for String<N>"],["impl<T, const N: usize> Ord for Vec<T, N>where\n T: Ord,"],["impl Ord for LinkedIndexU8"],["impl Ord for LinkedIndexU16"],["impl Ord for LinkedIndexUsize"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/cmp/trait.PartialEq.js b/docs/doc/implementors/core/cmp/trait.PartialEq.js deleted file mode 100644 index ca15061..0000000 --- a/docs/doc/implementors/core/cmp/trait.PartialEq.js +++ /dev/null @@ -1,6 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[["impl PartialEq<ButtonSet> for ButtonSet"],["impl PartialEq<Color> for Color"],["impl PartialEq<Base> for Base"]], -"byteorder":[["impl PartialEq<BigEndian> for BigEndian"],["impl PartialEq<LittleEndian> for LittleEndian"]], -"hash32":[["impl<H> PartialEq<BuildHasherDefault<H>> for BuildHasherDefault<H>where\n H: Default + Hasher,"]], -"heapless":[["impl<K, V, S, S2, const N: usize, const N2: usize> PartialEq<IndexMap<K, V, S2, N2>> for IndexMap<K, V, S, N>where\n K: Eq + Hash,\n V: Eq,\n S: BuildHasher,\n S2: BuildHasher,"],["impl<A, B, const N1: usize, const N2: usize> PartialEq<Vec<B, N2>> for Vec<A, N1>where\n A: PartialEq<B>,"],["impl PartialEq<LinkedIndexUsize> for LinkedIndexUsize"],["impl<T, S1, S2, const N1: usize, const N2: usize> PartialEq<IndexSet<T, S2, N2>> for IndexSet<T, S1, N1>where\n T: Eq + Hash,\n S1: BuildHasher,\n S2: BuildHasher,"],["impl<A, B, const N: usize> PartialEq<Vec<A, N>> for &mut [B]where\n A: PartialEq<B>,"],["impl<const N: usize> PartialEq<&str> for String<N>"],["impl PartialEq<LinkedIndexU8> for LinkedIndexU8"],["impl<const N: usize> PartialEq<String<N>> for &str"],["impl<A, B, const N: usize> PartialEq<[B]> for Vec<A, N>where\n A: PartialEq<B>,"],["impl<A, B, const N: usize> PartialEq<Vec<A, N>> for &[B]where\n A: PartialEq<B>,"],["impl<const N: usize> PartialEq<str> for String<N>"],["impl<A, B, const N: usize> PartialEq<&mut [B]> for Vec<A, N>where\n A: PartialEq<B>,"],["impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]where\n A: PartialEq<B>,"],["impl<A, B, const N: usize, const M: usize> PartialEq<&[B; M]> for Vec<A, N>where\n A: PartialEq<B>,"],["impl<const N1: usize, const N2: usize> PartialEq<String<N2>> for String<N1>"],["impl<const N: usize> PartialEq<String<N>> for str"],["impl<A, B, const N: usize, const M: usize> PartialEq<[B; M]> for Vec<A, N>where\n A: PartialEq<B>,"],["impl PartialEq<LinkedIndexU16> for LinkedIndexU16"],["impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for &[B; M]where\n A: PartialEq<B>,"],["impl<K, V, const N: usize, const N2: usize> PartialEq<LinearMap<K, V, N2>> for LinearMap<K, V, N>where\n K: Eq,\n V: PartialEq,"],["impl<A, B, const N: usize> PartialEq<&[B]> for Vec<A, N>where\n A: PartialEq<B>,"],["impl<A, B, const N: usize> PartialEq<Vec<A, N>> for [B]where\n A: PartialEq<B>,"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/cmp/trait.PartialOrd.js b/docs/doc/implementors/core/cmp/trait.PartialOrd.js deleted file mode 100644 index cd22b2f..0000000 --- a/docs/doc/implementors/core/cmp/trait.PartialOrd.js +++ /dev/null @@ -1,5 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[["impl PartialOrd<Base> for Base"],["impl PartialOrd<ButtonSet> for ButtonSet"],["impl PartialOrd<Color> for Color"]], -"byteorder":[["impl PartialOrd<BigEndian> for BigEndian"],["impl PartialOrd<LittleEndian> for LittleEndian"]], -"heapless":[["impl PartialOrd<LinkedIndexU8> for LinkedIndexU8"],["impl PartialOrd<LinkedIndexU16> for LinkedIndexU16"],["impl<T, const N1: usize, const N2: usize> PartialOrd<Vec<T, N2>> for Vec<T, N1>where\n T: PartialOrd,"],["impl<const N1: usize, const N2: usize> PartialOrd<String<N2>> for String<N1>"],["impl PartialOrd<LinkedIndexUsize> for LinkedIndexUsize"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/convert/trait.AsMut.js b/docs/doc/implementors/core/convert/trait.AsMut.js deleted file mode 100644 index a462a5a..0000000 --- a/docs/doc/implementors/core/convert/trait.AsMut.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"heapless":[["impl<T, const N: usize> AsMut<Vec<T, N>> for Vec<T, N>"],["impl<T, const N: usize> AsMut<[T]> for Vec<T, N>"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/convert/trait.AsRef.js b/docs/doc/implementors/core/convert/trait.AsRef.js deleted file mode 100644 index 0659506..0000000 --- a/docs/doc/implementors/core/convert/trait.AsRef.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"heapless":[["impl<T, const N: usize> AsRef<Vec<T, N>> for Vec<T, N>"],["impl<const N: usize> AsRef<str> for String<N>"],["impl<T, const N: usize> AsRef<[T]> for Vec<T, N>"],["impl<const N: usize> AsRef<[u8]> for String<N>"],["impl<T, const N: usize> AsRef<[T]> for HistoryBuffer<T, N>"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/convert/trait.From.js b/docs/doc/implementors/core/convert/trait.From.js deleted file mode 100644 index addb32c..0000000 --- a/docs/doc/implementors/core/convert/trait.From.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"heapless":[["impl<const N: usize> From<u16> for String<N>"],["impl<const N: usize> From<i16> for String<N>"],["impl<const N: usize> From<u32> for String<N>"],["impl<const N: usize> From<i8> for String<N>"],["impl<const N: usize> From<i64> for String<N>"],["impl<const N: usize> From<u64> for String<N>"],["impl<const N: usize> From<i32> for String<N>"],["impl<const N: usize> From<u8> for String<N>"],["impl<'a, const N: usize> From<&'a str> for String<N>"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/convert/trait.TryFrom.js b/docs/doc/implementors/core/convert/trait.TryFrom.js deleted file mode 100644 index 8969d7f..0000000 --- a/docs/doc/implementors/core/convert/trait.TryFrom.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"heapless":[["impl<'a, T: Clone, const N: usize> TryFrom<&'a [T]> for Vec<T, N>"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/default/trait.Default.js b/docs/doc/implementors/core/default/trait.Default.js deleted file mode 100644 index 2278414..0000000 --- a/docs/doc/implementors/core/default/trait.Default.js +++ /dev/null @@ -1,5 +0,0 @@ -(function() {var implementors = { -"byteorder":[["impl Default for LittleEndian"],["impl Default for BigEndian"]], -"hash32":[["impl Default for Hasher"],["impl<H> Default for BuildHasherDefault<H>where\n H: Default + Hasher,"],["impl Default for Hasher"]], -"heapless":[["impl<K, V, const N: usize> Default for LinearMap<K, V, N>where\n K: Eq,"],["impl<T, S, const N: usize> Default for IndexSet<T, S, N>where\n T: Eq + Hash,\n S: BuildHasher + Default,"],["impl<K, V, S, const N: usize> Default for IndexMap<K, V, S, N>where\n K: Eq + Hash,\n S: BuildHasher + Default,"],["impl<const N: usize> Default for String<N>"],["impl<T, K, const N: usize> Default for BinaryHeap<T, K, N>where\n T: Ord,\n K: Kind,"],["impl<T, const N: usize> Default for Deque<T, N>"],["impl<T, const N: usize> Default for HistoryBuffer<T, N>"],["impl<T, const N: usize> Default for Vec<T, N>"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/fmt/trait.Debug.js b/docs/doc/implementors/core/fmt/trait.Debug.js deleted file mode 100644 index 260867e..0000000 --- a/docs/doc/implementors/core/fmt/trait.Debug.js +++ /dev/null @@ -1,7 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[["impl Debug for ButtonSet"],["impl Debug for Rect"],["impl Debug for Color"],["impl Debug for Point"],["impl Debug for Base"]], -"byteorder":[["impl Debug for BigEndian"],["impl Debug for LittleEndian"]], -"critical_section":[["impl<'cs> Debug for CriticalSection<'cs>"],["impl<T: Debug> Debug for Mutex<T>"],["impl Debug for RestoreState"]], -"hash32":[["impl<H: Default + Hasher> Debug for BuildHasherDefault<H>"]], -"heapless":[["impl<T, const N: usize> Debug for HistoryBuffer<T, N>where\n T: Debug,"],["impl Debug for LinkedIndexU16"],["impl Debug for LinkedIndexUsize"],["impl<K, V, S, const N: usize> Debug for IndexMap<K, V, S, N>where\n K: Eq + Hash + Debug,\n V: Debug,\n S: BuildHasher,"],["impl<T: Debug, const N: usize> Debug for Deque<T, N>"],["impl<const N: usize> Debug for String<N>"],["impl<T, const N: usize> Debug for Vec<T, N>where\n T: Debug,"],["impl Debug for LinkedIndexU8"],["impl<T, K, const N: usize> Debug for BinaryHeap<T, K, N>where\n K: Kind,\n T: Ord + Debug,"],["impl<T, S, const N: usize> Debug for IndexSet<T, S, N>where\n T: Eq + Hash + Debug,\n S: BuildHasher,"],["impl<T, Idx, K, const N: usize> Debug for SortedLinkedList<T, Idx, K, N>where\n T: Ord + Debug,\n Idx: SortedLinkedListIndex,\n K: Kind,"],["impl<K, V, const N: usize> Debug for LinearMap<K, V, N>where\n K: Eq + Debug,\n V: Debug,"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/fmt/trait.Display.js b/docs/doc/implementors/core/fmt/trait.Display.js deleted file mode 100644 index 92d48f0..0000000 --- a/docs/doc/implementors/core/fmt/trait.Display.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"heapless":[["impl<const N: usize> Display for String<N>"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/fmt/trait.Write.js b/docs/doc/implementors/core/fmt/trait.Write.js deleted file mode 100644 index 6769c48..0000000 --- a/docs/doc/implementors/core/fmt/trait.Write.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"heapless":[["impl<const N: usize> Write for String<N>"],["impl<const N: usize> Write for Vec<u8, N>"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/hash/trait.Hash.js b/docs/doc/implementors/core/hash/trait.Hash.js deleted file mode 100644 index d09fc43..0000000 --- a/docs/doc/implementors/core/hash/trait.Hash.js +++ /dev/null @@ -1,5 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[["impl Hash for Color"],["impl Hash for Base"],["impl Hash for ButtonSet"]], -"byteorder":[["impl Hash for BigEndian"],["impl Hash for LittleEndian"]], -"heapless":[["impl<const N: usize> Hash for String<N>"],["impl<T, const N: usize> Hash for Vec<T, N>where\n T: Hash,"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/iter/traits/collect/trait.Extend.js b/docs/doc/implementors/core/iter/traits/collect/trait.Extend.js deleted file mode 100644 index e30917d..0000000 --- a/docs/doc/implementors/core/iter/traits/collect/trait.Extend.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"heapless":[["impl<T, const N: usize> Extend<T> for HistoryBuffer<T, N>"],["impl<'a, T, const N: usize> Extend<&'a T> for Vec<T, N>where\n T: 'a + Copy,"],["impl<'a, T, const N: usize> Extend<&'a T> for HistoryBuffer<T, N>where\n T: 'a + Clone,"],["impl<'a, T, S, const N: usize> Extend<&'a T> for IndexSet<T, S, N>where\n T: 'a + Eq + Hash + Copy,\n S: BuildHasher,"],["impl<T, const N: usize> Extend<T> for Vec<T, N>"],["impl<K, V, S, const N: usize> Extend<(K, V)> for IndexMap<K, V, S, N>where\n K: Eq + Hash,\n S: BuildHasher,"],["impl<'a, K, V, S, const N: usize> Extend<(&'a K, &'a V)> for IndexMap<K, V, S, N>where\n K: Eq + Hash + Copy,\n V: Copy,\n S: BuildHasher,"],["impl<T, S, const N: usize> Extend<T> for IndexSet<T, S, N>where\n T: Eq + Hash,\n S: BuildHasher,"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/iter/traits/collect/trait.FromIterator.js b/docs/doc/implementors/core/iter/traits/collect/trait.FromIterator.js deleted file mode 100644 index 2597cd2..0000000 --- a/docs/doc/implementors/core/iter/traits/collect/trait.FromIterator.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"heapless":[["impl<'a, const N: usize> FromIterator<&'a str> for String<N>"],["impl<K, V, S, const N: usize> FromIterator<(K, V)> for IndexMap<K, V, S, N>where\n K: Eq + Hash,\n S: BuildHasher + Default,"],["impl<T, S, const N: usize> FromIterator<T> for IndexSet<T, S, N>where\n T: Eq + Hash,\n S: BuildHasher + Default,"],["impl<K, V, const N: usize> FromIterator<(K, V)> for LinearMap<K, V, N>where\n K: Eq,"],["impl<'a, const N: usize> FromIterator<&'a char> for String<N>"],["impl<T, const N: usize> FromIterator<T> for Vec<T, N>"],["impl<const N: usize> FromIterator<char> for String<N>"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/iter/traits/collect/trait.IntoIterator.js b/docs/doc/implementors/core/iter/traits/collect/trait.IntoIterator.js deleted file mode 100644 index 48f56ec..0000000 --- a/docs/doc/implementors/core/iter/traits/collect/trait.IntoIterator.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"heapless":[["impl<'a, K, V, const N: usize> IntoIterator for &'a LinearMap<K, V, N>where\n K: Eq,"],["impl<'a, T, const N: usize> IntoIterator for &'a mut Vec<T, N>"],["impl<'a, T, const N: usize> IntoIterator for &'a mut Deque<T, N>"],["impl<'a, K, V, S, const N: usize> IntoIterator for &'a mut IndexMap<K, V, S, N>where\n K: Eq + Hash,\n S: BuildHasher,"],["impl<'a, T, S, const N: usize> IntoIterator for &'a IndexSet<T, S, N>where\n T: Eq + Hash,\n S: BuildHasher,"],["impl<'a, T, K, const N: usize> IntoIterator for &'a BinaryHeap<T, K, N>where\n K: Kind,\n T: Ord,"],["impl<'a, T, const N: usize> IntoIterator for &'a Vec<T, N>"],["impl<'a, T, const N: usize> IntoIterator for &'a Deque<T, N>"],["impl<K, V, S, const N: usize> IntoIterator for IndexMap<K, V, S, N>where\n K: Eq + Hash,\n S: BuildHasher,"],["impl<'a, K, V, S, const N: usize> IntoIterator for &'a IndexMap<K, V, S, N>where\n K: Eq + Hash,\n S: BuildHasher,"],["impl<T, const N: usize> IntoIterator for Vec<T, N>"],["impl<T, const N: usize> IntoIterator for Deque<T, N>"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/iter/traits/iterator/trait.Iterator.js b/docs/doc/implementors/core/iter/traits/iterator/trait.Iterator.js deleted file mode 100644 index c7cb66b..0000000 --- a/docs/doc/implementors/core/iter/traits/iterator/trait.Iterator.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"heapless":[["impl<'a, T, const N: usize> Iterator for OldestOrdered<'a, T, N>"],["impl<'a, T, Idx, K, const N: usize> Iterator for Iter<'a, T, Idx, K, N>where\n T: Ord,\n Idx: SortedLinkedListIndex,\n K: Kind,"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/marker/trait.Copy.js b/docs/doc/implementors/core/marker/trait.Copy.js deleted file mode 100644 index 7119475..0000000 --- a/docs/doc/implementors/core/marker/trait.Copy.js +++ /dev/null @@ -1,6 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[["impl Copy for Rect"],["impl Copy for Base"],["impl Copy for ButtonSet"],["impl Copy for Point"],["impl Copy for Color"]], -"byteorder":[["impl Copy for BigEndian"],["impl Copy for LittleEndian"]], -"critical_section":[["impl Copy for RestoreState"],["impl<'cs> Copy for CriticalSection<'cs>"]], -"heapless":[["impl Copy for LinkedIndexUsize"],["impl Copy for LinkedIndexU16"],["impl Copy for LinkedIndexU8"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/marker/trait.Freeze.js b/docs/doc/implementors/core/marker/trait.Freeze.js deleted file mode 100644 index 8875c04..0000000 --- a/docs/doc/implementors/core/marker/trait.Freeze.js +++ /dev/null @@ -1,7 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[["impl Freeze for ButtonSet",1,["arduboy_rust::hardware::buttons::ButtonSet"]],["impl Freeze for Color",1,["arduboy_rust::library::arduboy2::Color"]],["impl Freeze for Rect",1,["arduboy_rust::library::arduboy2::Rect"]],["impl Freeze for Point",1,["arduboy_rust::library::arduboy2::Point"]],["impl Freeze for Arduboy2",1,["arduboy_rust::library::arduboy2::Arduboy2"]],["impl Freeze for ArduboyTones",1,["arduboy_rust::library::arduboy_tone::ArduboyTones"]],["impl Freeze for ArdVoice",1,["arduboy_rust::library::ardvoice::ArdVoice"]],["impl Freeze for EEPROM",1,["arduboy_rust::library::eeprom::EEPROM"]],["impl Freeze for EEPROMBYTE",1,["arduboy_rust::library::eeprom::EEPROMBYTE"]],["impl Freeze for EEPROMBYTECHECKLESS",1,["arduboy_rust::library::eeprom::EEPROMBYTECHECKLESS"]],["impl Freeze for Base",1,["arduboy_rust::print::Base"]]], -"byteorder":[["impl Freeze for BigEndian",1,["byteorder::BigEndian"]],["impl Freeze for LittleEndian",1,["byteorder::LittleEndian"]]], -"critical_section":[["impl<T> !Freeze for Mutex<T>",1,["critical_section::mutex::Mutex"]],["impl<'cs> Freeze for CriticalSection<'cs>",1,["critical_section::CriticalSection"]],["impl Freeze for RestoreState",1,["critical_section::RestoreState"]]], -"hash32":[["impl Freeze for Hasher",1,["hash32::fnv::Hasher"]],["impl Freeze for Hasher",1,["hash32::murmur3::Hasher"]],["impl<H> Freeze for BuildHasherDefault<H>",1,["hash32::BuildHasherDefault"]]], -"heapless":[["impl<T, const N: usize> Freeze for Deque<T, N>where\n T: Freeze,",1,["heapless::deque::Deque"]],["impl<T, const N: usize> Freeze for HistoryBuffer<T, N>where\n T: Freeze,",1,["heapless::histbuf::HistoryBuffer"]],["impl<'a, T, const N: usize> Freeze for OldestOrdered<'a, T, N>",1,["heapless::histbuf::OldestOrdered"]],["impl<'a, K, V, const N: usize> Freeze for Entry<'a, K, V, N>where\n K: Freeze,",1,["heapless::indexmap::Entry"]],["impl<'a, K, V, const N: usize> Freeze for OccupiedEntry<'a, K, V, N>where\n K: Freeze,",1,["heapless::indexmap::OccupiedEntry"]],["impl<'a, K, V, const N: usize> Freeze for VacantEntry<'a, K, V, N>where\n K: Freeze,",1,["heapless::indexmap::VacantEntry"]],["impl<K, V, S, const N: usize> Freeze for IndexMap<K, V, S, N>where\n K: Freeze,\n S: Freeze,\n V: Freeze,",1,["heapless::indexmap::IndexMap"]],["impl<T, S, const N: usize> Freeze for IndexSet<T, S, N>where\n S: Freeze,\n T: Freeze,",1,["heapless::indexset::IndexSet"]],["impl<K, V, const N: usize> Freeze for LinearMap<K, V, N>where\n K: Freeze,\n V: Freeze,",1,["heapless::linear_map::LinearMap"]],["impl<const N: usize> Freeze for String<N>",1,["heapless::string::String"]],["impl<T, const N: usize> Freeze for Vec<T, N>where\n T: Freeze,",1,["heapless::vec::Vec"]],["impl Freeze for Min",1,["heapless::binary_heap::Min"]],["impl Freeze for Max",1,["heapless::binary_heap::Max"]],["impl<T, K, const N: usize> Freeze for BinaryHeap<T, K, N>where\n T: Freeze,",1,["heapless::binary_heap::BinaryHeap"]],["impl<'a, T, K, const N: usize> Freeze for PeekMut<'a, T, K, N>",1,["heapless::binary_heap::PeekMut"]],["impl Freeze for Min",1,["heapless::sorted_linked_list::Min"]],["impl Freeze for Max",1,["heapless::sorted_linked_list::Max"]],["impl<T, Idx> Freeze for Node<T, Idx>where\n Idx: Freeze,\n T: Freeze,",1,["heapless::sorted_linked_list::Node"]],["impl<T, Idx, K, const N: usize> Freeze for SortedLinkedList<T, Idx, K, N>where\n Idx: Freeze,\n T: Freeze,",1,["heapless::sorted_linked_list::SortedLinkedList"]],["impl Freeze for LinkedIndexU8",1,["heapless::sorted_linked_list::LinkedIndexU8"]],["impl Freeze for LinkedIndexU16",1,["heapless::sorted_linked_list::LinkedIndexU16"]],["impl Freeze for LinkedIndexUsize",1,["heapless::sorted_linked_list::LinkedIndexUsize"]],["impl<'a, T, Idx, K, const N: usize> Freeze for Iter<'a, T, Idx, K, N>where\n Idx: Freeze,",1,["heapless::sorted_linked_list::Iter"]],["impl<'a, T, Idx, K, const N: usize> Freeze for FindMut<'a, T, Idx, K, N>where\n Idx: Freeze,",1,["heapless::sorted_linked_list::FindMut"]]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/marker/trait.Send.js b/docs/doc/implementors/core/marker/trait.Send.js deleted file mode 100644 index 3413332..0000000 --- a/docs/doc/implementors/core/marker/trait.Send.js +++ /dev/null @@ -1,7 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[["impl Send for ButtonSet",1,["arduboy_rust::hardware::buttons::ButtonSet"]],["impl Send for Color",1,["arduboy_rust::library::arduboy2::Color"]],["impl Send for Rect",1,["arduboy_rust::library::arduboy2::Rect"]],["impl Send for Point",1,["arduboy_rust::library::arduboy2::Point"]],["impl Send for Arduboy2",1,["arduboy_rust::library::arduboy2::Arduboy2"]],["impl Send for ArduboyTones",1,["arduboy_rust::library::arduboy_tone::ArduboyTones"]],["impl Send for ArdVoice",1,["arduboy_rust::library::ardvoice::ArdVoice"]],["impl Send for EEPROM",1,["arduboy_rust::library::eeprom::EEPROM"]],["impl Send for EEPROMBYTE",1,["arduboy_rust::library::eeprom::EEPROMBYTE"]],["impl Send for EEPROMBYTECHECKLESS",1,["arduboy_rust::library::eeprom::EEPROMBYTECHECKLESS"]],["impl Send for Base",1,["arduboy_rust::print::Base"]]], -"byteorder":[["impl Send for BigEndian",1,["byteorder::BigEndian"]],["impl Send for LittleEndian",1,["byteorder::LittleEndian"]]], -"critical_section":[["impl<T> Send for Mutex<T>where\n T: Send,",1,["critical_section::mutex::Mutex"]],["impl<'cs> Send for CriticalSection<'cs>",1,["critical_section::CriticalSection"]],["impl Send for RestoreState",1,["critical_section::RestoreState"]]], -"hash32":[["impl Send for Hasher",1,["hash32::fnv::Hasher"]],["impl Send for Hasher",1,["hash32::murmur3::Hasher"]],["impl<H> Send for BuildHasherDefault<H>where\n H: Send,",1,["hash32::BuildHasherDefault"]]], -"heapless":[["impl<T, const N: usize> Send for Deque<T, N>where\n T: Send,",1,["heapless::deque::Deque"]],["impl<T, const N: usize> Send for HistoryBuffer<T, N>where\n T: Send,",1,["heapless::histbuf::HistoryBuffer"]],["impl<'a, T, const N: usize> Send for OldestOrdered<'a, T, N>where\n T: Sync,",1,["heapless::histbuf::OldestOrdered"]],["impl<'a, K, V, const N: usize> Send for Entry<'a, K, V, N>where\n K: Send,\n V: Send,",1,["heapless::indexmap::Entry"]],["impl<'a, K, V, const N: usize> Send for OccupiedEntry<'a, K, V, N>where\n K: Send,\n V: Send,",1,["heapless::indexmap::OccupiedEntry"]],["impl<'a, K, V, const N: usize> Send for VacantEntry<'a, K, V, N>where\n K: Send,\n V: Send,",1,["heapless::indexmap::VacantEntry"]],["impl<K, V, S, const N: usize> Send for IndexMap<K, V, S, N>where\n K: Send,\n S: Send,\n V: Send,",1,["heapless::indexmap::IndexMap"]],["impl<T, S, const N: usize> Send for IndexSet<T, S, N>where\n S: Send,\n T: Send,",1,["heapless::indexset::IndexSet"]],["impl<K, V, const N: usize> Send for LinearMap<K, V, N>where\n K: Send,\n V: Send,",1,["heapless::linear_map::LinearMap"]],["impl<const N: usize> Send for String<N>",1,["heapless::string::String"]],["impl<T, const N: usize> Send for Vec<T, N>where\n T: Send,",1,["heapless::vec::Vec"]],["impl Send for Min",1,["heapless::binary_heap::Min"]],["impl Send for Max",1,["heapless::binary_heap::Max"]],["impl<T, K, const N: usize> Send for BinaryHeap<T, K, N>where\n K: Send,\n T: Send,",1,["heapless::binary_heap::BinaryHeap"]],["impl<'a, T, K, const N: usize> Send for PeekMut<'a, T, K, N>where\n K: Send,\n T: Send,",1,["heapless::binary_heap::PeekMut"]],["impl Send for Min",1,["heapless::sorted_linked_list::Min"]],["impl Send for Max",1,["heapless::sorted_linked_list::Max"]],["impl<T, Idx> Send for Node<T, Idx>where\n Idx: Send,\n T: Send,",1,["heapless::sorted_linked_list::Node"]],["impl<T, Idx, K, const N: usize> Send for SortedLinkedList<T, Idx, K, N>where\n Idx: Send,\n K: Send,\n T: Send,",1,["heapless::sorted_linked_list::SortedLinkedList"]],["impl Send for LinkedIndexU8",1,["heapless::sorted_linked_list::LinkedIndexU8"]],["impl Send for LinkedIndexU16",1,["heapless::sorted_linked_list::LinkedIndexU16"]],["impl Send for LinkedIndexUsize",1,["heapless::sorted_linked_list::LinkedIndexUsize"]],["impl<'a, T, Idx, K, const N: usize> Send for Iter<'a, T, Idx, K, N>where\n Idx: Send + Sync,\n K: Sync,\n T: Sync,",1,["heapless::sorted_linked_list::Iter"]],["impl<'a, T, Idx, K, const N: usize> Send for FindMut<'a, T, Idx, K, N>where\n Idx: Send,\n K: Send,\n T: Send,",1,["heapless::sorted_linked_list::FindMut"]]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/marker/trait.StructuralEq.js b/docs/doc/implementors/core/marker/trait.StructuralEq.js deleted file mode 100644 index 76a4e7f..0000000 --- a/docs/doc/implementors/core/marker/trait.StructuralEq.js +++ /dev/null @@ -1,5 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[["impl StructuralEq for Color"],["impl StructuralEq for ButtonSet"],["impl StructuralEq for Base"]], -"byteorder":[["impl StructuralEq for LittleEndian"],["impl StructuralEq for BigEndian"]], -"heapless":[["impl StructuralEq for LinkedIndexU16"],["impl StructuralEq for LinkedIndexUsize"],["impl StructuralEq for LinkedIndexU8"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/marker/trait.StructuralPartialEq.js b/docs/doc/implementors/core/marker/trait.StructuralPartialEq.js deleted file mode 100644 index 3868bba..0000000 --- a/docs/doc/implementors/core/marker/trait.StructuralPartialEq.js +++ /dev/null @@ -1,5 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[["impl StructuralPartialEq for Color"],["impl StructuralPartialEq for ButtonSet"],["impl StructuralPartialEq for Base"]], -"byteorder":[["impl StructuralPartialEq for LittleEndian"],["impl StructuralPartialEq for BigEndian"]], -"heapless":[["impl StructuralPartialEq for LinkedIndexUsize"],["impl StructuralPartialEq for LinkedIndexU16"],["impl StructuralPartialEq for LinkedIndexU8"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/marker/trait.Sync.js b/docs/doc/implementors/core/marker/trait.Sync.js deleted file mode 100644 index 028b6d2..0000000 --- a/docs/doc/implementors/core/marker/trait.Sync.js +++ /dev/null @@ -1,7 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[["impl Sync for ButtonSet",1,["arduboy_rust::hardware::buttons::ButtonSet"]],["impl Sync for Color",1,["arduboy_rust::library::arduboy2::Color"]],["impl Sync for Rect",1,["arduboy_rust::library::arduboy2::Rect"]],["impl Sync for Point",1,["arduboy_rust::library::arduboy2::Point"]],["impl Sync for Arduboy2",1,["arduboy_rust::library::arduboy2::Arduboy2"]],["impl Sync for ArduboyTones",1,["arduboy_rust::library::arduboy_tone::ArduboyTones"]],["impl Sync for ArdVoice",1,["arduboy_rust::library::ardvoice::ArdVoice"]],["impl Sync for EEPROM",1,["arduboy_rust::library::eeprom::EEPROM"]],["impl Sync for EEPROMBYTE",1,["arduboy_rust::library::eeprom::EEPROMBYTE"]],["impl Sync for EEPROMBYTECHECKLESS",1,["arduboy_rust::library::eeprom::EEPROMBYTECHECKLESS"]],["impl Sync for Base",1,["arduboy_rust::print::Base"]]], -"byteorder":[["impl Sync for BigEndian",1,["byteorder::BigEndian"]],["impl Sync for LittleEndian",1,["byteorder::LittleEndian"]]], -"critical_section":[["impl<'cs> Sync for CriticalSection<'cs>",1,["critical_section::CriticalSection"]],["impl Sync for RestoreState",1,["critical_section::RestoreState"]],["impl<T> Sync for Mutex<T>where\n T: Send,"]], -"hash32":[["impl Sync for Hasher",1,["hash32::fnv::Hasher"]],["impl Sync for Hasher",1,["hash32::murmur3::Hasher"]],["impl<H> Sync for BuildHasherDefault<H>where\n H: Sync,",1,["hash32::BuildHasherDefault"]]], -"heapless":[["impl<T, const N: usize> Sync for Deque<T, N>where\n T: Sync,",1,["heapless::deque::Deque"]],["impl<T, const N: usize> Sync for HistoryBuffer<T, N>where\n T: Sync,",1,["heapless::histbuf::HistoryBuffer"]],["impl<'a, T, const N: usize> Sync for OldestOrdered<'a, T, N>where\n T: Sync,",1,["heapless::histbuf::OldestOrdered"]],["impl<'a, K, V, const N: usize> Sync for Entry<'a, K, V, N>where\n K: Sync,\n V: Sync,",1,["heapless::indexmap::Entry"]],["impl<'a, K, V, const N: usize> Sync for OccupiedEntry<'a, K, V, N>where\n K: Sync,\n V: Sync,",1,["heapless::indexmap::OccupiedEntry"]],["impl<'a, K, V, const N: usize> Sync for VacantEntry<'a, K, V, N>where\n K: Sync,\n V: Sync,",1,["heapless::indexmap::VacantEntry"]],["impl<K, V, S, const N: usize> Sync for IndexMap<K, V, S, N>where\n K: Sync,\n S: Sync,\n V: Sync,",1,["heapless::indexmap::IndexMap"]],["impl<T, S, const N: usize> Sync for IndexSet<T, S, N>where\n S: Sync,\n T: Sync,",1,["heapless::indexset::IndexSet"]],["impl<K, V, const N: usize> Sync for LinearMap<K, V, N>where\n K: Sync,\n V: Sync,",1,["heapless::linear_map::LinearMap"]],["impl<const N: usize> Sync for String<N>",1,["heapless::string::String"]],["impl<T, const N: usize> Sync for Vec<T, N>where\n T: Sync,",1,["heapless::vec::Vec"]],["impl Sync for Min",1,["heapless::binary_heap::Min"]],["impl Sync for Max",1,["heapless::binary_heap::Max"]],["impl<T, K, const N: usize> Sync for BinaryHeap<T, K, N>where\n K: Sync,\n T: Sync,",1,["heapless::binary_heap::BinaryHeap"]],["impl<'a, T, K, const N: usize> Sync for PeekMut<'a, T, K, N>where\n K: Sync,\n T: Sync,",1,["heapless::binary_heap::PeekMut"]],["impl Sync for Min",1,["heapless::sorted_linked_list::Min"]],["impl Sync for Max",1,["heapless::sorted_linked_list::Max"]],["impl<T, Idx> Sync for Node<T, Idx>where\n Idx: Sync,\n T: Sync,",1,["heapless::sorted_linked_list::Node"]],["impl<T, Idx, K, const N: usize> Sync for SortedLinkedList<T, Idx, K, N>where\n Idx: Sync,\n K: Sync,\n T: Sync,",1,["heapless::sorted_linked_list::SortedLinkedList"]],["impl Sync for LinkedIndexU8",1,["heapless::sorted_linked_list::LinkedIndexU8"]],["impl Sync for LinkedIndexU16",1,["heapless::sorted_linked_list::LinkedIndexU16"]],["impl Sync for LinkedIndexUsize",1,["heapless::sorted_linked_list::LinkedIndexUsize"]],["impl<'a, T, Idx, K, const N: usize> Sync for Iter<'a, T, Idx, K, N>where\n Idx: Sync,\n K: Sync,\n T: Sync,",1,["heapless::sorted_linked_list::Iter"]],["impl<'a, T, Idx, K, const N: usize> Sync for FindMut<'a, T, Idx, K, N>where\n Idx: Sync,\n K: Sync,\n T: Sync,",1,["heapless::sorted_linked_list::FindMut"]]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/marker/trait.Unpin.js b/docs/doc/implementors/core/marker/trait.Unpin.js deleted file mode 100644 index 903801d..0000000 --- a/docs/doc/implementors/core/marker/trait.Unpin.js +++ /dev/null @@ -1,7 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[["impl Unpin for ButtonSet",1,["arduboy_rust::hardware::buttons::ButtonSet"]],["impl Unpin for Color",1,["arduboy_rust::library::arduboy2::Color"]],["impl Unpin for Rect",1,["arduboy_rust::library::arduboy2::Rect"]],["impl Unpin for Point",1,["arduboy_rust::library::arduboy2::Point"]],["impl Unpin for Arduboy2",1,["arduboy_rust::library::arduboy2::Arduboy2"]],["impl Unpin for ArduboyTones",1,["arduboy_rust::library::arduboy_tone::ArduboyTones"]],["impl Unpin for ArdVoice",1,["arduboy_rust::library::ardvoice::ArdVoice"]],["impl Unpin for EEPROM",1,["arduboy_rust::library::eeprom::EEPROM"]],["impl Unpin for EEPROMBYTE",1,["arduboy_rust::library::eeprom::EEPROMBYTE"]],["impl Unpin for EEPROMBYTECHECKLESS",1,["arduboy_rust::library::eeprom::EEPROMBYTECHECKLESS"]],["impl Unpin for Base",1,["arduboy_rust::print::Base"]]], -"byteorder":[["impl Unpin for BigEndian",1,["byteorder::BigEndian"]],["impl Unpin for LittleEndian",1,["byteorder::LittleEndian"]]], -"critical_section":[["impl<T> Unpin for Mutex<T>where\n T: Unpin,",1,["critical_section::mutex::Mutex"]],["impl<'cs> Unpin for CriticalSection<'cs>",1,["critical_section::CriticalSection"]],["impl Unpin for RestoreState",1,["critical_section::RestoreState"]]], -"hash32":[["impl Unpin for Hasher",1,["hash32::fnv::Hasher"]],["impl Unpin for Hasher",1,["hash32::murmur3::Hasher"]],["impl<H> Unpin for BuildHasherDefault<H>where\n H: Unpin,",1,["hash32::BuildHasherDefault"]]], -"heapless":[["impl<T, const N: usize> Unpin for Deque<T, N>where\n T: Unpin,",1,["heapless::deque::Deque"]],["impl<T, const N: usize> Unpin for HistoryBuffer<T, N>where\n T: Unpin,",1,["heapless::histbuf::HistoryBuffer"]],["impl<'a, T, const N: usize> Unpin for OldestOrdered<'a, T, N>",1,["heapless::histbuf::OldestOrdered"]],["impl<'a, K, V, const N: usize> Unpin for Entry<'a, K, V, N>where\n K: Unpin,",1,["heapless::indexmap::Entry"]],["impl<'a, K, V, const N: usize> Unpin for OccupiedEntry<'a, K, V, N>where\n K: Unpin,",1,["heapless::indexmap::OccupiedEntry"]],["impl<'a, K, V, const N: usize> Unpin for VacantEntry<'a, K, V, N>where\n K: Unpin,",1,["heapless::indexmap::VacantEntry"]],["impl<K, V, S, const N: usize> Unpin for IndexMap<K, V, S, N>where\n K: Unpin,\n S: Unpin,\n V: Unpin,",1,["heapless::indexmap::IndexMap"]],["impl<T, S, const N: usize> Unpin for IndexSet<T, S, N>where\n S: Unpin,\n T: Unpin,",1,["heapless::indexset::IndexSet"]],["impl<K, V, const N: usize> Unpin for LinearMap<K, V, N>where\n K: Unpin,\n V: Unpin,",1,["heapless::linear_map::LinearMap"]],["impl<const N: usize> Unpin for String<N>",1,["heapless::string::String"]],["impl<T, const N: usize> Unpin for Vec<T, N>where\n T: Unpin,",1,["heapless::vec::Vec"]],["impl Unpin for Min",1,["heapless::binary_heap::Min"]],["impl Unpin for Max",1,["heapless::binary_heap::Max"]],["impl<T, K, const N: usize> Unpin for BinaryHeap<T, K, N>where\n K: Unpin,\n T: Unpin,",1,["heapless::binary_heap::BinaryHeap"]],["impl<'a, T, K, const N: usize> Unpin for PeekMut<'a, T, K, N>",1,["heapless::binary_heap::PeekMut"]],["impl Unpin for Min",1,["heapless::sorted_linked_list::Min"]],["impl Unpin for Max",1,["heapless::sorted_linked_list::Max"]],["impl<T, Idx> Unpin for Node<T, Idx>where\n Idx: Unpin,\n T: Unpin,",1,["heapless::sorted_linked_list::Node"]],["impl<T, Idx, K, const N: usize> Unpin for SortedLinkedList<T, Idx, K, N>where\n Idx: Unpin,\n K: Unpin,\n T: Unpin,",1,["heapless::sorted_linked_list::SortedLinkedList"]],["impl Unpin for LinkedIndexU8",1,["heapless::sorted_linked_list::LinkedIndexU8"]],["impl Unpin for LinkedIndexU16",1,["heapless::sorted_linked_list::LinkedIndexU16"]],["impl Unpin for LinkedIndexUsize",1,["heapless::sorted_linked_list::LinkedIndexUsize"]],["impl<'a, T, Idx, K, const N: usize> Unpin for Iter<'a, T, Idx, K, N>where\n Idx: Unpin,",1,["heapless::sorted_linked_list::Iter"]],["impl<'a, T, Idx, K, const N: usize> Unpin for FindMut<'a, T, Idx, K, N>where\n Idx: Unpin,",1,["heapless::sorted_linked_list::FindMut"]]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/ops/bit/trait.BitOr.js b/docs/doc/implementors/core/ops/bit/trait.BitOr.js deleted file mode 100644 index c771025..0000000 --- a/docs/doc/implementors/core/ops/bit/trait.BitOr.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[["impl BitOr<ButtonSet> for ButtonSet"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/ops/bit/trait.Not.js b/docs/doc/implementors/core/ops/bit/trait.Not.js deleted file mode 100644 index 306e798..0000000 --- a/docs/doc/implementors/core/ops/bit/trait.Not.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[["impl Not for Color"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/ops/deref/trait.Deref.js b/docs/doc/implementors/core/ops/deref/trait.Deref.js deleted file mode 100644 index 92fda64..0000000 --- a/docs/doc/implementors/core/ops/deref/trait.Deref.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"heapless":[["impl<T, K, const N: usize> Deref for PeekMut<'_, T, K, N>where\n T: Ord,\n K: Kind,"],["impl<T, const N: usize> Deref for HistoryBuffer<T, N>"],["impl<const N: usize> Deref for String<N>"],["impl<T, Idx, K, const N: usize> Deref for FindMut<'_, T, Idx, K, N>where\n T: Ord,\n Idx: SortedLinkedListIndex,\n K: Kind,"],["impl<T, const N: usize> Deref for Vec<T, N>"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/ops/deref/trait.DerefMut.js b/docs/doc/implementors/core/ops/deref/trait.DerefMut.js deleted file mode 100644 index 32710a5..0000000 --- a/docs/doc/implementors/core/ops/deref/trait.DerefMut.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"heapless":[["impl<const N: usize> DerefMut for String<N>"],["impl<T, const N: usize> DerefMut for Vec<T, N>"],["impl<T, K, const N: usize> DerefMut for PeekMut<'_, T, K, N>where\n T: Ord,\n K: Kind,"],["impl<T, Idx, K, const N: usize> DerefMut for FindMut<'_, T, Idx, K, N>where\n T: Ord,\n Idx: SortedLinkedListIndex,\n K: Kind,"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/ops/drop/trait.Drop.js b/docs/doc/implementors/core/ops/drop/trait.Drop.js deleted file mode 100644 index ed6dd4e..0000000 --- a/docs/doc/implementors/core/ops/drop/trait.Drop.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"heapless":[["impl<T, const N: usize> Drop for Deque<T, N>"],["impl<T, const N: usize> Drop for HistoryBuffer<T, N>"],["impl<T, Idx, K, const N: usize> Drop for SortedLinkedList<T, Idx, K, N>where\n Idx: SortedLinkedListIndex,"],["impl<T, const N: usize> Drop for Vec<T, N>"],["impl<T, K, const N: usize> Drop for PeekMut<'_, T, K, N>where\n T: Ord,\n K: Kind,"],["impl<K, V, const N: usize> Drop for LinearMap<K, V, N>"],["impl<T, Idx, K, const N: usize> Drop for FindMut<'_, T, Idx, K, N>where\n T: Ord,\n Idx: SortedLinkedListIndex,\n K: Kind,"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/ops/index/trait.Index.js b/docs/doc/implementors/core/ops/index/trait.Index.js deleted file mode 100644 index 52fd8d9..0000000 --- a/docs/doc/implementors/core/ops/index/trait.Index.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"heapless":[["impl<'a, K, Q, V, S, const N: usize> Index<&'a Q> for IndexMap<K, V, S, N>where\n K: Eq + Hash + Borrow<Q>,\n Q: ?Sized + Eq + Hash,\n S: BuildHasher,"],["impl<'a, K, V, Q, const N: usize> Index<&'a Q> for LinearMap<K, V, N>where\n K: Borrow<Q> + Eq,\n Q: Eq + ?Sized,"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/ops/index/trait.IndexMut.js b/docs/doc/implementors/core/ops/index/trait.IndexMut.js deleted file mode 100644 index 4667b34..0000000 --- a/docs/doc/implementors/core/ops/index/trait.IndexMut.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"heapless":[["impl<'a, K, V, Q, const N: usize> IndexMut<&'a Q> for LinearMap<K, V, N>where\n K: Borrow<Q> + Eq,\n Q: Eq + ?Sized,"],["impl<'a, K, Q, V, S, const N: usize> IndexMut<&'a Q> for IndexMap<K, V, S, N>where\n K: Eq + Hash + Borrow<Q>,\n Q: ?Sized + Eq + Hash,\n S: BuildHasher,"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js b/docs/doc/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js deleted file mode 100644 index 92265ab..0000000 --- a/docs/doc/implementors/core/panic/unwind_safe/trait.RefUnwindSafe.js +++ /dev/null @@ -1,7 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[["impl RefUnwindSafe for ButtonSet",1,["arduboy_rust::hardware::buttons::ButtonSet"]],["impl RefUnwindSafe for Color",1,["arduboy_rust::library::arduboy2::Color"]],["impl RefUnwindSafe for Rect",1,["arduboy_rust::library::arduboy2::Rect"]],["impl RefUnwindSafe for Point",1,["arduboy_rust::library::arduboy2::Point"]],["impl RefUnwindSafe for Arduboy2",1,["arduboy_rust::library::arduboy2::Arduboy2"]],["impl RefUnwindSafe for ArduboyTones",1,["arduboy_rust::library::arduboy_tone::ArduboyTones"]],["impl RefUnwindSafe for ArdVoice",1,["arduboy_rust::library::ardvoice::ArdVoice"]],["impl RefUnwindSafe for EEPROM",1,["arduboy_rust::library::eeprom::EEPROM"]],["impl RefUnwindSafe for EEPROMBYTE",1,["arduboy_rust::library::eeprom::EEPROMBYTE"]],["impl RefUnwindSafe for EEPROMBYTECHECKLESS",1,["arduboy_rust::library::eeprom::EEPROMBYTECHECKLESS"]],["impl RefUnwindSafe for Base",1,["arduboy_rust::print::Base"]]], -"byteorder":[["impl RefUnwindSafe for BigEndian",1,["byteorder::BigEndian"]],["impl RefUnwindSafe for LittleEndian",1,["byteorder::LittleEndian"]]], -"critical_section":[["impl<T> !RefUnwindSafe for Mutex<T>",1,["critical_section::mutex::Mutex"]],["impl<'cs> RefUnwindSafe for CriticalSection<'cs>",1,["critical_section::CriticalSection"]],["impl RefUnwindSafe for RestoreState",1,["critical_section::RestoreState"]]], -"hash32":[["impl RefUnwindSafe for Hasher",1,["hash32::fnv::Hasher"]],["impl RefUnwindSafe for Hasher",1,["hash32::murmur3::Hasher"]],["impl<H> RefUnwindSafe for BuildHasherDefault<H>where\n H: RefUnwindSafe,",1,["hash32::BuildHasherDefault"]]], -"heapless":[["impl<T, const N: usize> RefUnwindSafe for Deque<T, N>where\n T: RefUnwindSafe,",1,["heapless::deque::Deque"]],["impl<T, const N: usize> RefUnwindSafe for HistoryBuffer<T, N>where\n T: RefUnwindSafe,",1,["heapless::histbuf::HistoryBuffer"]],["impl<'a, T, const N: usize> RefUnwindSafe for OldestOrdered<'a, T, N>where\n T: RefUnwindSafe,",1,["heapless::histbuf::OldestOrdered"]],["impl<'a, K, V, const N: usize> RefUnwindSafe for Entry<'a, K, V, N>where\n K: RefUnwindSafe,\n V: RefUnwindSafe,",1,["heapless::indexmap::Entry"]],["impl<'a, K, V, const N: usize> RefUnwindSafe for OccupiedEntry<'a, K, V, N>where\n K: RefUnwindSafe,\n V: RefUnwindSafe,",1,["heapless::indexmap::OccupiedEntry"]],["impl<'a, K, V, const N: usize> RefUnwindSafe for VacantEntry<'a, K, V, N>where\n K: RefUnwindSafe,\n V: RefUnwindSafe,",1,["heapless::indexmap::VacantEntry"]],["impl<K, V, S, const N: usize> RefUnwindSafe for IndexMap<K, V, S, N>where\n K: RefUnwindSafe,\n S: RefUnwindSafe,\n V: RefUnwindSafe,",1,["heapless::indexmap::IndexMap"]],["impl<T, S, const N: usize> RefUnwindSafe for IndexSet<T, S, N>where\n S: RefUnwindSafe,\n T: RefUnwindSafe,",1,["heapless::indexset::IndexSet"]],["impl<K, V, const N: usize> RefUnwindSafe for LinearMap<K, V, N>where\n K: RefUnwindSafe,\n V: RefUnwindSafe,",1,["heapless::linear_map::LinearMap"]],["impl<const N: usize> RefUnwindSafe for String<N>",1,["heapless::string::String"]],["impl<T, const N: usize> RefUnwindSafe for Vec<T, N>where\n T: RefUnwindSafe,",1,["heapless::vec::Vec"]],["impl RefUnwindSafe for Min",1,["heapless::binary_heap::Min"]],["impl RefUnwindSafe for Max",1,["heapless::binary_heap::Max"]],["impl<T, K, const N: usize> RefUnwindSafe for BinaryHeap<T, K, N>where\n K: RefUnwindSafe,\n T: RefUnwindSafe,",1,["heapless::binary_heap::BinaryHeap"]],["impl<'a, T, K, const N: usize> RefUnwindSafe for PeekMut<'a, T, K, N>where\n K: RefUnwindSafe,\n T: RefUnwindSafe,",1,["heapless::binary_heap::PeekMut"]],["impl RefUnwindSafe for Min",1,["heapless::sorted_linked_list::Min"]],["impl RefUnwindSafe for Max",1,["heapless::sorted_linked_list::Max"]],["impl<T, Idx> RefUnwindSafe for Node<T, Idx>where\n Idx: RefUnwindSafe,\n T: RefUnwindSafe,",1,["heapless::sorted_linked_list::Node"]],["impl<T, Idx, K, const N: usize> RefUnwindSafe for SortedLinkedList<T, Idx, K, N>where\n Idx: RefUnwindSafe,\n K: RefUnwindSafe,\n T: RefUnwindSafe,",1,["heapless::sorted_linked_list::SortedLinkedList"]],["impl RefUnwindSafe for LinkedIndexU8",1,["heapless::sorted_linked_list::LinkedIndexU8"]],["impl RefUnwindSafe for LinkedIndexU16",1,["heapless::sorted_linked_list::LinkedIndexU16"]],["impl RefUnwindSafe for LinkedIndexUsize",1,["heapless::sorted_linked_list::LinkedIndexUsize"]],["impl<'a, T, Idx, K, const N: usize> RefUnwindSafe for Iter<'a, T, Idx, K, N>where\n Idx: RefUnwindSafe,\n K: RefUnwindSafe,\n T: RefUnwindSafe,",1,["heapless::sorted_linked_list::Iter"]],["impl<'a, T, Idx, K, const N: usize> RefUnwindSafe for FindMut<'a, T, Idx, K, N>where\n Idx: RefUnwindSafe,\n K: RefUnwindSafe,\n T: RefUnwindSafe,",1,["heapless::sorted_linked_list::FindMut"]]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/panic/unwind_safe/trait.UnwindSafe.js b/docs/doc/implementors/core/panic/unwind_safe/trait.UnwindSafe.js deleted file mode 100644 index 2374098..0000000 --- a/docs/doc/implementors/core/panic/unwind_safe/trait.UnwindSafe.js +++ /dev/null @@ -1,7 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[["impl UnwindSafe for ButtonSet",1,["arduboy_rust::hardware::buttons::ButtonSet"]],["impl UnwindSafe for Color",1,["arduboy_rust::library::arduboy2::Color"]],["impl UnwindSafe for Rect",1,["arduboy_rust::library::arduboy2::Rect"]],["impl UnwindSafe for Point",1,["arduboy_rust::library::arduboy2::Point"]],["impl UnwindSafe for Arduboy2",1,["arduboy_rust::library::arduboy2::Arduboy2"]],["impl UnwindSafe for ArduboyTones",1,["arduboy_rust::library::arduboy_tone::ArduboyTones"]],["impl UnwindSafe for ArdVoice",1,["arduboy_rust::library::ardvoice::ArdVoice"]],["impl UnwindSafe for EEPROM",1,["arduboy_rust::library::eeprom::EEPROM"]],["impl UnwindSafe for EEPROMBYTE",1,["arduboy_rust::library::eeprom::EEPROMBYTE"]],["impl UnwindSafe for EEPROMBYTECHECKLESS",1,["arduboy_rust::library::eeprom::EEPROMBYTECHECKLESS"]],["impl UnwindSafe for Base",1,["arduboy_rust::print::Base"]]], -"byteorder":[["impl UnwindSafe for BigEndian",1,["byteorder::BigEndian"]],["impl UnwindSafe for LittleEndian",1,["byteorder::LittleEndian"]]], -"critical_section":[["impl<T> UnwindSafe for Mutex<T>where\n T: UnwindSafe,",1,["critical_section::mutex::Mutex"]],["impl<'cs> UnwindSafe for CriticalSection<'cs>",1,["critical_section::CriticalSection"]],["impl UnwindSafe for RestoreState",1,["critical_section::RestoreState"]]], -"hash32":[["impl UnwindSafe for Hasher",1,["hash32::fnv::Hasher"]],["impl UnwindSafe for Hasher",1,["hash32::murmur3::Hasher"]],["impl<H> UnwindSafe for BuildHasherDefault<H>where\n H: UnwindSafe,",1,["hash32::BuildHasherDefault"]]], -"heapless":[["impl<T, const N: usize> UnwindSafe for Deque<T, N>where\n T: UnwindSafe,",1,["heapless::deque::Deque"]],["impl<T, const N: usize> UnwindSafe for HistoryBuffer<T, N>where\n T: UnwindSafe,",1,["heapless::histbuf::HistoryBuffer"]],["impl<'a, T, const N: usize> UnwindSafe for OldestOrdered<'a, T, N>where\n T: RefUnwindSafe,",1,["heapless::histbuf::OldestOrdered"]],["impl<'a, K, V, const N: usize> !UnwindSafe for Entry<'a, K, V, N>",1,["heapless::indexmap::Entry"]],["impl<'a, K, V, const N: usize> !UnwindSafe for OccupiedEntry<'a, K, V, N>",1,["heapless::indexmap::OccupiedEntry"]],["impl<'a, K, V, const N: usize> !UnwindSafe for VacantEntry<'a, K, V, N>",1,["heapless::indexmap::VacantEntry"]],["impl<K, V, S, const N: usize> UnwindSafe for IndexMap<K, V, S, N>where\n K: UnwindSafe,\n S: UnwindSafe,\n V: UnwindSafe,",1,["heapless::indexmap::IndexMap"]],["impl<T, S, const N: usize> UnwindSafe for IndexSet<T, S, N>where\n S: UnwindSafe,\n T: UnwindSafe,",1,["heapless::indexset::IndexSet"]],["impl<K, V, const N: usize> UnwindSafe for LinearMap<K, V, N>where\n K: UnwindSafe,\n V: UnwindSafe,",1,["heapless::linear_map::LinearMap"]],["impl<const N: usize> UnwindSafe for String<N>",1,["heapless::string::String"]],["impl<T, const N: usize> UnwindSafe for Vec<T, N>where\n T: UnwindSafe,",1,["heapless::vec::Vec"]],["impl UnwindSafe for Min",1,["heapless::binary_heap::Min"]],["impl UnwindSafe for Max",1,["heapless::binary_heap::Max"]],["impl<T, K, const N: usize> UnwindSafe for BinaryHeap<T, K, N>where\n K: UnwindSafe,\n T: UnwindSafe,",1,["heapless::binary_heap::BinaryHeap"]],["impl<'a, T, K, const N: usize> !UnwindSafe for PeekMut<'a, T, K, N>",1,["heapless::binary_heap::PeekMut"]],["impl UnwindSafe for Min",1,["heapless::sorted_linked_list::Min"]],["impl UnwindSafe for Max",1,["heapless::sorted_linked_list::Max"]],["impl<T, Idx> UnwindSafe for Node<T, Idx>where\n Idx: UnwindSafe,\n T: UnwindSafe,",1,["heapless::sorted_linked_list::Node"]],["impl<T, Idx, K, const N: usize> UnwindSafe for SortedLinkedList<T, Idx, K, N>where\n Idx: UnwindSafe,\n K: UnwindSafe,\n T: UnwindSafe,",1,["heapless::sorted_linked_list::SortedLinkedList"]],["impl UnwindSafe for LinkedIndexU8",1,["heapless::sorted_linked_list::LinkedIndexU8"]],["impl UnwindSafe for LinkedIndexU16",1,["heapless::sorted_linked_list::LinkedIndexU16"]],["impl UnwindSafe for LinkedIndexUsize",1,["heapless::sorted_linked_list::LinkedIndexUsize"]],["impl<'a, T, Idx, K, const N: usize> UnwindSafe for Iter<'a, T, Idx, K, N>where\n Idx: UnwindSafe + RefUnwindSafe,\n K: RefUnwindSafe,\n T: RefUnwindSafe,",1,["heapless::sorted_linked_list::Iter"]],["impl<'a, T, Idx, K, const N: usize> !UnwindSafe for FindMut<'a, T, Idx, K, N>",1,["heapless::sorted_linked_list::FindMut"]]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/core/str/traits/trait.FromStr.js b/docs/doc/implementors/core/str/traits/trait.FromStr.js deleted file mode 100644 index 3760537..0000000 --- a/docs/doc/implementors/core/str/traits/trait.FromStr.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"heapless":[["impl<const N: usize> FromStr for String<N>"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/hash32/trait.BuildHasher.js b/docs/doc/implementors/hash32/trait.BuildHasher.js deleted file mode 100644 index e54f64a..0000000 --- a/docs/doc/implementors/hash32/trait.BuildHasher.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"hash32":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/hash32/trait.Hash.js b/docs/doc/implementors/hash32/trait.Hash.js deleted file mode 100644 index 1bd6f6d..0000000 --- a/docs/doc/implementors/hash32/trait.Hash.js +++ /dev/null @@ -1,4 +0,0 @@ -(function() {var implementors = { -"hash32":[], -"heapless":[["impl<const N: usize> Hash for String<N>"],["impl<T, const N: usize> Hash for Vec<T, N>where\n T: Hash,"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/hash32/trait.Hasher.js b/docs/doc/implementors/hash32/trait.Hasher.js deleted file mode 100644 index e54f64a..0000000 --- a/docs/doc/implementors/hash32/trait.Hasher.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"hash32":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/heapless/binary_heap/trait.Kind.js b/docs/doc/implementors/heapless/binary_heap/trait.Kind.js deleted file mode 100644 index fd4f746..0000000 --- a/docs/doc/implementors/heapless/binary_heap/trait.Kind.js +++ /dev/null @@ -1,4 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[], -"heapless":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/heapless/sorted_linked_list/trait.Kind.js b/docs/doc/implementors/heapless/sorted_linked_list/trait.Kind.js deleted file mode 100644 index fd4f746..0000000 --- a/docs/doc/implementors/heapless/sorted_linked_list/trait.Kind.js +++ /dev/null @@ -1,4 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[], -"heapless":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/heapless/sorted_linked_list/trait.SortedLinkedListIndex.js b/docs/doc/implementors/heapless/sorted_linked_list/trait.SortedLinkedListIndex.js deleted file mode 100644 index fd4f746..0000000 --- a/docs/doc/implementors/heapless/sorted_linked_list/trait.SortedLinkedListIndex.js +++ /dev/null @@ -1,4 +0,0 @@ -(function() {var implementors = { -"arduboy_rust":[], -"heapless":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/stable_deref_trait/trait.CloneStableDeref.js b/docs/doc/implementors/stable_deref_trait/trait.CloneStableDeref.js deleted file mode 100644 index ac9dfad..0000000 --- a/docs/doc/implementors/stable_deref_trait/trait.CloneStableDeref.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"stable_deref_trait":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/implementors/stable_deref_trait/trait.StableDeref.js b/docs/doc/implementors/stable_deref_trait/trait.StableDeref.js deleted file mode 100644 index ac9dfad..0000000 --- a/docs/doc/implementors/stable_deref_trait/trait.StableDeref.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"stable_deref_trait":[] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/docs/doc/panic_halt/all.html b/docs/doc/panic_halt/all.html deleted file mode 100644 index 746dd8c..0000000 --- a/docs/doc/panic_halt/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

\ No newline at end of file diff --git a/docs/doc/panic_halt/index.html b/docs/doc/panic_halt/index.html deleted file mode 100644 index e5b2eaf..0000000 --- a/docs/doc/panic_halt/index.html +++ /dev/null @@ -1,14 +0,0 @@ -panic_halt - Rust

Crate panic_halt

source ·
Expand description

Set the panicking behavior to halt

-

This crate contains an implementation of panic_fmt that simply halt in an infinite loop.

-

Usage

-
#![no_std]
-
-extern crate panic_halt;
-
-fn main() {
-    panic!("argument is ignored");
-}
-

Breakable symbols

-

With the panic handler being #[inline(never)] the symbol rust_begin_unwind will be -available to place a breakpoint on to halt when a panic is happening.

-
\ No newline at end of file diff --git a/docs/doc/panic_halt/sidebar-items.js b/docs/doc/panic_halt/sidebar-items.js deleted file mode 100644 index 5244ce0..0000000 --- a/docs/doc/panic_halt/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {}; \ No newline at end of file diff --git a/docs/doc/search-index.js b/docs/doc/search-index.js deleted file mode 100644 index 764099d..0000000 --- a/docs/doc/search-index.js +++ /dev/null @@ -1,12 +0,0 @@ -var searchIndex = JSON.parse('{\ -"arduboy_rust":{"doc":"This is the arduboy_rust crate To get started import the …","t":"DDDNEDDRRRNAAAAAOOOOOAAOAADNERRDDRNMMMMMMDARRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRFFFDFAARRRRDRRRRRRRRMLLLLRRRRRDDEGGDDDDNDDDNDDLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDIEEDLLLLLLLLLLLLLLLLLLLLLLLLLDDIDDDDDDDILLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLRRDDDRRRENNDERRNDDDRRRNRRDNQDIRRRRRDDRRDRNAAALLLLLLLLLLLAGGGGGGGGGGGLLLLFKFLLOMLLLLLLLLOLOOOLLMLLLLLLLALLLLLLLKOLFFLLCAFLLLLLLLLLLLLLLLLLMLLMMMMDNERRDDRNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMDALLLLLLLLLLLLLLLLRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRDLLLLLLLLLLLLRRRRDRRRRRRRRMRRRRRFFFFFQQIIFFKKFFLKFLKFFFFFFF","n":["ArdVoice","Arduboy2","ArduboyTones","Black","Color","EEPROM","EEPROMBYTE","FONT_SIZE","HEIGHT","WIDTH","White","arduboy2","arduboy_tone","arduino","ardvoice","c","f","get_ardvoice_tone_addr","get_sprite_addr","get_string_addr","get_tones_addr","hardware","prelude","progmem","serial_print","sprites","Arduboy2","Black","Color","FONT_SIZE","HEIGHT","Point","Rect","WIDTH","White","height","width","x","x","y","y","ArduboyTones","arduboy_tone_pitch","NOTE_A0","NOTE_A0H","NOTE_A1","NOTE_A1H","NOTE_A2","NOTE_A2H","NOTE_A3","NOTE_A3H","NOTE_A4","NOTE_A4H","NOTE_A5","NOTE_A5H","NOTE_A6","NOTE_A6H","NOTE_A7","NOTE_A7H","NOTE_A8","NOTE_A8H","NOTE_A9","NOTE_A9H","NOTE_AS0","NOTE_AS0H","NOTE_AS1","NOTE_AS1H","NOTE_AS2","NOTE_AS2H","NOTE_AS3","NOTE_AS3H","NOTE_AS4","NOTE_AS4H","NOTE_AS5","NOTE_AS5H","NOTE_AS6","NOTE_AS6H","NOTE_AS7","NOTE_AS7H","NOTE_AS8","NOTE_AS8H","NOTE_AS9","NOTE_AS9H","NOTE_B0","NOTE_B0H","NOTE_B1","NOTE_B1H","NOTE_B2","NOTE_B2H","NOTE_B3","NOTE_B3H","NOTE_B4","NOTE_B4H","NOTE_B5","NOTE_B5H","NOTE_B6","NOTE_B6H","NOTE_B7","NOTE_B7H","NOTE_B8","NOTE_B8H","NOTE_B9","NOTE_B9H","NOTE_C0","NOTE_C0H","NOTE_C1","NOTE_C1H","NOTE_C2","NOTE_C2H","NOTE_C3","NOTE_C3H","NOTE_C4","NOTE_C4H","NOTE_C5","NOTE_C5H","NOTE_C6","NOTE_C6H","NOTE_C7","NOTE_C7H","NOTE_C8","NOTE_C8H","NOTE_C9","NOTE_C9H","NOTE_CS0","NOTE_CS0H","NOTE_CS1","NOTE_CS1H","NOTE_CS2","NOTE_CS2H","NOTE_CS3","NOTE_CS3H","NOTE_CS4","NOTE_CS4H","NOTE_CS5","NOTE_CS5H","NOTE_CS6","NOTE_CS6H","NOTE_CS7","NOTE_CS7H","NOTE_CS8","NOTE_CS8H","NOTE_CS9","NOTE_CS9H","NOTE_D0","NOTE_D0H","NOTE_D1","NOTE_D1H","NOTE_D2","NOTE_D2H","NOTE_D3","NOTE_D3H","NOTE_D4","NOTE_D4H","NOTE_D5","NOTE_D5H","NOTE_D6","NOTE_D6H","NOTE_D7","NOTE_D7H","NOTE_D8","NOTE_D8H","NOTE_D9","NOTE_D9H","NOTE_DS0","NOTE_DS0H","NOTE_DS1","NOTE_DS1H","NOTE_DS2","NOTE_DS2H","NOTE_DS3","NOTE_DS3H","NOTE_DS4","NOTE_DS4H","NOTE_DS5","NOTE_DS5H","NOTE_DS6","NOTE_DS6H","NOTE_DS7","NOTE_DS7H","NOTE_DS8","NOTE_DS8H","NOTE_DS9","NOTE_DS9H","NOTE_E0","NOTE_E0H","NOTE_E1","NOTE_E1H","NOTE_E2","NOTE_E2H","NOTE_E3","NOTE_E3H","NOTE_E4","NOTE_E4H","NOTE_E5","NOTE_E5H","NOTE_E6","NOTE_E6H","NOTE_E7","NOTE_E7H","NOTE_E8","NOTE_E8H","NOTE_E9","NOTE_E9H","NOTE_F0","NOTE_F0H","NOTE_F1","NOTE_F1H","NOTE_F2","NOTE_F2H","NOTE_F3","NOTE_F3H","NOTE_F4","NOTE_F4H","NOTE_F5","NOTE_F5H","NOTE_F6","NOTE_F6H","NOTE_F7","NOTE_F7H","NOTE_F8","NOTE_F8H","NOTE_F9","NOTE_F9H","NOTE_FS0","NOTE_FS0H","NOTE_FS1","NOTE_FS1H","NOTE_FS2","NOTE_FS2H","NOTE_FS3","NOTE_FS3H","NOTE_FS4","NOTE_FS4H","NOTE_FS5","NOTE_FS5H","NOTE_FS6","NOTE_FS6H","NOTE_FS7","NOTE_FS7H","NOTE_FS8","NOTE_FS8H","NOTE_FS9","NOTE_FS9H","NOTE_G0","NOTE_G0H","NOTE_G1","NOTE_G1H","NOTE_G2","NOTE_G2H","NOTE_G3","NOTE_G3H","NOTE_G4","NOTE_G4H","NOTE_G5","NOTE_G5H","NOTE_G6","NOTE_G6H","NOTE_G7","NOTE_G7H","NOTE_G8","NOTE_G8H","NOTE_G9","NOTE_G9H","NOTE_GS0","NOTE_GS0H","NOTE_GS1","NOTE_GS1H","NOTE_GS2","NOTE_GS2H","NOTE_GS3","NOTE_GS3H","NOTE_GS4","NOTE_GS4H","NOTE_GS5","NOTE_GS5H","NOTE_GS6","NOTE_GS6H","NOTE_GS7","NOTE_GS7H","NOTE_GS8","NOTE_GS8H","NOTE_GS9","NOTE_GS9H","NOTE_REST","TONES_END","TONES_REPEAT","TONE_HIGH_VOLUME","VOLUME_ALWAYS_HIGH","VOLUME_ALWAYS_NORMAL","VOLUME_IN_TONE","delay","random_between","random_less_than","ArdVoice","strlen","buttons","led","A","A_BUTTON","B","B_BUTTON","ButtonSet","DOWN","DOWN_BUTTON","LEFT","LEFT_BUTTON","RIGHT","RIGHT_BUTTON","UP","UP_BUTTON","flag_set","just_pressed","just_released","not_pressed","pressed","BLUE_LED","GREEN_LED","RED_LED","RGB_OFF","RGB_ON","BinaryHeap","Deque","Entry","FnvIndexMap","FnvIndexSet","HistoryBuffer","IndexMap","IndexSet","LinearMap","Occupied","OccupiedEntry","OldestOrdered","String","Vacant","VacantEntry","Vec","as_mut","as_mut","as_mut_ptr","as_mut_slices","as_mut_str","as_mut_vec","as_ptr","as_ref","as_ref","as_ref","as_ref","as_ref","as_slice","as_slice","as_slices","as_str","back","back_mut","binary_heap","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","capacity","capacity","capacity","capacity","capacity","capacity","capacity","capacity","clear","clear","clear","clear","clear","clear","clear","clear","clear_with","clone","clone","clone","clone","clone","clone","clone","clone","cmp","cmp","contains","contains_key","contains_key","default","default","default","default","default","default","default","default","default_parameters","default_parameters","default_parameters","deref","deref","deref","deref_mut","deref_mut","difference","drop","drop","drop","drop","ends_with","entry","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","extend","extend","extend","extend","extend","extend","extend","extend","extend","extend_from_slice","extend_from_slice","first","first","first_mut","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_iter","from_iter","from_iter","from_iter","from_iter","from_iter","from_iter","from_slice","from_str","front","front_mut","get","get","get","get_mut","get_mut","get_mut","hash","hash","hash","hash","index","index","index_mut","index_mut","insert","insert","insert","insert","insert","insert","intersection","into","into","into","into","into","into","into","into","into","into","into","into","into_array","into_bytes","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_key","into_mut","into_vec","is_disjoint","is_empty","is_empty","is_empty","is_empty","is_empty","is_empty","is_full","is_full","is_subset","is_superset","iter","iter","iter","iter","iter","iter_mut","iter_mut","iter_mut","iter_mut","key","key","keys","keys","last","last","last_mut","len","len","len","len","len","len","ne","ne","ne","new","new","new","new","new","new","new","new","new_with","next","oldest_ordered","partial_cmp","partial_cmp","peek","peek_mut","pop","pop","pop","pop_back","pop_back_unchecked","pop_front","pop_front_unchecked","pop_unchecked","pop_unchecked","print_2","print_2","println_2","push","push","push","push_back","push_back_unchecked","push_front","push_front_unchecked","push_str","push_unchecked","push_unchecked","recent","remove","remove","remove","remove","remove","remove_entry","resize","resize_default","retain","retain_mut","set_len","sorted_linked_list","starts_with","swap_remove","swap_remove","swap_remove_unchecked","symmetric_difference","truncate","truncate","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","union","values","values","values_mut","values_mut","write","write_char","write_str","write_str","BinaryHeap","Kind","Max","Min","PeekMut","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","deref","deref_mut","drop","from","from","from","into","into","into","pop","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","FindMut","Iter","Kind","LinkedIndexU16","LinkedIndexU8","LinkedIndexUsize","Max","Min","Node","SortedLinkedList","SortedLinkedListIndex","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","cmp","cmp","cmp","deref","deref_mut","drop","drop","eq","eq","eq","find_mut","finish","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","into","into","into","into","into","into","into","into","into","into_iter","is_empty","is_full","iter","new_u16","new_u8","new_usize","next","partial_cmp","partial_cmp","partial_cmp","peek","pop","pop","pop_unchecked","push","push_unchecked","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","A","A_BUTTON","ArdVoice","Arduboy2","ArduboyTones","B","BLUE_LED","B_BUTTON","Base","Bin","Black","ButtonSet","Color","DOWN","DOWN_BUTTON","Dec","EEPROM","EEPROMBYTE","EEPROMBYTECHECKLESS","FONT_SIZE","GREEN_LED","HEIGHT","Hex","LEFT","LEFT_BUTTON","LinearMap","Oct","Parameters","Point","Printable","RED_LED","RGB_OFF","RGB_ON","RIGHT","RIGHT_BUTTON","Rect","String","UP","UP_BUTTON","Vec","WIDTH","White","arduboy2","arduboy_tone","ardvoice","bitor","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","buttons","c_char","c_double","c_float","c_int","c_long","c_longlong","c_size_t","c_uchar","c_uint","c_ulong","c_ulonglong","clone","clone","cmp","cmp","constrain","default_parameters","delay","eq","eq","f","flag_set","fmt","fmt","from","from","from","from","from","get","get_ardvoice_tone_addr","get_direct","get_sprite_addr","get_string_addr","get_tones_addr","hash","hash","height","init","init","into","into","into","into","into","led","new","new","new","partial_cmp","partial_cmp","print","print","print_2","progmem","put","random_between","random_less_than","read","read","serial","sprites","strlen","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","update","update","width","write","write","x","x","y","y","Arduboy2","Black","Color","FONT_SIZE","HEIGHT","Point","Rect","WIDTH","White","audio_enabled","audio_off","audio_on","audio_on_and_save","audio_save_on_off","audio_toggle","begin","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clear","clone","clone","clone","cmp","collide_point","collide_rect","digital_write_rgb","digital_write_rgb_single","display","display_and_clear_buffer","draw_circle","draw_fast_hline","draw_fast_vline","draw_pixel","draw_rect","draw_round_rect","draw_triangle","eq","every_x_frames","fill_circle","fill_rect","fill_round_rect","fill_triangle","flip_horizontal","flip_vertical","fmt","fmt","fmt","from","from","from","from","get_pixel","hash","height","idle","init_random_seed","into","into","into","into","invert","just_pressed","just_released","new","next_frame","not","not_pressed","partial_cmp","poll_buttons","pressed","print","set_cursor","set_cursor_x","set_cursor_y","set_frame_rate","set_rgb_led","set_rgb_led_single","set_text_background_color","set_text_color","set_text_size","set_text_wrap","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","width","x","x","y","y","ArduboyTones","arduboy_tone_pitch","borrow","borrow_mut","from","into","new","no_tone","playing","tone","tone2","tone3","tones","tones_in_ram","try_from","try_into","type_id","volume_mode","NOTE_A0","NOTE_A0H","NOTE_A1","NOTE_A1H","NOTE_A2","NOTE_A2H","NOTE_A3","NOTE_A3H","NOTE_A4","NOTE_A4H","NOTE_A5","NOTE_A5H","NOTE_A6","NOTE_A6H","NOTE_A7","NOTE_A7H","NOTE_A8","NOTE_A8H","NOTE_A9","NOTE_A9H","NOTE_AS0","NOTE_AS0H","NOTE_AS1","NOTE_AS1H","NOTE_AS2","NOTE_AS2H","NOTE_AS3","NOTE_AS3H","NOTE_AS4","NOTE_AS4H","NOTE_AS5","NOTE_AS5H","NOTE_AS6","NOTE_AS6H","NOTE_AS7","NOTE_AS7H","NOTE_AS8","NOTE_AS8H","NOTE_AS9","NOTE_AS9H","NOTE_B0","NOTE_B0H","NOTE_B1","NOTE_B1H","NOTE_B2","NOTE_B2H","NOTE_B3","NOTE_B3H","NOTE_B4","NOTE_B4H","NOTE_B5","NOTE_B5H","NOTE_B6","NOTE_B6H","NOTE_B7","NOTE_B7H","NOTE_B8","NOTE_B8H","NOTE_B9","NOTE_B9H","NOTE_C0","NOTE_C0H","NOTE_C1","NOTE_C1H","NOTE_C2","NOTE_C2H","NOTE_C3","NOTE_C3H","NOTE_C4","NOTE_C4H","NOTE_C5","NOTE_C5H","NOTE_C6","NOTE_C6H","NOTE_C7","NOTE_C7H","NOTE_C8","NOTE_C8H","NOTE_C9","NOTE_C9H","NOTE_CS0","NOTE_CS0H","NOTE_CS1","NOTE_CS1H","NOTE_CS2","NOTE_CS2H","NOTE_CS3","NOTE_CS3H","NOTE_CS4","NOTE_CS4H","NOTE_CS5","NOTE_CS5H","NOTE_CS6","NOTE_CS6H","NOTE_CS7","NOTE_CS7H","NOTE_CS8","NOTE_CS8H","NOTE_CS9","NOTE_CS9H","NOTE_D0","NOTE_D0H","NOTE_D1","NOTE_D1H","NOTE_D2","NOTE_D2H","NOTE_D3","NOTE_D3H","NOTE_D4","NOTE_D4H","NOTE_D5","NOTE_D5H","NOTE_D6","NOTE_D6H","NOTE_D7","NOTE_D7H","NOTE_D8","NOTE_D8H","NOTE_D9","NOTE_D9H","NOTE_DS0","NOTE_DS0H","NOTE_DS1","NOTE_DS1H","NOTE_DS2","NOTE_DS2H","NOTE_DS3","NOTE_DS3H","NOTE_DS4","NOTE_DS4H","NOTE_DS5","NOTE_DS5H","NOTE_DS6","NOTE_DS6H","NOTE_DS7","NOTE_DS7H","NOTE_DS8","NOTE_DS8H","NOTE_DS9","NOTE_DS9H","NOTE_E0","NOTE_E0H","NOTE_E1","NOTE_E1H","NOTE_E2","NOTE_E2H","NOTE_E3","NOTE_E3H","NOTE_E4","NOTE_E4H","NOTE_E5","NOTE_E5H","NOTE_E6","NOTE_E6H","NOTE_E7","NOTE_E7H","NOTE_E8","NOTE_E8H","NOTE_E9","NOTE_E9H","NOTE_F0","NOTE_F0H","NOTE_F1","NOTE_F1H","NOTE_F2","NOTE_F2H","NOTE_F3","NOTE_F3H","NOTE_F4","NOTE_F4H","NOTE_F5","NOTE_F5H","NOTE_F6","NOTE_F6H","NOTE_F7","NOTE_F7H","NOTE_F8","NOTE_F8H","NOTE_F9","NOTE_F9H","NOTE_FS0","NOTE_FS0H","NOTE_FS1","NOTE_FS1H","NOTE_FS2","NOTE_FS2H","NOTE_FS3","NOTE_FS3H","NOTE_FS4","NOTE_FS4H","NOTE_FS5","NOTE_FS5H","NOTE_FS6","NOTE_FS6H","NOTE_FS7","NOTE_FS7H","NOTE_FS8","NOTE_FS8H","NOTE_FS9","NOTE_FS9H","NOTE_G0","NOTE_G0H","NOTE_G1","NOTE_G1H","NOTE_G2","NOTE_G2H","NOTE_G3","NOTE_G3H","NOTE_G4","NOTE_G4H","NOTE_G5","NOTE_G5H","NOTE_G6","NOTE_G6H","NOTE_G7","NOTE_G7H","NOTE_G8","NOTE_G8H","NOTE_G9","NOTE_G9H","NOTE_GS0","NOTE_GS0H","NOTE_GS1","NOTE_GS1H","NOTE_GS2","NOTE_GS2H","NOTE_GS3","NOTE_GS3H","NOTE_GS4","NOTE_GS4H","NOTE_GS5","NOTE_GS5H","NOTE_GS6","NOTE_GS6H","NOTE_GS7","NOTE_GS7H","NOTE_GS8","NOTE_GS8H","NOTE_GS9","NOTE_GS9H","NOTE_REST","TONES_END","TONES_REPEAT","TONE_HIGH_VOLUME","VOLUME_ALWAYS_HIGH","VOLUME_ALWAYS_NORMAL","VOLUME_IN_TONE","ArdVoice","borrow","borrow_mut","from","into","is_voice_playing","new","play_voice","play_voice_complex","stop_voice","try_from","try_into","type_id","A","A_BUTTON","B","B_BUTTON","ButtonSet","DOWN","DOWN_BUTTON","LEFT","LEFT_BUTTON","RIGHT","RIGHT_BUTTON","UP","UP_BUTTON","flag_set","BLUE_LED","GREEN_LED","RED_LED","RGB_OFF","RGB_ON","draw_erase","draw_external_mask","draw_override","draw_plus_mask","draw_self_masked","Parameters","Parameters","Serialprintable","Serialprintlnable","available","begin","default_parameters","default_parameters","end","print","print","print_2","println","println","println_2","read","read_as_utf8_str","draw_erase","draw_external_mask","draw_override","draw_plus_mask","draw_self_masked"],"q":[[0,"arduboy_rust"],[26,"arduboy_rust::arduboy2"],[41,"arduboy_rust::arduboy_tone"],[43,"arduboy_rust::arduboy_tone::arduboy_tone_pitch"],[290,"arduboy_rust::arduino"],[293,"arduboy_rust::ardvoice"],[294,"arduboy_rust::c"],[295,"arduboy_rust::hardware"],[297,"arduboy_rust::hardware::buttons"],[315,"arduboy_rust::hardware::led"],[320,"arduboy_rust::heapless"],[689,"arduboy_rust::heapless::binary_heap"],[719,"arduboy_rust::heapless::sorted_linked_list"],[829,"arduboy_rust::prelude"],[973,"arduboy_rust::prelude::arduboy2"],[1077,"arduboy_rust::prelude::arduboy_tone"],[1095,"arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch"],[1342,"arduboy_rust::prelude::ardvoice"],[1355,"arduboy_rust::prelude::buttons"],[1369,"arduboy_rust::prelude::led"],[1374,"arduboy_rust::prelude::sprites"],[1379,"arduboy_rust::serial_print"],[1396,"arduboy_rust::sprites"],[1401,"core::option"],[1402,"core::cmp"],[1403,"hash32"],[1404,"hash32"],[1405,"core::clone"],[1406,"core::cmp"],[1407,"core::default"],[1408,"heapless::indexset"],[1409,"core::cmp"],[1410,"core::result"],[1411,"core::fmt"],[1412,"core::fmt"],[1413,"hash32"],[1414,"heapless::indexmap"],[1415,"heapless::indexset"],[1416,"core::slice::iter"],[1417,"heapless::deque"],[1418,"hash32"],[1419,"core::any"],[1420,"core::fmt"]],"d":["This is the struct to interact in a save way with the …","This is the struct to interact in a save way with the …","This is the struct to interact in a save way with the …","Led is off","This item is to chose between Black or White","This is the struct to store and read structs objects …","Use this struct to store and read single bytes to/from …","The standard font size of the arduboy","The standard height of the arduboy","The standard width of the arduboy","Led is on","This is the Module to interact in a save way with the …","This is the Module to interact in a save way with the …","This is the Module to interact in a save way with the …","This is the Module to interact in a save way with the …","Clib functions you can use on the Arduboy","This is the way to go if you want print some random text","Create a const raw pointer to a ardvoice tone as u8, …","Create a const raw pointer to a sprite as u8, without …","Create a const raw pointer to a [u8;_] that saves text, …","Create a const raw pointer to a tone sequenze as u16, …","This is the Module to interact in a save way with the …","This is the important one to use this library effective in …","Create a space for Progmem variable","This is the Module to interact in a save way with the …","This is the module to interact in a save way with the …","This is the struct to interact in a save way with the …","Led is off","This item is to chose between Black or White","The standard font size of the arduboy","The standard height of the arduboy","This struct is used by a few Arduboy functions.","This struct is used by a few Arduboy functions.","The standard width of the arduboy","Led is on","Rect height","Rect width","Position X","Position X","Position Y","Position Y","This is the struct to interact in a save way with the …","A list of all tones available and used by the Sounds …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A Arduino function to pause the cpu circles for a given …","A Arduino function to get a random number between 2 numbers","A Arduino function to get a random number smaller than the …","This is the struct to interact in a save way with the …","A C function to get the length of a string","A list of all six buttons available on the Arduboy","A list of all LED variables available","Just a const for the A button","Just a const for the A button","Just a const for the B button","Just a const for the B button","This struct gives the library a understanding what Buttons …","Just a const for the DOWN button","Just a const for the DOWN button","Just a const for the LEFT button","Just a const for the LEFT button","Just a const for the RIGHT button","Just a const for the RIGHT button","Just a const for the UP button","Just a const for the UP button","","","","","","Just a const for the blue led","Just a const for the green led","Just a const for the red led","Just a const for led off","Just a const for led on","A priority queue implemented with a binary heap.","A fixed capacity double-ended queue.","A view into an entry in the map","A heapless::IndexMap using the default FNV hasher","A heapless::IndexSet using the default FNV hasher. A list …","A “history buffer”, similar to a write-only ring …","Fixed capacity IndexMap","Fixed capacity IndexSet.","A fixed capacity map / dictionary that performs lookups …","The entry corresponding to the key K exists in the map","An occupied entry which can be manipulated","An iterator on the underlying buffer ordered from oldest …","A fixed capacity String","The entry corresponding to the key K does not exist in the …","A view into an empty slot in the underlying map","A fixed capacity Vec","","","Returns a raw pointer to the vector’s buffer, which may …","Returns a pair of mutable slices which contain, in order, …","Converts a String into a mutable string slice.","Returns a mutable reference to the contents of this String.","Returns a raw pointer to the vector’s buffer.","","","","","","Returns the array slice backing the buffer, without …","Extracts a slice containing the entire vector.","Returns a pair of slices which contain, in order, the …","Extracts a string slice containing the entire string.","Provides a reference to the back element, or None if the …","Provides a mutable reference to the back element, or None …","A priority queue implemented with a binary heap.","","","","","","","","","","","","","","","","","","","","","","","","","Returns the maximum number of elements the deque can hold.","Returns the capacity of the buffer, which is the length of …","Returns the number of elements the map can hold","Returns the number of elements the set can hold","Returns the number of elements that the map can hold","Returns the maximum number of elements the String can hold","Returns the maximum number of elements the vector can hold.","Returns the capacity of the binary heap.","Clears the deque, removing all values.","Clears the buffer, replacing every element with the …","Remove all key-value pairs in the map, while preserving …","Clears the set, removing all values.","Clears the map, removing all key-value pairs","Truncates this String, removing all contents.","Clears the vector, removing all values.","Drops all items from the binary heap.","Clears the buffer, replacing every element with the given …","","","","","","","","","","","Returns true if the set contains a value.","Returns true if the map contains a value for the specified …","Returns true if the map contains a value for the specified …","","","","","","","","","","","","","","","","","Visits the values representing the difference, i.e. the …","","","","","Returns true if needle is a suffix of the Vec.","Returns an entry for the corresponding key","","","","","","","","","","","","","","","","","","","","Extends the vec from an iterator.","","Clones and writes all elements in a slice to the buffer.","Clones and appends all elements in a slice to the Vec.","Get the first key-value pair","Get the first value","Get the first key-value pair, with mutable access to the …","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","Constructs a new vector with a fixed capacity of N and …","","Provides a reference to the front element, or None if the …","Provides a mutable reference to the front element, or None …","Gets a reference to the value associated with this entry","Returns a reference to the value corresponding to the key.","Returns a reference to the value corresponding to the key","Gets a mutable reference to the value associated with this …","Returns a mutable reference to the value corresponding to …","Returns a mutable reference to the value corresponding to …","","","","","","","","","Overwrites the underlying map’s value with this entry’…","Inserts this entry into to underlying map, yields a …","Inserts a key-value pair into the map.","Adds a value to the set.","Inserts a key-value pair into the map.","Inserts an element at position index within the vector, …","Visits the values representing the intersection, i.e. the …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Returns the contents of the vector as an array of length M …","Converts a String into a byte vector.","","","","","","","","","","","","","","Consumes this entry to yield to key associated with it","Consumes this entry and yields a reference to the …","Returns the underlying Vec<T,N>. Order is arbitrary and …","Returns true if self has no elements in common with other. …","Returns whether the deque is empty.","Returns true if the map contains no elements.","Returns true if the set contains no elements.","Returns true if the map contains no elements","Returns true if the vec is empty","Checks if the binary heap is empty.","Returns whether the deque is full (i.e. if …","Returns true if the vec is full","Returns true if the set is a subset of another, i.e. other …","Examples","Returns an iterator over the deque.","Return an iterator over the key-value pairs of the map, in …","Return an iterator over the values of the set, in their …","An iterator visiting all key-value pairs in arbitrary …","Returns an iterator visiting all values in the underlying …","Returns an iterator that allows modifying each value.","Return an iterator over the key-value pairs of the map, in …","An iterator visiting all key-value pairs in arbitrary …","Returns a mutable iterator visiting all values in the …","Gets a reference to the key that this entity corresponds to","Get the key associated with this entry","Return an iterator over the keys of the map, in their order","An iterator visiting all keys in arbitrary order","Get the last key-value pair","Get the last value","Get the last key-value pair, with mutable access to the …","Returns the number of elements currently in the deque.","Returns the current fill level of the buffer.","Return the number of key-value pairs in the map.","Returns the number of elements in the set.","Returns the number of elements in this map","Returns the length of the binary heap.","","","","Constructs a new, empty deque with a fixed capacity of N","Constructs a new history buffer.","Creates an empty IndexMap.","Creates an empty IndexSet","Creates an empty LinearMap","Constructs a new, empty String with a fixed capacity of N …","Constructs a new, empty vector with a fixed capacity of N","Creates an empty BinaryHeap as a $K-heap.","Constructs a new history buffer, where every element is …","","Returns an iterator for iterating over the buffer from …","","","Returns the top (greatest if max-heap, smallest if …","Returns a mutable reference to the greatest item in the …","Removes the last character from the string buffer and …","Removes the last element from a vector and returns it, or …","Removes the top (greatest if max-heap, smallest if …","Removes the item from the back of the deque and returns …","Removes an item from the back of the deque and returns it, …","Removes the item from the front of the deque and returns …","Removes an item from the front of the deque and returns …","Removes the last element from a vector and returns it","Removes the top (greatest if max-heap, smallest if …","","","","Appends the given char to the end of this String.","Appends an item to the back of the collection","Pushes an item onto the binary heap.","Appends an item to the back of the deque","Appends an item to the back of the deque","Appends an item to the front of the deque","Appends an item to the front of the deque","Appends a given string slice onto the end of this String.","Appends an item to the back of the collection","Pushes an item onto the binary heap without first checking …","Returns a reference to the most recently written value.","Removes this entry from the map and yields its value","Same as swap_remove","Removes a value from the set. Returns true if the value …","Removes a key from the map, returning the value at the key …","Removes and returns the element at position index within …","Removes this entry from the map and yields its …","Resizes the Vec in-place so that len is equal to new_len.","Resizes the Vec in-place so that len is equal to new_len.","Retains only the elements specified by the predicate.","Retains only the elements specified by the predicate, …","Forces the length of the vector to new_len.","A fixed sorted priority linked list, similar to BinaryHeap …","Returns true if needle is a prefix of the Vec.","Remove the key-value pair equivalent to key and return its …","Removes an element from the vector and returns it.","Removes an element from the vector and returns it.","Visits the values representing the symmetric difference, …","Shortens this String to the specified length.","Shortens the vector, keeping the first len elements and …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Visits the values representing the union, i.e. all the …","Return an iterator over the values of the map, in their …","An iterator visiting all values in arbitrary order","Return an iterator over mutable references to the the …","An iterator visiting all values mutably in arbitrary order","Writes an element to the buffer, overwriting the oldest …","","","","A priority queue implemented with a binary heap.","The binary heap kind: min-heap or max-heap","Max-heap","Min-heap","Structure wrapping a mutable reference to the greatest …","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Removes the peeked value from the heap and returns it.","","","","","","","","","","Comes from SortedLinkedList::find_mut.","Iterator for the linked list.","The linked list kind: min-list or max-list","Index for the SortedLinkedList with specific backing …","Index for the SortedLinkedList with specific backing …","Index for the SortedLinkedList with specific backing …","Marker for Max sorted SortedLinkedList.","Marker for Min sorted SortedLinkedList.","A node in the SortedLinkedList.","The linked list.","Trait for defining an index for the linked list, never …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Find an element in the list that can be changed and …","This will resort the element into the correct position in …","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","Checks if the linked list is empty.","Checks if the linked list is full.","Get an iterator over the sorted list.","Create a new linked list.","Create a new linked list.","Create a new linked list.","","","","","Peek at the first element.","Pops the first element in the list.","This will pop the element from the list.","Pop an element from the list without checking so the list …","Pushes an element to the linked list and sorts it into …","Pushes a value onto the list without checking if the list …","","","","","","","","","","","","","","","","","","","","","","","","","","","","Just a const for the A button","Just a const for the A button","This is the struct to interact in a save way with the …","This is the struct to interact in a save way with the …","This is the struct to interact in a save way with the …","Just a const for the B button","Just a const for the blue led","Just a const for the B button","","","Led is off","This struct gives the library a understanding what Buttons …","This item is to chose between Black or White","Just a const for the DOWN button","Just a const for the DOWN button","","This is the struct to store and read structs objects …","Use this struct to store and read single bytes to/from …","Use this struct to store and read single bytes to/from …","The standard font size of the arduboy","Just a const for the green led","The standard height of the arduboy","","Just a const for the LEFT button","Just a const for the LEFT button","A fixed capacity map / dictionary that performs lookups …","","","This struct is used by a few Arduboy functions.","","Just a const for the red led","Just a const for led off","Just a const for led on","Just a const for the RIGHT button","Just a const for the RIGHT button","This struct is used by a few Arduboy functions.","A fixed capacity String","Just a const for the UP button","Just a const for the UP button","A fixed capacity Vec","The standard width of the arduboy","Led is on","This is the Module to interact in a save way with the …","This is the Module to interact in a save way with the …","This is the Module to interact in a save way with the …","","","","","","","","","","","","A list of all six buttons available on the Arduboy","Equivalent to C’s char type.","Equivalent to C’s double type.","Equivalent to C’s float type.","Equivalent to C’s signed int (int) type.","Equivalent to C’s signed long (long) type.","Equivalent to C’s signed long long (long long) type.","Equivalent to C’s size_t type, from stddef.h (or cstddef …","Equivalent to C’s unsigned char type.","Equivalent to C’s unsigned int type.","Equivalent to C’s unsigned long type.","Equivalent to C’s unsigned long long type.","","","","","","","A Arduino function to pause the cpu circles for a given …","","","This is the way to go if you want print some random text","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Create a const raw pointer to a ardvoice tone as u8, …","","Create a const raw pointer to a sprite as u8, without …","Create a const raw pointer to a [u8;_] that saves text, …","Create a const raw pointer to a tone sequenze as u16, …","","","Rect height","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","A list of all LED variables available","","","","","","","","","Create a space for Progmem variable","","A Arduino function to get a random number between 2 numbers","A Arduino function to get a random number smaller than the …","","","","This is the module to interact in a save way with the …","A C function to get the length of a string","","","","","","","","","","","","","","","","","","Rect width","","","Position X","Position X","Position Y","Position Y","This is the struct to interact in a save way with the …","Led is off","This item is to chose between Black or White","The standard font size of the arduboy","The standard height of the arduboy","This struct is used by a few Arduboy functions.","This struct is used by a few Arduboy functions.","The standard width of the arduboy","Led is on","Get the current sound state.","Turn sound off (mute).","Turn sound on.","Combines the use function of audio_on() and …","Save the current sound state in EEPROM.","Toggle the sound on/off state.","Initialize the hardware, display the boot logo, provide …","","","","","","","","","Clear the display buffer and set the text cursor to …","","","","","Test if a point falls within a rectangle.","Test if a rectangle is intersecting with another rectangle.","Set the RGB LEDs digitally, to either fully on or fully …","Set one of the RGB LEDs digitally, to either fully on or …","Copy the contents of the display buffer to the display. …","Copy the contents of the display buffer to the display. …","Draw a circle of a given radius.","Draw a horizontal line.","Draw a vertical line.","Set a single pixel in the display buffer to the specified …","Draw a rectangle of a specified width and height.","Draw a rectangle with rounded corners.","Draw a triangle given the coordinates of each corner.","","Indicate if the specified number of frames has elapsed.","Draw a filled-in circle of a given radius.","Draw a filled-in rectangle of a specified width and height.","Draw a filled-in rectangle with rounded corners.","Draw a filled-in triangle given the coordinates of each …","Flip the display horizontally or set it back to normal.","Flip the display vertically or set it back to normal.","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the state of the given pixel in the screen buffer.","","Rect height","Idle the CPU to save power.","Seed the random number generator with a random value.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Invert the entire display or set it back to normal.","Check if a button has just been pressed.","Check if a button has just been released.","gives you a new instance of the Arduboy2","Indicate that it’s time to render the next frame.","","Test if the specified buttons are not pressed.","","Poll the buttons and track their state over time.","Test if the all of the specified buttons are pressed.","The Arduino Print class is available for writing text to …","Set the location of the text cursor.","Set the X coordinate of the text cursor location.","Set the Y coordinate of the text cursor location.","Set the frame rate used by the frame control functions.","Set the light output of the RGB LED.","Set the brightness of one of the RGB LEDs without …","Set the text background color.","Set the text foreground color.","Set the text character size.","Set or disable text wrap mode.","","","","","","","","","","","","","Rect width","Position X","Position X","Position Y","Position Y","This is the struct to interact in a save way with the …","A list of all tones available and used by the Sounds …","","","Returns the argument unchanged.","Calls U::from(self).","Get a new instance of ArduboyTones","Stop playing the tone or sequence.","Check if a tone or tone sequence is playing.","Play a single tone.","Play two tones in sequence.","Play three tones in sequence.","Play a tone sequence from frequency/duration pairs in a …","Play a tone sequence from frequency/duration pairs in an …","","","","Set the volume to always normal, always high, or tone …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","This is the struct to interact in a save way with the …","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","","","Just a const for the A button","Just a const for the A button","Just a const for the B button","Just a const for the B button","This struct gives the library a understanding what Buttons …","Just a const for the DOWN button","Just a const for the DOWN button","Just a const for the LEFT button","Just a const for the LEFT button","Just a const for the RIGHT button","Just a const for the RIGHT button","Just a const for the UP button","Just a const for the UP button","","Just a const for the blue led","Just a const for the green led","Just a const for the red led","Just a const for led off","Just a const for led on","“Erase” a sprite.","Draw a sprite using a separate image and mask array.","Draw a sprite by replacing the existing content completely.","Draw a sprite using an array containing both image and …","Draw a sprite using only the bits set to 1.","","","","","Get the number of bytes (characters) available for reading …","Sets the data rate in bits per second (baud) for serial …","","","Disables serial communication, allowing the RX and TX pins …","The Arduino Serial Print class is available for writing …","","","The Arduino Serial Print class is available for writing …","","","Reads incoming serial data. Use only inside of available():","Reads incoming serial data.","“Erase” a sprite.","Draw a sprite using a separate image and mask array.","Draw a sprite by replacing the existing content completely.","Draw a sprite using an array containing both image and …","Draw a sprite using only the bits set to 1."],"i":[0,0,0,80,0,0,0,0,0,0,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,0,0,0,0,0,0,80,81,81,81,82,81,82,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,0,0,0,33,0,0,7,7,7,9,10,10,7,13,10,10,7,7,13,7,9,10,9,9,0,9,13,33,44,48,18,19,20,10,7,23,26,9,13,33,44,48,18,19,20,10,7,23,26,9,13,18,19,20,10,7,23,9,13,18,19,20,10,7,23,13,9,18,19,20,10,7,23,26,10,7,19,18,20,9,13,18,19,20,10,7,23,10,10,10,13,10,7,10,7,19,9,13,20,7,7,18,18,19,20,10,10,10,7,7,7,7,7,7,13,13,18,18,19,19,7,7,7,13,7,18,19,18,9,13,18,19,20,10,10,7,23,9,13,33,44,48,18,19,20,10,10,10,10,10,10,10,10,10,10,7,23,26,18,19,20,10,10,10,7,7,10,9,9,44,18,20,44,18,20,10,10,7,7,18,20,18,20,44,48,18,19,20,7,19,9,13,33,44,48,18,19,20,10,7,23,26,7,10,9,9,9,18,18,18,19,20,7,7,7,23,26,48,44,23,19,9,18,19,20,7,23,9,7,19,19,9,18,19,20,23,9,18,20,23,44,48,18,20,18,19,18,9,13,18,19,20,23,10,10,10,9,13,18,19,20,10,7,23,13,26,13,10,7,23,23,10,7,23,9,9,9,9,7,23,10,10,10,10,7,23,9,9,9,9,10,7,23,13,44,18,19,20,7,44,7,7,7,7,7,0,7,18,7,7,19,10,7,9,13,33,44,48,18,19,20,10,7,7,23,26,9,13,33,44,48,18,19,20,10,7,23,26,9,13,33,44,48,18,19,20,10,7,23,26,19,18,20,18,20,13,10,10,7,0,0,0,0,0,89,90,62,89,90,62,62,62,62,89,90,62,89,90,62,62,89,90,62,89,90,62,89,90,62,0,0,0,0,0,0,0,0,0,0,0,91,92,93,72,73,71,66,67,68,91,92,93,72,73,71,66,67,68,66,67,68,66,67,68,71,71,72,71,66,67,68,72,71,72,66,67,68,91,92,93,72,73,71,66,67,68,91,92,93,72,73,71,66,67,68,73,72,72,72,72,72,72,73,66,67,68,72,72,71,72,72,72,91,92,93,72,73,71,66,67,68,91,92,93,72,73,71,66,67,68,91,92,93,72,73,71,66,67,68,0,0,0,0,0,0,0,0,0,74,80,0,0,0,0,74,0,0,0,0,0,0,74,0,0,0,74,83,0,0,0,0,0,0,0,0,0,0,0,0,0,80,0,0,0,5,76,77,78,5,74,76,77,78,5,74,0,0,0,0,0,0,0,0,0,0,0,0,5,74,5,74,0,83,0,5,74,0,5,5,74,76,77,78,5,74,76,0,76,0,0,0,5,74,81,76,77,76,77,78,5,74,0,76,77,78,5,74,83,83,83,0,76,0,0,77,78,0,0,0,76,77,78,5,74,76,77,78,5,74,76,77,78,5,74,77,78,81,77,78,81,82,81,82,0,80,0,0,0,0,0,0,80,79,79,79,79,79,79,79,79,80,81,82,79,80,81,82,79,80,81,82,80,79,79,79,79,79,79,79,79,79,79,79,79,79,80,79,79,79,79,79,79,79,80,81,82,79,80,81,82,79,80,81,79,79,79,80,81,82,79,79,79,79,79,80,79,80,79,79,79,79,79,79,79,79,79,79,79,79,79,79,80,81,82,79,80,81,82,79,80,81,82,81,81,82,81,82,0,0,84,84,84,84,84,84,84,84,84,84,84,84,84,84,84,84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,85,85,85,85,85,85,85,85,85,85,85,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,88,87,0,0,0,0,88,87,0,0,87,87,0,88,88,0,0,0,0,0,0,0],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1],[[2,2],2],[2,2],0,[3,4],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[5,6],[5,6],[5,6],[5,6],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[7,8],[7,7],[7],[9],[10,11],[10,[[7,[12]]]],[7],[13,8],[10,[[8,[12]]]],[10,11],[7,7],[7,8],[13,8],[7,8],[9],[10,11],[9,14],[9,14],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[9,4],[13,4],[[[18,[[0,[15,16]],17]]],4],[[[19,[[0,[15,16]],17]]],4],[[[20,[15]]],4],[10,4],[7,4],[[[23,[21,22]]],4],[9],[13],[[[18,[[0,[15,16]],17]]]],[[[19,[[0,[15,16]],17]]]],[[[20,[15]]]],[10],[7],[[[23,[21,22]]]],[[[13,[[0,[24,25]]]],[0,[24,25]]]],[[[9,[25]]],[[9,[25]]]],[[[18,[[0,[15,16,25]],25,25]]],[[18,[[0,[15,16,25]],25,25]]]],[[[19,[[0,[15,16,25]],25]]],[[19,[[0,[15,16,25]],25]]]],[[[20,[[0,[15,25]],25]]],[[20,[[0,[15,25]],25]]]],[10,10],[[[7,[25]]],[[7,[25]]]],[[[23,[[0,[21,25]],22]]],[[23,[[0,[21,25]],22]]]],[[[26,[25]]],[[26,[25]]]],[[10,10],27],[[[7,[21]],[7,[21]]],27],[[[19,[[29,[[0,[15,16,28]]]],[0,[15,16]],17]],[0,[15,16,28]]],6],[[[18,[[29,[[0,[15,16,28]]]],[0,[15,16]],17]],[0,[15,16,28]]],6],[[[20,[15]],15],6],[[],9],[[],13],[[],[[18,[[0,[15,16]],[0,[17,30]]]]]],[[],[[19,[[0,[15,16]],[0,[17,30]]]]]],[[],[[20,[15]]]],[[],10],[[],7],[[],[[23,[21,22]]]],[[]],[[]],[[]],[13,8],[10,11],[7,8],[10,11],[7,8],[[[19,[[0,[15,16]],17]],[19,[[0,[15,16]],17]]],[[31,[[0,[15,16]],17]]]],[9],[13],[20],[7],[[[7,[[32,[[32,[[32,[32]]]]]]]],[8,[[32,[[32,[[32,[32]]]]]]]]],6],[[[18,[[0,[15,16]],17]],[0,[15,16]]],[[33,[[0,[15,16]]]]]],[[[18,[[0,[15,16]],15,17]],[18,[[0,[15,16]],15,17]]],6],[[[19,[[0,[15,16]],17]],[19,[[0,[15,16]],17]]],6],[[[20,[15,[32,[[32,[[32,[32]]]]]]]],[20,[15,[32,[[32,[[32,[32]]]]]]]]],6],[[10,10],6],[[10,11],6],[[10,11],6],[[[7,[32]],8],6],[[[7,[32]],34],6],[[[7,[32]],34],6],[[[7,[32]],8],6],[[[7,[32]],8],6],[[[7,[32]],7],6],[[13,35]],[[[13,[25]],35]],[[[18,[[0,[15,16]],17]],35]],[[[18,[[0,[15,16,24]],24,17]],35]],[[[19,[[0,[15,16]],17]],35]],[[[19,[[0,[15,16,24]],17]],35]],[[[7,[24]],35]],[[7,35]],[[7,35]],[[[13,[25]],[8,[25]]]],[[[7,[25]],[8,[25]]],36],[[[18,[[0,[15,16]],17]]],14],[[[19,[[0,[15,16]],17]]],[[14,[[0,[15,16]]]]]],[[[18,[[0,[15,16]],17]]],14],[[[9,[37]],38],[[36,[39]]]],[[[13,[37]],38],[[36,[39]]]],[[[18,[[0,[15,16,37]],37,17]],38],[[36,[39]]]],[[[19,[[0,[15,16,37]],17]],38],[[36,[39]]]],[[[20,[[0,[15,37]],37]],38],[[36,[39]]]],[[10,38],[[36,[39]]]],[[10,38],[[36,[39]]]],[[[7,[37]],38],[[36,[39]]]],[[[23,[[0,[21,37]],22]],38],[[36,[39]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[40,10],[2,10],[12,10],[11,10],[1,10],[41,10],[3,10],[42,10],[43,10],[[]],[[]],[[]],[[]],[35,[[18,[[0,[15,16]],[0,[17,30]]]]]],[35,[[19,[[0,[15,16]],[0,[17,30]]]]]],[35,[[20,[15]]]],[35,10],[35,10],[35,10],[35,7],[[[8,[25]]],[[36,[[7,[25]]]]]],[11,[[36,[10]]]],[9,14],[9,14],[[[44,[[0,[15,16]]]]]],[[[18,[[29,[[0,[16,15,28]]]],[0,[15,16]],17]],[0,[16,15,28]]],14],[[[20,[[29,[[0,[15,28]]]],15]],[0,[15,28]]],14],[[[44,[[0,[15,16]]]]]],[[[18,[[29,[[0,[16,15,28]]]],[0,[15,16]],17]],[0,[16,15,28]]],14],[[[20,[[29,[[0,[15,28]]]],15]],[0,[15,28]]],14],[[10,45]],[[10,46]],[[[7,[47]],45]],[[[7,[16]],46]],[[[18,[[0,[15,16,[29,[[0,[15,16,28]]]]]],17]],[0,[15,16,28]]]],[[[20,[[0,[[29,[[0,[15,28]]]],15]]]],[0,[15,28]]]],[[[18,[[0,[15,16,[29,[[0,[15,16,28]]]]]],17]],[0,[15,16,28]]]],[[[20,[[0,[[29,[[0,[15,28]]]],15]]]],[0,[15,28]]]],[[[44,[[0,[15,16]]]]]],[[[48,[[0,[15,16]]]]],36],[[[18,[[0,[15,16]],17]],[0,[15,16]]],[[36,[14]]]],[[[19,[[0,[15,16]],17]],[0,[15,16]]],[[36,[6,[0,[15,16]]]]]],[[[20,[15]],15],[[36,[14]]]],[[7,4],36],[[[19,[[0,[15,16]],17]],[19,[[0,[15,16]],17]]],[[49,[[0,[15,16]],17]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[7,[[36,[34,7]]]],[10,[[7,[12]]]],[9],[9],[9],[[[18,[[0,[15,16]],17]]]],[[[18,[[0,[15,16]],17]]]],[[[18,[[0,[15,16]],17]]]],[[[19,[[0,[15,16]],17]]]],[[[20,[15]]]],[7],[7],[7],[[[23,[21,22]]]],[[]],[[[48,[[0,[15,16]]]]],[[0,[15,16]]]],[[[44,[[0,[15,16]]]]]],[[[23,[21,22]]],[[7,[21]]]],[[[19,[[0,[15,16]],17]],[19,[[0,[15,16]],17]]],6],[9,6],[[[18,[[0,[15,16]],17]]],6],[[[19,[[0,[15,16]],17]]],6],[[[20,[15]]],6],[7,6],[[[23,[21,22]]],6],[9,6],[7,6],[[[19,[[0,[15,16]],17]],[19,[[0,[15,16]],17]]],6],[[[19,[[0,[15,16]],17]],[19,[[0,[15,16]],17]]],6],[9,50],[[[18,[[0,[15,16]],17]]],[[51,[[0,[15,16]]]]]],[[[19,[[0,[15,16]],17]]],[[52,[[0,[15,16]]]]]],[[[20,[15]]],[[53,[15]]]],[[[23,[21,22]]],[[54,[21]]]],[9,55],[[[18,[[0,[15,16]],17]]],[[56,[[0,[15,16]]]]]],[[[20,[15]]],[[57,[15]]]],[[[23,[21,22]]],[[58,[21]]]],[[[44,[[0,[15,16]]]]],[[0,[15,16]]]],[[[48,[[0,[15,16]]]]],[[0,[15,16]]]],[[[18,[[0,[15,16]],17]]],59],[[[20,[15]]],59],[[[18,[[0,[15,16]],17]]],14],[[[19,[[0,[15,16]],17]]],[[14,[[0,[15,16]]]]]],[[[18,[[0,[15,16]],17]]],14],[9,4],[13,4],[[[18,[[0,[15,16]],17]]],4],[[[19,[[0,[15,16]],17]]],4],[[[20,[15]]],4],[[[23,[21,22]]],4],[[10,10],6],[[10,11],6],[[10,11],6],[[],9],[[],13],[[],[[18,[60]]]],[[],[[19,[60]]]],[[],20],[[],10],[[],7],[[],23],[[[0,[24,25]]],[[13,[[0,[24,25]]]]]],[26,14],[13,26],[[10,10],[[14,[27]]]],[[[7,[[61,[[61,[[61,[61]]]]]]]],[7,[[61,[[61,[[61,[61]]]]]]]]],[[14,[27]]]],[[[23,[21,22]]],[[14,[21]]]],[[[23,[21,22]]],[[14,[[62,[21,22]]]]]],[10,[[14,[63]]]],[7,14],[[[23,[21,22]]],[[14,[21]]]],[9,14],[9],[9,14],[9],[7],[[[23,[21,22]]],21],[10],[10],[10],[[10,63],36],[7,36],[[[23,[21,22]],21],[[36,[21]]]],[9,36],[9],[9,36],[9],[[10,11],36],[7],[[[23,[21,22]],21]],[13,14],[[[44,[[0,[15,16]]]]]],[[[18,[[29,[[0,[16,15,28]]]],[0,[15,16]],17]],[0,[16,15,28]]],14],[[[19,[[29,[[0,[15,16,28]]]],[0,[15,16]],17]],[0,[15,16,28]]],6],[[[20,[[29,[[0,[15,28]]]],15]],[0,[15,28]]],14],[[7,4]],[[[44,[[0,[15,16]]]]]],[[[7,[25]],4,25],36],[[[7,[[0,[25,30]]]],4],36],[[7,64]],[[7,64]],[[7,4]],0,[[[7,[[32,[[32,[[32,[32]]]]]]]],[8,[[32,[[32,[[32,[32]]]]]]]]],6],[[[18,[[29,[[0,[16,15,28]]]],[0,[15,16]],17]],[0,[16,15,28]]],14],[[7,4]],[[7,4]],[[[19,[[0,[15,16]],17]],[19,[[0,[15,16]],17]]],59],[[10,4]],[[7,4]],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[[8,[25]]],[[36,[[7,[25]]]]]],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],65],[[],65],[[],65],[[],65],[[],65],[[],65],[[],65],[[],65],[[],65],[[],65],[[],65],[[],65],[[[19,[[0,[15,16]],17]],[19,[[0,[15,16]],17]]],59],[[[18,[[0,[15,16]],17]]],59],[[[20,[15]]],59],[[[18,[[0,[15,16]],17]]],59],[[[20,[15]]],59],[13],[[10,63],[[36,[39]]]],[[10,11],[[36,[39]]]],[[[7,[12]],11],[[36,[39]]]],0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[[62,[21,22]]],21],[[[62,[21,22]]],21],[[[62,[21,22]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[[62,[21,22]]],21],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],65],[[],65],[[],65],0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[66,66],[67,67],[68,68],[[66,66],27],[[67,67],27],[[68,68],27],[[[71,[21,69,70]]]],[[[71,[21,69,70]]]],[[[72,[69]]]],[[[71,[21,69,70]]]],[[66,66],6],[[67,67],6],[[68,68],6],[[[72,[21,69,70]],64],[[14,[[71,[21,69,70]]]]]],[[[71,[21,69,70]]]],[[[72,[[0,[21,37]],69,70]],38],[[36,[39]]]],[[66,38],[[36,[39]]]],[[67,38],[[36,[39]]]],[[68,38],[[36,[39]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[[72,[21,69,70]]],6],[[[72,[21,69,70]]],6],[[[72,[21,69,70]]],[[73,[21,69,70]]]],[[],[[72,[67]]]],[[],[[72,[66]]]],[[],[[72,[68]]]],[[[73,[21,69,70]]],14],[[66,66],[[14,[27]]]],[[67,67],[[14,[27]]]],[[68,68],[[14,[27]]]],[[[72,[21,69,70]]],[[14,[21]]]],[[[72,[21,69,70]]],[[36,[21]]]],[[[71,[21,69,70]]],21],[[[72,[21,69,70]]],21],[[[72,[21,69,70]],21],[[36,[21]]]],[[[72,[21,69,70]],21]],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],65],[[],65],[[],65],[[],65],[[],65],[[],65],[[],65],[[],65],[[],65],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[5,5],5],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,[5,5],[74,74],[[5,5],27],[[74,74],27],[[21,21,21],21],[[]],[1],[[5,5],6],[[74,74],6],0,0,[[5,38],75],[[74,38],75],[[]],[[]],[[]],[[]],[[]],[76],0,[76],0,0,0,[[5,45]],[[74,45]],0,[76],[77],[[]],[[]],[[]],[[]],[[]],0,[43,76],[43,77],[43,78],[[5,5],[[14,[27]]]],[[74,74],[[14,[27]]]],[[]],[[]],[[]],0,[76],[[2,2],2],[2,2],[77,12],[78,12],0,0,[3,4],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],65],[[],65],[[],65],[[],65],[[],65],[[77,12]],[[78,12]],0,[[77,12]],[[78,12]],0,0,0,0,0,0,0,0,0,0,0,0,0,[79,6],[79],[79],[79],[79],[79],[79],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[79],[80,80],[81,81],[82,82],[[80,80],27],[[79,82,81],6],[[79,81,81],6],[[79,12,12,12]],[[79,12,12]],[79],[79],[[79,43,43,12,80]],[[79,43,43,12,80]],[[79,43,43,12,80]],[[79,43,43,80]],[[79,43,43,12,12,80]],[[79,43,43,12,12,12,80]],[[79,43,43,43,43,43,43,80]],[[80,80],6],[[79,12],6],[[79,43,43,12,80]],[[79,43,43,12,12,80]],[[79,43,43,12,12,12,80]],[[79,43,43,43,43,43,43,80]],[[79,6]],[[79,6]],[[80,38],75],[[81,38],75],[[82,38],75],[[]],[[]],[[]],[[]],[[79,12,12],80],[[80,45]],0,[79],[79],[[]],[[]],[[]],[[]],[[79,6]],[[79,5],6],[[79,5],6],[[],79],[79,6],[80],[[79,5],6],[[80,80],[[14,[27]]]],[79],[[79,5],6],[[79,83]],[[79,43,43]],[[79,43]],[[79,43]],[[79,12]],[[79,12,12,12]],[[79,12,12]],[[79,80]],[[79,80]],[[79,12]],[[79,6]],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],36],[[],65],[[],65],[[],65],[[],65],0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[],84],[84],[84,6],[[84,42,1]],[[84,42,1,42,1]],[[84,42,1,42,1,42,1]],[[84,42]],[[84,1]],[[],36],[[],36],[[],65],[[84,12]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[85,6],[[],85],[[85,12]],[[85,12,1,1,86]],[85],[[],36],[[],36],[[],65],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[43,43,12,12]],[[43,43,12,12,12,12]],[[43,43,12,12]],[[43,43,12,12]],[[43,43,12,12]],0,0,0,0,[[],43],[1],[[]],[[]],[[]],[87],[[]],[[]],[88],[[]],[[]],[[],43],[[],11],[[43,43,12,12]],[[43,43,12,12,12,12]],[[43,43,12,12]],[[43,43,12,12]],[[43,43,12,12]]],"c":[],"p":[[15,"u32"],[15,"i32"],[15,"i8"],[15,"usize"],[3,"ButtonSet",829],[15,"bool"],[3,"Vec",320],[15,"slice"],[3,"Deque",320],[3,"String",320],[15,"str"],[15,"u8"],[3,"HistoryBuffer",320],[4,"Option",1401],[8,"Eq",1402],[8,"Hash",1403],[8,"BuildHasher",1403],[3,"IndexMap",320],[3,"IndexSet",320],[3,"LinearMap",320],[8,"Ord",1402],[8,"Kind",689],[3,"BinaryHeap",320],[8,"Copy",1404],[8,"Clone",1405],[3,"OldestOrdered",320],[4,"Ordering",1402],[8,"Sized",1404],[8,"Borrow",1406],[8,"Default",1407],[3,"Difference",1408],[8,"PartialEq",1402],[4,"Entry",320],[15,"array"],[8,"IntoIterator",1409],[4,"Result",1410],[8,"Debug",1411],[3,"Formatter",1411],[3,"Error",1411],[15,"u64"],[15,"i64"],[15,"u16"],[15,"i16"],[3,"OccupiedEntry",320],[8,"Hasher",1412],[8,"Hasher",1403],[8,"Hash",1412],[3,"VacantEntry",320],[3,"Intersection",1408],[3,"Iter",1413],[3,"Iter",1414],[3,"Iter",1408],[3,"Iter",1415],[3,"Iter",1416],[3,"IterMut",1413],[3,"IterMut",1414],[3,"IterMut",1415],[3,"IterMut",1416],[8,"Iterator",1417],[3,"BuildHasherDefault",1403],[8,"PartialOrd",1402],[3,"PeekMut",689],[15,"char"],[8,"FnMut",1418],[3,"TypeId",1419],[3,"LinkedIndexU8",719],[3,"LinkedIndexU16",719],[3,"LinkedIndexUsize",719],[8,"SortedLinkedListIndex",719],[8,"Kind",719],[3,"FindMut",719],[3,"SortedLinkedList",719],[3,"Iter",719],[4,"Base",829],[6,"Result",1411],[3,"EEPROM",829],[3,"EEPROMBYTE",829],[3,"EEPROMBYTECHECKLESS",829],[3,"Arduboy2",973],[4,"Color",973],[3,"Rect",973],[3,"Point",973],[8,"Printable",829],[3,"ArduboyTones",1077],[3,"ArdVoice",1342],[15,"f32"],[8,"Serialprintable",1379],[8,"Serialprintlnable",1379],[4,"Min",689],[4,"Max",689],[3,"Min",719],[3,"Max",719],[3,"Node",719]]},\ -"atomic_polyfill":{"doc":"","t":"RNNDDDENNNLLLLLLLLLLLLFLLLLFLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLFLLLLLLLLLLLLLLL","n":["ATOMIC_BOOL_INIT","AcqRel","Acquire","AtomicBool","AtomicI8","AtomicU8","Ordering","Relaxed","Release","SeqCst","as_ptr","as_ptr","as_ptr","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","compiler_fence","default","default","default","eq","fence","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from_mut","from_mut","from_mut","from_mut_slice","from_mut_slice","from_mut_slice","from_ptr","from_ptr","from_ptr","get_mut","get_mut","get_mut","get_mut_slice","get_mut_slice","get_mut_slice","hash","into","into","into","into","into_inner","into_inner","into_inner","load","load","load","new","new","new","spin_loop_hint","store","store","store","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id"],"q":[[0,"atomic_polyfill"],[84,"core::fmt"],[85,"core::fmt"],[86,"core::hash"],[87,"core::any"]],"d":["An AtomicBool initialized to false.","Has the effects of both Acquire and Release together: For …","When coupled with a load, if the loaded value was written …","A boolean type which can be safely shared between threads.","An integer type which can be safely shared between threads.","An integer type which can be safely shared between threads.","Atomic memory orderings","No ordering constraints, only atomic operations.","When coupled with a store, all previous operations become …","Like Acquire/Release/AcqRel (for load, store, and …","Returns a mutable pointer to the underlying bool.","Returns a mutable pointer to the underlying integer.","Returns a mutable pointer to the underlying integer.","","","","","","","","","","A compiler memory fence.","Creates an AtomicBool initialized to false.","","","","An atomic fence.","","","","","Converts a bool into an AtomicBool.","Returns the argument unchanged.","Returns the argument unchanged.","Converts an i8 into an AtomicI8.","Returns the argument unchanged.","Converts an u8 into an AtomicU8.","Returns the argument unchanged.","Get atomic access to a &mut bool.","Get atomic access to a &mut i8.","Get atomic access to a &mut u8.","Get atomic access to a &mut [bool] slice.","Get atomic access to a &mut [i8] slice.","Get atomic access to a &mut [u8] slice.","Creates a new AtomicBool from a pointer.","Creates a new reference to an atomic integer from a …","Creates a new reference to an atomic integer from a …","Returns a mutable reference to the underlying bool.","Returns a mutable reference to the underlying integer.","Returns a mutable reference to the underlying integer.","Get non-atomic access to a &mut [AtomicBool] slice.","Get non-atomic access to a &mut [AtomicI8] slice","Get non-atomic access to a &mut [AtomicU8] slice","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Consumes the atomic and returns the contained value.","Consumes the atomic and returns the contained value.","Consumes the atomic and returns the contained value.","Loads a value from the bool.","Loads a value from the atomic integer.","Loads a value from the atomic integer.","Creates a new AtomicBool.","Creates a new atomic integer.","Creates a new atomic integer.","Signals the processor that it is inside a busy-wait …","Stores a value into the bool.","Stores a value into the atomic integer.","Stores a value into the atomic integer.","","","","","","","","","","","",""],"i":[0,7,7,0,0,0,0,7,7,7,1,3,5,1,7,3,5,1,7,3,5,7,0,1,3,5,7,0,1,7,3,5,1,1,7,3,3,5,5,1,3,5,1,3,5,1,3,5,1,3,5,1,3,5,7,1,7,3,5,1,3,5,1,3,5,1,3,5,0,1,3,5,1,7,3,5,1,7,3,5,1,7,3,5],"f":[0,0,0,0,0,0,0,0,0,0,[1,2],[3,4],[5,6],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[7,7],[7],[[],1],[[],3],[[],5],[[7,7],2],[7],[[1,8],[[10,[9]]]],[[7,8],[[10,[9]]]],[[3,8],[[10,[9]]]],[[5,8],[[10,[9]]]],[2,1],[[]],[[]],[4,3],[[]],[6,5],[[]],[2,1],[4,3],[6,5],[[[11,[2]]],[[11,[1]]]],[[[11,[4]]],[[11,[3]]]],[[[11,[6]]],[[11,[5]]]],[2,1],[4,3],[6,5],[1,2],[3,4],[5,6],[[[11,[1]]],[[11,[2]]]],[[[11,[3]]],[[11,[4]]]],[[[11,[5]]],[[11,[6]]]],[[7,12]],[[]],[[]],[[]],[[]],[1,2],[3,4],[5,6],[[1,7],2],[[3,7],4],[[5,7],6],[2,1],[4,3],[6,5],[[]],[[1,2,7]],[[3,4,7]],[[5,6,7]],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],13],[[],13],[[],13],[[],13]],"c":[0,68],"p":[[3,"AtomicBool",0],[15,"bool"],[3,"AtomicI8",0],[15,"i8"],[3,"AtomicU8",0],[15,"u8"],[4,"Ordering",0],[3,"Formatter",84],[3,"Error",84],[4,"Result",85],[15,"slice"],[8,"Hasher",86],[3,"TypeId",87]]},\ -"byteorder":{"doc":"This crate provides convenience methods for encoding and …","t":"GEIGEGGLLLLLLLLLLLLLLLLKLLKLLLLLLKLLKLLKLLKLLLLLLLLLLLLLLLLLLLLLLLLLLKLLKLLKLLKLLLKLLKLLLKLLKLLKLLKLLLLLLLLLLLLLLLLLLLLLLLLLKLLKLLKLLKLLLKLLKLLLKLLKLLKLLKLL","n":["BE","BigEndian","ByteOrder","LE","LittleEndian","NativeEndian","NetworkEndian","borrow","borrow","borrow_mut","borrow_mut","clone","clone","cmp","cmp","default","default","eq","eq","fmt","fmt","from","from","from_slice_f32","from_slice_f32","from_slice_f32","from_slice_f64","from_slice_f64","from_slice_f64","from_slice_i128","from_slice_i16","from_slice_i32","from_slice_i64","from_slice_u128","from_slice_u128","from_slice_u128","from_slice_u16","from_slice_u16","from_slice_u16","from_slice_u32","from_slice_u32","from_slice_u32","from_slice_u64","from_slice_u64","from_slice_u64","hash","hash","into","into","partial_cmp","partial_cmp","read_f32","read_f32_into","read_f32_into_unchecked","read_f64","read_f64_into","read_f64_into_unchecked","read_i128","read_i128_into","read_i16","read_i16_into","read_i24","read_i32","read_i32_into","read_i48","read_i64","read_i64_into","read_int","read_int128","read_u128","read_u128","read_u128","read_u128_into","read_u128_into","read_u128_into","read_u16","read_u16","read_u16","read_u16_into","read_u16_into","read_u16_into","read_u24","read_u32","read_u32","read_u32","read_u32_into","read_u32_into","read_u32_into","read_u48","read_u64","read_u64","read_u64","read_u64_into","read_u64_into","read_u64_into","read_uint","read_uint","read_uint","read_uint128","read_uint128","read_uint128","try_from","try_from","try_into","try_into","type_id","type_id","write_f32","write_f32_into","write_f64","write_f64_into","write_i128","write_i128_into","write_i16","write_i16_into","write_i24","write_i32","write_i32_into","write_i48","write_i64","write_i64_into","write_i8_into","write_int","write_int128","write_u128","write_u128","write_u128","write_u128_into","write_u128_into","write_u128_into","write_u16","write_u16","write_u16","write_u16_into","write_u16_into","write_u16_into","write_u24","write_u32","write_u32","write_u32","write_u32_into","write_u32_into","write_u32_into","write_u48","write_u64","write_u64","write_u64","write_u64_into","write_u64_into","write_u64_into","write_uint","write_uint","write_uint","write_uint128","write_uint128","write_uint128"],"q":[[0,"byteorder"],[156,"core::cmp"],[157,"core::fmt"],[158,"core::fmt"],[159,"core::option"],[160,"core::result"],[161,"core::any"]],"d":["A type alias for BigEndian.","Defines big-endian serialization.","ByteOrder describes types that can serialize integers as …","A type alias for LittleEndian.","Defines little-endian serialization.","Defines system native-endian serialization.","Defines network byte order serialization.","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Converts the given slice of IEEE754 single-precision (4 …","","","Converts the given slice of IEEE754 double-precision (8 …","","","Converts the given slice of signed 128 bit integers to a …","Converts the given slice of signed 16 bit integers to a …","Converts the given slice of signed 32 bit integers to a …","Converts the given slice of signed 64 bit integers to a …","Converts the given slice of unsigned 128 bit integers to a …","","","Converts the given slice of unsigned 16 bit integers to a …","","","Converts the given slice of unsigned 32 bit integers to a …","","","Converts the given slice of unsigned 64 bit integers to a …","","","","","Calls U::from(self).","Calls U::from(self).","","","Reads a IEEE754 single-precision (4 bytes) floating point …","Reads IEEE754 single-precision (4 bytes) floating point …","DEPRECATED.","Reads a IEEE754 double-precision (8 bytes) floating point …","Reads IEEE754 single-precision (4 bytes) floating point …","DEPRECATED.","Reads a signed 128 bit integer from buf.","Reads signed 128 bit integers from src into dst.","Reads a signed 16 bit integer from buf.","Reads signed 16 bit integers from src to dst.","Reads a signed 24 bit integer from buf, stored in i32.","Reads a signed 32 bit integer from buf.","Reads signed 32 bit integers from src into dst.","Reads a signed 48 bit integer from buf, stored in i64.","Reads a signed 64 bit integer from buf.","Reads signed 64 bit integers from src into dst.","Reads a signed n-bytes integer from buf.","Reads a signed n-bytes integer from buf.","Reads an unsigned 128 bit integer from buf.","","","Reads unsigned 128 bit integers from src into dst.","","","Reads an unsigned 16 bit integer from buf.","","","Reads unsigned 16 bit integers from src into dst.","","","Reads an unsigned 24 bit integer from buf, stored in u32.","Reads an unsigned 32 bit integer from buf.","","","Reads unsigned 32 bit integers from src into dst.","","","Reads an unsigned 48 bit integer from buf, stored in u64.","Reads an unsigned 64 bit integer from buf.","","","Reads unsigned 64 bit integers from src into dst.","","","Reads an unsigned n-bytes integer from buf.","","","Reads an unsigned n-bytes integer from buf.","","","","","","","","","Writes a IEEE754 single-precision (4 bytes) floating point …","Writes IEEE754 single-precision (4 bytes) floating point …","Writes a IEEE754 double-precision (8 bytes) floating point …","Writes IEEE754 double-precision (8 bytes) floating point …","Writes a signed 128 bit integer n to buf.","Writes signed 128 bit integers from src into dst.","Writes a signed 16 bit integer n to buf.","Writes signed 16 bit integers from src into dst.","Writes a signed 24 bit integer n to buf, stored in i32.","Writes a signed 32 bit integer n to buf.","Writes signed 32 bit integers from src into dst.","Writes a signed 48 bit integer n to buf, stored in i64.","Writes a signed 64 bit integer n to buf.","Writes signed 64 bit integers from src into dst.","Writes signed 8 bit integers from src into dst.","Writes a signed integer n to buf using only nbytes.","Writes a signed integer n to buf using only nbytes.","Writes an unsigned 128 bit integer n to buf.","","","Writes unsigned 128 bit integers from src into dst.","","","Writes an unsigned 16 bit integer n to buf.","","","Writes unsigned 16 bit integers from src into dst.","","","Writes an unsigned 24 bit integer n to buf, stored in u32.","Writes an unsigned 32 bit integer n to buf.","","","Writes unsigned 32 bit integers from src into dst.","","","Writes an unsigned 48 bit integer n to buf, stored in u64.","Writes an unsigned 64 bit integer n to buf.","","","Writes unsigned 64 bit integers from src into dst.","","","Writes an unsigned integer n to buf using only nbytes.","","","Writes an unsigned integer n to buf using only nbytes.","",""],"i":[0,0,0,0,0,0,0,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,25,1,2,25,1,2,25,25,25,25,25,1,2,25,1,2,25,1,2,25,1,2,1,2,1,2,1,2,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,1,2,25,1,2,25,1,2,25,1,2,25,25,1,2,25,1,2,25,25,1,2,25,1,2,25,1,2,25,1,2,1,2,1,2,1,2,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,1,2,25,1,2,25,1,2,25,1,2,25,25,1,2,25,1,2,25,25,1,2,25,1,2,25,1,2,25,1,2],"f":[0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[1,1],[2,2],[[1,1],3],[[2,2],3],[[],1],[[],2],[[1,1],4],[[2,2],4],[[1,5],6],[[2,5],6],[[]],[[]],[[[8,[7]]]],[[[8,[7]]]],[[[8,[7]]]],[[[8,[9]]]],[[[8,[9]]]],[[[8,[9]]]],[[[8,[10]]]],[[[8,[11]]]],[[[8,[12]]]],[[[8,[13]]]],[[[8,[14]]]],[[[8,[14]]]],[[[8,[14]]]],[[[8,[15]]]],[[[8,[15]]]],[[[8,[15]]]],[[[8,[16]]]],[[[8,[16]]]],[[[8,[16]]]],[[[8,[17]]]],[[[8,[17]]]],[[[8,[17]]]],[[1,18]],[[2,18]],[[]],[[]],[[1,1],[[19,[3]]]],[[2,2],[[19,[3]]]],[[[8,[20]]],7],[[[8,[20]],[8,[7]]]],[[[8,[20]],[8,[7]]]],[[[8,[20]]],9],[[[8,[20]],[8,[9]]]],[[[8,[20]],[8,[9]]]],[[[8,[20]]],10],[[[8,[20]],[8,[10]]]],[[[8,[20]]],11],[[[8,[20]],[8,[11]]]],[[[8,[20]]],12],[[[8,[20]]],12],[[[8,[20]],[8,[12]]]],[[[8,[20]]],13],[[[8,[20]]],13],[[[8,[20]],[8,[13]]]],[[[8,[20]],21],13],[[[8,[20]],21],10],[[[8,[20]]],14],[[[8,[20]]],14],[[[8,[20]]],14],[[[8,[20]],[8,[14]]]],[[[8,[20]],[8,[14]]]],[[[8,[20]],[8,[14]]]],[[[8,[20]]],15],[[[8,[20]]],15],[[[8,[20]]],15],[[[8,[20]],[8,[15]]]],[[[8,[20]],[8,[15]]]],[[[8,[20]],[8,[15]]]],[[[8,[20]]],16],[[[8,[20]]],16],[[[8,[20]]],16],[[[8,[20]]],16],[[[8,[20]],[8,[16]]]],[[[8,[20]],[8,[16]]]],[[[8,[20]],[8,[16]]]],[[[8,[20]]],17],[[[8,[20]]],17],[[[8,[20]]],17],[[[8,[20]]],17],[[[8,[20]],[8,[17]]]],[[[8,[20]],[8,[17]]]],[[[8,[20]],[8,[17]]]],[[[8,[20]],21],17],[[[8,[20]],21],17],[[[8,[20]],21],17],[[[8,[20]],21],14],[[[8,[20]],21],14],[[[8,[20]],21],14],[[],22],[[],22],[[],22],[[],22],[[],23],[[],23],[[[8,[20]],7]],[[[8,[7]],[8,[20]]]],[[[8,[20]],9]],[[[8,[9]],[8,[20]]]],[[[8,[20]],10]],[[[8,[10]],[8,[20]]]],[[[8,[20]],11]],[[[8,[11]],[8,[20]]]],[[[8,[20]],12]],[[[8,[20]],12]],[[[8,[12]],[8,[20]]]],[[[8,[20]],13]],[[[8,[20]],13]],[[[8,[13]],[8,[20]]]],[[[8,[24]],[8,[20]]]],[[[8,[20]],13,21]],[[[8,[20]],10,21]],[[[8,[20]],14]],[[[8,[20]],14]],[[[8,[20]],14]],[[[8,[14]],[8,[20]]]],[[[8,[14]],[8,[20]]]],[[[8,[14]],[8,[20]]]],[[[8,[20]],15]],[[[8,[20]],15]],[[[8,[20]],15]],[[[8,[15]],[8,[20]]]],[[[8,[15]],[8,[20]]]],[[[8,[15]],[8,[20]]]],[[[8,[20]],16]],[[[8,[20]],16]],[[[8,[20]],16]],[[[8,[20]],16]],[[[8,[16]],[8,[20]]]],[[[8,[16]],[8,[20]]]],[[[8,[16]],[8,[20]]]],[[[8,[20]],17]],[[[8,[20]],17]],[[[8,[20]],17]],[[[8,[20]],17]],[[[8,[17]],[8,[20]]]],[[[8,[17]],[8,[20]]]],[[[8,[17]],[8,[20]]]],[[[8,[20]],17,21]],[[[8,[20]],17,21]],[[[8,[20]],17,21]],[[[8,[20]],14,21]],[[[8,[20]],14,21]],[[[8,[20]],14,21]]],"c":[53,56],"p":[[4,"BigEndian",0],[4,"LittleEndian",0],[4,"Ordering",156],[15,"bool"],[3,"Formatter",157],[6,"Result",157],[15,"f32"],[15,"slice"],[15,"f64"],[15,"i128"],[15,"i16"],[15,"i32"],[15,"i64"],[15,"u128"],[15,"u16"],[15,"u32"],[15,"u64"],[8,"Hasher",158],[4,"Option",159],[15,"u8"],[15,"usize"],[4,"Result",160],[3,"TypeId",161],[15,"i8"],[8,"ByteOrder",0]]},\ -"critical_section":{"doc":"critical-section","t":"DIDGDFKLLLLLLLLLLLLLLLLLLLLLLLLLFKLLOLLLLLLLLLLF","n":["CriticalSection","Impl","Mutex","RawRestoreState","RestoreState","acquire","acquire","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_ref","borrow_ref_mut","clone","clone","fmt","fmt","fmt","from","from","from","get_mut","into","into","into","into_inner","invalid","new","new","release","release","replace","replace_with","set_impl","take","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","with"],"q":[[0,"critical_section"],[48,"core::cell"],[49,"core::cell"],[50,"core::fmt"],[51,"core::default"],[52,"core::result"],[53,"core::any"]],"d":["Critical section token.","Methods required for a critical section implementation.","A mutex based on critical sections.","Raw, transparent “restore state”.","Opaque “restore state”.","Acquire a critical section in the current thread.","Acquire the critical section.","Borrows the data for the duration of the critical section.","","","","","","","Borrow the data and call RefCell::borrow","Borrow the data and call RefCell::borrow_mut","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Gets a mutable reference to the contained value when the …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Unwraps the contained value, consuming the mutex.","Create an invalid, dummy RestoreState.","Creates a new mutex.","Creates a critical section token.","Release the critical section.","Release the critical section.","Borrow the data and call RefCell::replace","Borrow the data and call RefCell::replace_with","Set the critical section implementation.","Borrow the data and call RefCell::take","","","","","","","","","","Execute closure f in a critical section."],"i":[0,0,0,0,0,0,15,3,3,4,1,3,4,1,3,3,4,1,3,4,1,3,4,1,3,3,4,1,3,1,3,4,0,15,3,3,0,3,3,4,1,3,4,1,3,4,1,0],"f":[0,0,0,0,0,[[],1],[[],2],[[3,4]],[[]],[[]],[[]],[[]],[[]],[[]],[[[3,[5]],4],6],[[[3,[5]],4],7],[4,4],[1,1],[[[3,[8]],9],10],[[4,9],10],[[1,9],10],[[]],[[]],[[]],[3],[[]],[[]],[[]],[3],[[],1],[[],3],[[],4],[1],[2],[[[3,[5]],4]],[[[3,[5]],4,11]],0,[[[3,[[5,[12]]]],4],12],[[],13],[[],13],[[],13],[[],13],[[],13],[[],13],[[],14],[[],14],[[],14],[11]],"c":[],"p":[[3,"RestoreState",0],[6,"RawRestoreState",0],[3,"Mutex",0],[3,"CriticalSection",0],[3,"RefCell",48],[3,"Ref",48],[3,"RefMut",48],[8,"Debug",49],[3,"Formatter",49],[6,"Result",49],[8,"FnOnce",50],[8,"Default",51],[4,"Result",52],[3,"TypeId",53],[8,"Impl",0]]},\ -"hash32":{"doc":"32-bit hashing machinery","t":"IDDIIQDLLLLLLKLLLLLLKLLLLLLKLLLLLLLLLLLLLLKLL","n":["BuildHasher","BuildHasherDefault","FnvHasher","Hash","Hasher","Hasher","Murmur3Hasher","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","build_hasher","build_hasher","clone","default","default","default","eq","finish","finish","finish","fmt","from","from","from","hash","hash_slice","into","into","into","new","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","write","write","write"],"q":[[0,"hash32"],[45,"core::default"],[46,"core::fmt"],[47,"core::fmt"],[48,"core::result"],[49,"core::any"]],"d":["See core::hash::BuildHasher for details","See core::hash::BuildHasherDefault for details","32-bit Fowler-Noll-Vo hasher","See core::hash::Hash for details","See core::hash::Hasher for details","See core::hash::BuildHasher::Hasher","32-bit MurmurHash3 hasher","","","","","","","See core::hash::BuildHasher.build_hasher","","","","","","","See core::hash::Hasher.finish","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Feeds this value into the given Hasher.","Feeds a slice of this type into the given Hasher.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","const constructor","","","","","","","","","","See core::hash::Hasher.write","",""],"i":[0,0,0,0,0,15,0,4,5,3,4,5,3,15,3,3,4,5,3,3,2,4,5,3,4,5,3,16,16,4,5,3,3,4,5,3,4,5,3,4,5,3,2,4,5],"f":[0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[[3,[[0,[1,2]]]]]],[[[3,[[0,[1,2]]]]],[[3,[[0,[1,2]]]]]],[[],4],[[],5],[[],[[3,[[0,[1,2]]]]]],[[[3,[[0,[1,2]]]],[3,[[0,[1,2]]]]],6],[[],7],[4,7],[5,7],[[[3,[[0,[1,2]]]],8],9],[[]],[[]],[[]],[2],[[[11,[10]],2]],[[]],[[]],[[]],[[],3],[[],12],[[],12],[[],12],[[],12],[[],12],[[],12],[[],13],[[],13],[[],13],[[[11,[14]]]],[[4,[11,[14]]]],[[5,[11,[14]]]]],"c":[],"p":[[8,"Default",45],[8,"Hasher",0],[3,"BuildHasherDefault",0],[3,"FnvHasher",0],[3,"Murmur3Hasher",0],[15,"bool"],[15,"u32"],[3,"Formatter",46],[6,"Result",46],[8,"Sized",47],[15,"slice"],[4,"Result",48],[3,"TypeId",49],[15,"u8"],[8,"BuildHasher",0],[8,"Hash",0]]},\ -"heapless":{"doc":"static friendly data structures that don’t require …","t":"CCDEGGDDDDNDDCDNDDLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDIEEDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDDIDDDDDDDILLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL","n":["BinaryHeap","Bucket","Deque","Entry","FnvIndexMap","FnvIndexSet","HistoryBuffer","IndexMap","IndexSet","LinearMap","Occupied","OccupiedEntry","OldestOrdered","Pos","String","Vacant","VacantEntry","Vec","as_mut","as_mut","as_mut_ptr","as_mut_slices","as_mut_str","as_mut_vec","as_ptr","as_ref","as_ref","as_ref","as_ref","as_ref","as_slice","as_slice","as_slices","as_str","back","back_mut","binary_heap","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","capacity","capacity","capacity","capacity","capacity","capacity","capacity","clear","clear","clear","clear","clear","clear","clear","clear_with","clone","clone","clone","clone","clone","clone","clone","cmp","cmp","contains","contains_key","contains_key","default","default","default","default","default","default","default","deref","deref","deref","deref_mut","deref_mut","difference","drop","drop","drop","drop","ends_with","entry","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","extend","extend","extend","extend","extend","extend","extend","extend","extend","extend_from_slice","extend_from_slice","first","first","first_mut","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_iter","from_iter","from_iter","from_iter","from_iter","from_iter","from_iter","from_slice","from_str","front","front_mut","get","get","get","get_mut","get_mut","get_mut","hash","hash","hash","hash","index","index","index_mut","index_mut","insert","insert","insert","insert","insert","insert","intersection","into","into","into","into","into","into","into","into","into","into","into","into_array","into_bytes","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_key","into_mut","is_disjoint","is_empty","is_empty","is_empty","is_empty","is_empty","is_full","is_full","is_subset","is_superset","iter","iter","iter","iter","iter_mut","iter_mut","iter_mut","key","key","keys","keys","last","last","last_mut","len","len","len","len","len","ne","ne","ne","new","new","new","new","new","new","new","new_with","next","oldest_ordered","partial_cmp","partial_cmp","pop","pop","pop_back","pop_back_unchecked","pop_front","pop_front_unchecked","pop_unchecked","push","push","push_back","push_back_unchecked","push_front","push_front_unchecked","push_str","push_unchecked","recent","remove","remove","remove","remove","remove","remove_entry","resize","resize_default","retain","retain_mut","set_len","sorted_linked_list","starts_with","swap_remove","swap_remove","swap_remove_unchecked","symmetric_difference","truncate","truncate","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","union","values","values","values_mut","values_mut","write","write_char","write_str","write_str","BinaryHeap","Kind","Max","Min","PeekMut","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","capacity","clear","clone","default","deref","deref_mut","drop","fmt","from","from","from","from","into","into","into","into","into_iter","into_vec","is_empty","iter","iter_mut","len","new","peek","peek_mut","pop","pop","pop_unchecked","push","push_unchecked","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","FindMut","Iter","Kind","LinkedIndexU16","LinkedIndexU8","LinkedIndexUsize","Max","Min","Node","SortedLinkedList","SortedLinkedListIndex","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","cmp","cmp","cmp","deref","deref_mut","drop","drop","eq","eq","eq","find_mut","finish","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","into","into","into","into","into","into","into","into","into","into_iter","is_empty","is_full","iter","new_u16","new_u8","new_usize","next","partial_cmp","partial_cmp","partial_cmp","peek","pop","pop","pop_unchecked","push","push_unchecked","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id"],"q":[[0,"heapless"],[340,"heapless::binary_heap"],[395,"heapless::sorted_linked_list"],[505,"core::option"],[506,"core::cmp"],[507,"hash32"],[508,"hash32"],[509,"core::clone"],[510,"core::cmp"],[511,"core::default"],[512,"core::cmp"],[513,"core::result"],[514,"core::fmt"],[515,"core::fmt"],[516,"hash32"],[517,"hash32"],[518,"core::any"],[519,"core::fmt"],[520,"core::slice::iter"]],"d":["","","A fixed capacity double-ended queue.","A view into an entry in the map","A heapless::IndexMap using the default FNV hasher","A heapless::IndexSet using the default FNV hasher. A list …","A “history buffer”, similar to a write-only ring …","Fixed capacity IndexMap","Fixed capacity IndexSet.","A fixed capacity map / dictionary that performs lookups …","The entry corresponding to the key K exists in the map","An occupied entry which can be manipulated","An iterator on the underlying buffer ordered from oldest …","","A fixed capacity String","The entry corresponding to the key K does not exist in the …","A view into an empty slot in the underlying map","A fixed capacity Vec","","","Returns a raw pointer to the vector’s buffer, which may …","Returns a pair of mutable slices which contain, in order, …","Converts a String into a mutable string slice.","Returns a mutable reference to the contents of this String.","Returns a raw pointer to the vector’s buffer.","","","","","","Returns the array slice backing the buffer, without …","Extracts a slice containing the entire vector.","Returns a pair of slices which contain, in order, the …","Extracts a string slice containing the entire string.","Provides a reference to the back element, or None if the …","Provides a mutable reference to the back element, or None …","A priority queue implemented with a binary heap.","","","","","","","","","","","","","","","","","","","","","","","Returns the maximum number of elements the deque can hold.","Returns the capacity of the buffer, which is the length of …","Returns the number of elements the map can hold","Returns the number of elements the set can hold","Returns the number of elements that the map can hold","Returns the maximum number of elements the String can hold","Returns the maximum number of elements the vector can hold.","Clears the deque, removing all values.","Clears the buffer, replacing every element with the …","Remove all key-value pairs in the map, while preserving …","Clears the set, removing all values.","Clears the map, removing all key-value pairs","Truncates this String, removing all contents.","Clears the vector, removing all values.","Clears the buffer, replacing every element with the given …","","","","","","","","","","Returns true if the set contains a value.","Returns true if the map contains a value for the specified …","Returns true if the map contains a value for the specified …","","","","","","","","","","","","","Visits the values representing the difference, i.e. the …","","","","","Returns true if needle is a suffix of the Vec.","Returns an entry for the corresponding key","","","","","","","","","","","","","","","","","","","Extends the vec from an iterator.","","","Clones and writes all elements in a slice to the buffer.","Clones and appends all elements in a slice to the Vec.","Get the first key-value pair","Get the first value","Get the first key-value pair, with mutable access to the …","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","Constructs a new vector with a fixed capacity of N and …","","Provides a reference to the front element, or None if the …","Provides a mutable reference to the front element, or None …","Gets a reference to the value associated with this entry","Returns a reference to the value corresponding to the key.","Returns a reference to the value corresponding to the key","Gets a mutable reference to the value associated with this …","Returns a mutable reference to the value corresponding to …","Returns a mutable reference to the value corresponding to …","","","","","","","","","Overwrites the underlying map’s value with this entry’…","Inserts this entry into to underlying map, yields a …","Inserts a key-value pair into the map.","Adds a value to the set.","Inserts a key-value pair into the map.","Inserts an element at position index within the vector, …","Visits the values representing the intersection, i.e. the …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Returns the contents of the vector as an array of length M …","Converts a String into a byte vector.","","","","","","","","","","","","","Consumes this entry to yield to key associated with it","Consumes this entry and yields a reference to the …","Returns true if self has no elements in common with other. …","Returns whether the deque is empty.","Returns true if the map contains no elements.","Returns true if the set contains no elements.","Returns true if the map contains no elements","Returns true if the vec is empty","Returns whether the deque is full (i.e. if …","Returns true if the vec is full","Returns true if the set is a subset of another, i.e. other …","Examples","Returns an iterator over the deque.","Return an iterator over the key-value pairs of the map, in …","Return an iterator over the values of the set, in their …","An iterator visiting all key-value pairs in arbitrary …","Returns an iterator that allows modifying each value.","Return an iterator over the key-value pairs of the map, in …","An iterator visiting all key-value pairs in arbitrary …","Gets a reference to the key that this entity corresponds to","Get the key associated with this entry","Return an iterator over the keys of the map, in their order","An iterator visiting all keys in arbitrary order","Get the last key-value pair","Get the last value","Get the last key-value pair, with mutable access to the …","Returns the number of elements currently in the deque.","Returns the current fill level of the buffer.","Return the number of key-value pairs in the map.","Returns the number of elements in the set.","Returns the number of elements in this map","","","","Constructs a new, empty deque with a fixed capacity of N","Constructs a new history buffer.","Creates an empty IndexMap.","Creates an empty IndexSet","Creates an empty LinearMap","Constructs a new, empty String with a fixed capacity of N …","Constructs a new, empty vector with a fixed capacity of N","Constructs a new history buffer, where every element is …","","Returns an iterator for iterating over the buffer from …","","","Removes the last character from the string buffer and …","Removes the last element from a vector and returns it, or …","Removes the item from the back of the deque and returns …","Removes an item from the back of the deque and returns it, …","Removes the item from the front of the deque and returns …","Removes an item from the front of the deque and returns …","Removes the last element from a vector and returns it","Appends the given char to the end of this String.","Appends an item to the back of the collection","Appends an item to the back of the deque","Appends an item to the back of the deque","Appends an item to the front of the deque","Appends an item to the front of the deque","Appends a given string slice onto the end of this String.","Appends an item to the back of the collection","Returns a reference to the most recently written value.","Removes this entry from the map and yields its value","Same as swap_remove","Removes a value from the set. Returns true if the value …","Removes a key from the map, returning the value at the key …","Removes and returns the element at position index within …","Removes this entry from the map and yields its …","Resizes the Vec in-place so that len is equal to new_len.","Resizes the Vec in-place so that len is equal to new_len.","Retains only the elements specified by the predicate.","Retains only the elements specified by the predicate, …","Forces the length of the vector to new_len.","A fixed sorted priority linked list, similar to BinaryHeap …","Returns true if needle is a prefix of the Vec.","Remove the key-value pair equivalent to key and return its …","Removes an element from the vector and returns it.","Removes an element from the vector and returns it.","Visits the values representing the symmetric difference, …","Shortens this String to the specified length.","Shortens the vector, keeping the first len elements and …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Visits the values representing the union, i.e. all the …","Return an iterator over the values of the map, in their …","An iterator visiting all values in arbitrary order","Return an iterator over mutable references to the the …","An iterator visiting all values mutably in arbitrary order","Writes an element to the buffer, overwriting the oldest …","","","","A priority queue implemented with a binary heap.","The binary heap kind: min-heap or max-heap","Max-heap","Min-heap","Structure wrapping a mutable reference to the greatest …","","","","","","","","","Returns the capacity of the binary heap.","Drops all items from the binary heap.","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","Returns the underlying Vec<T,N>. Order is arbitrary and …","Checks if the binary heap is empty.","Returns an iterator visiting all values in the underlying …","Returns a mutable iterator visiting all values in the …","Returns the length of the binary heap.","Creates an empty BinaryHeap as a $K-heap.","Returns the top (greatest if max-heap, smallest if …","Returns a mutable reference to the greatest item in the …","Removes the top (greatest if max-heap, smallest if …","Removes the peeked value from the heap and returns it.","Removes the top (greatest if max-heap, smallest if …","Pushes an item onto the binary heap.","Pushes an item onto the binary heap without first checking …","","","","","","","","","","","","","Comes from SortedLinkedList::find_mut.","Iterator for the linked list.","The linked list kind: min-list or max-list","Index for the SortedLinkedList with specific backing …","Index for the SortedLinkedList with specific backing …","Index for the SortedLinkedList with specific backing …","Marker for Max sorted SortedLinkedList.","Marker for Min sorted SortedLinkedList.","A node in the SortedLinkedList.","The linked list.","Trait for defining an index for the linked list, never …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Find an element in the list that can be changed and …","This will resort the element into the correct position in …","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","Checks if the linked list is empty.","Checks if the linked list is full.","Get an iterator over the sorted list.","Create a new linked list.","Create a new linked list.","Create a new linked list.","","","","","Peek at the first element.","Pops the first element in the list.","This will pop the element from the list.","Pop an element from the list without checking so the list …","Pushes an element to the linked list and sorts it into …","Pushes a value onto the list without checking if the list …","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,0,0,0,0,0,26,0,0,0,0,26,0,0,1,1,1,3,4,4,1,7,4,4,1,1,7,1,3,4,3,3,0,3,7,26,40,44,13,14,15,4,1,18,3,7,26,40,44,13,14,15,4,1,18,3,7,13,14,15,4,1,3,7,13,14,15,4,1,7,3,13,14,15,4,1,18,4,1,14,13,15,3,7,13,14,15,4,1,7,4,1,4,1,14,3,7,15,1,1,13,13,14,15,4,4,4,1,1,1,1,1,1,7,7,13,13,14,14,1,1,1,7,1,13,14,13,3,7,13,14,15,4,4,1,3,7,26,40,44,13,14,15,4,4,4,4,4,4,4,4,4,4,1,18,13,14,15,4,4,4,1,1,4,3,3,40,13,15,40,13,15,4,4,1,1,13,15,13,15,40,44,13,14,15,1,14,3,7,26,40,44,13,14,15,4,1,18,1,4,3,3,3,13,13,13,14,15,1,1,1,18,44,40,14,3,13,14,15,1,3,1,14,14,3,13,14,15,3,13,15,40,44,13,15,13,14,13,3,7,13,14,15,4,4,4,3,7,13,14,15,4,1,7,18,7,4,1,4,1,3,3,3,3,1,4,1,3,3,3,3,4,1,7,40,13,14,15,1,40,1,1,1,1,1,0,1,13,1,1,14,4,1,3,7,26,40,44,13,14,15,4,1,1,18,3,7,26,40,44,13,14,15,4,1,18,3,7,26,40,44,13,14,15,4,1,18,14,13,15,13,15,7,4,4,1,0,0,0,0,0,65,66,53,54,65,66,53,54,53,53,53,53,54,54,54,53,65,66,53,54,65,66,53,54,53,53,53,53,53,53,53,53,53,53,54,53,53,53,65,66,53,54,65,66,53,54,65,66,53,54,0,0,0,0,0,0,0,0,0,0,0,67,68,69,63,64,62,57,58,59,67,68,69,63,64,62,57,58,59,57,58,59,57,58,59,62,62,63,62,57,58,59,63,62,63,57,58,59,67,68,69,63,64,62,57,58,59,67,68,69,63,64,62,57,58,59,64,63,63,63,63,63,63,64,57,58,59,63,63,62,63,63,63,67,68,69,63,64,62,57,58,59,67,68,69,63,64,62,57,58,59,67,68,69,63,64,62,57,58,59],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1,2],[1,1],[1],[3],[4,5],[4,[[1,[6]]]],[1],[7,2],[4,[[2,[6]]]],[4,5],[1,1],[1,2],[7,2],[1,2],[3],[4,5],[3,8],[3,8],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[3,9],[7,9],[[[13,[[0,[10,11]],12]]],9],[[[14,[[0,[10,11]],12]]],9],[[[15,[10]]],9],[4,9],[1,9],[3],[7],[[[13,[[0,[10,11]],12]]]],[[[14,[[0,[10,11]],12]]]],[[[15,[10]]]],[4],[1],[[[7,[[0,[16,17]]]],[0,[16,17]]]],[[[3,[17]]],[[3,[17]]]],[[[13,[[0,[10,11,17]],17,17]]],[[13,[[0,[10,11,17]],17,17]]]],[[[14,[[0,[10,11,17]],17]]],[[14,[[0,[10,11,17]],17]]]],[[[15,[[0,[10,17]],17]]],[[15,[[0,[10,17]],17]]]],[4,4],[[[1,[17]]],[[1,[17]]]],[[[18,[17]]],[[18,[17]]]],[[4,4],19],[[[1,[20]],[1,[20]]],19],[[[14,[[22,[[0,[21,10,11]]]],[0,[10,11]],12]],[0,[21,10,11]]],23],[[[13,[[22,[[0,[21,10,11]]]],[0,[10,11]],12]],[0,[21,10,11]]],23],[[[15,[10]],10],23],[[],3],[[],7],[[],[[13,[[0,[10,11]],[0,[12,24]]]]]],[[],[[14,[[0,[10,11]],[0,[12,24]]]]]],[[],[[15,[10]]]],[[],4],[[],1],[7,2],[4,5],[1,2],[4,5],[1,2],[[[14,[[0,[10,11]],12]],[14,[[0,[10,11]],12]]],[[0,[[0,[10,11]],12]]]],[3],[7],[15],[1],[[[1,[25]],[2,[25]]],23],[[[13,[[0,[10,11]],12]],[0,[10,11]]],[[26,[[0,[10,11]]]]]],[[[13,[[0,[10,11]],10,12]],[13,[[0,[10,11]],10,12]]],23],[[[14,[[0,[10,11]],12]],[14,[[0,[10,11]],12]]],23],[[[15,[10,25]],[15,[10,25]]],23],[[4,5],23],[[4,4],23],[[4,5],23],[[[1,[25]],27],23],[[[1,[25]],27],23],[[[1,[25]],1],23],[[[1,[25]],2],23],[[[1,[25]],2],23],[[[1,[25]],2],23],[[[7,[17]],28]],[[7,28]],[[[13,[[0,[10,11]],12]],28]],[[[13,[[0,[10,11,16]],16,12]],28]],[[[14,[[0,[10,11,16]],12]],28]],[[[14,[[0,[10,11]],12]],28]],[[1,28]],[[[1,[16]],28]],[[1,28]],[[[7,[17]],[2,[17]]]],[[[1,[17]],[2,[17]]],29],[[[13,[[0,[10,11]],12]]],8],[[[14,[[0,[10,11]],12]]],[[8,[[0,[10,11]]]]]],[[[13,[[0,[10,11]],12]]],8],[[[3,[30]],31],32],[[[7,[30]],31],32],[[[13,[[0,[10,11,30]],30,12]],31],32],[[[14,[[0,[10,11,30]],12]],31],32],[[[15,[[0,[10,30]],30]],31],32],[[4,31],32],[[4,31],32],[[[1,[30]],31],32],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[33,4],[5,4],[34,4],[35,4],[36,4],[6,4],[37,4],[[]],[38,4],[39,4],[[]],[[]],[28,[[13,[[0,[10,11]],[0,[12,24]]]]]],[28,[[14,[[0,[10,11]],[0,[12,24]]]]]],[28,[[15,[10]]]],[28,4],[28,4],[28,4],[28,1],[[[2,[17]]],[[29,[[1,[17]]]]]],[5,[[29,[4]]]],[3,8],[3,8],[[[40,[[0,[10,11]]]]]],[[[13,[[22,[[0,[21,11,10]]]],[0,[10,11]],12]],[0,[21,11,10]]],8],[[[15,[[22,[[0,[10,21]]]],10]],[0,[10,21]]],8],[[[40,[[0,[10,11]]]]]],[[[13,[[22,[[0,[21,11,10]]]],[0,[10,11]],12]],[0,[21,11,10]]],8],[[[15,[[22,[[0,[10,21]]]],10]],[0,[10,21]]],8],[[4,41]],[[4,42]],[[[1,[11]],42]],[[[1,[43]],41]],[[[13,[[0,[10,11,[22,[[0,[21,10,11]]]]]],12]],[0,[21,10,11]]]],[[[15,[[0,[[22,[[0,[10,21]]]],10]]]],[0,[10,21]]]],[[[13,[[0,[10,11,[22,[[0,[21,10,11]]]]]],12]],[0,[21,10,11]]]],[[[15,[[0,[[22,[[0,[10,21]]]],10]]]],[0,[10,21]]]],[[[40,[[0,[10,11]]]]]],[[[44,[[0,[10,11]]]]],29],[[[13,[[0,[10,11]],12]],[0,[10,11]]],[[29,[8]]]],[[[14,[[0,[10,11]],12]],[0,[10,11]]],[[29,[23,[0,[10,11]]]]]],[[[15,[10]],10],[[29,[8]]]],[[1,9],29],[[[14,[[0,[10,11]],12]],[14,[[0,[10,11]],12]]],[[0,[[0,[10,11]],12]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[1,[[29,[27,1]]]],[4,[[1,[6]]]],[3],[3],[3],[[[13,[[0,[10,11]],12]]]],[[[13,[[0,[10,11]],12]]]],[[[13,[[0,[10,11]],12]]]],[[[14,[[0,[10,11]],12]]]],[[[15,[10]]]],[1],[1],[1],[[]],[[[44,[[0,[10,11]]]]],[[0,[10,11]]]],[[[40,[[0,[10,11]]]]]],[[[14,[[0,[10,11]],12]],[14,[[0,[10,11]],12]]],23],[3,23],[[[13,[[0,[10,11]],12]]],23],[[[14,[[0,[10,11]],12]]],23],[[[15,[10]]],23],[1,23],[3,23],[1,23],[[[14,[[0,[10,11]],12]],[14,[[0,[10,11]],12]]],23],[[[14,[[0,[10,11]],12]],[14,[[0,[10,11]],12]]],23],0,[[[13,[[0,[10,11]],12]]],[[0,[[0,[10,11]]]]]],[[[14,[[0,[10,11]],12]]],[[0,[[0,[10,11]]]]]],[[[15,[10]]],[[0,[10]]]],0,[[[13,[[0,[10,11]],12]]],[[0,[[0,[10,11]]]]]],[[[15,[10]]],[[0,[10]]]],[[[40,[[0,[10,11]]]]],[[0,[10,11]]]],[[[44,[[0,[10,11]]]]],[[0,[10,11]]]],[[[13,[[0,[10,11]],12]]],45],[[[15,[10]]],45],[[[13,[[0,[10,11]],12]]],8],[[[14,[[0,[10,11]],12]]],[[8,[[0,[10,11]]]]]],[[[13,[[0,[10,11]],12]]],8],[3,9],[7,9],[[[13,[[0,[10,11]],12]]],9],[[[14,[[0,[10,11]],12]]],9],[[[15,[10]]],9],[[4,4],23],[[4,5],23],[[4,5],23],[[],3],[[],7],[[],[[13,[46]]]],[[],[[14,[46]]]],[[],15],[[],4],[[],1],[[[0,[16,17]]],[[7,[[0,[16,17]]]]]],[18,8],[7,18],[[4,4],[[8,[19]]]],[[[1,[47]],[1,[47]]],[[8,[19]]]],[4,[[8,[48]]]],[1,8],[3,8],[3],[3,8],[3],[1],[[4,48],29],[1,29],[3,29],[3],[3,29],[3],[[4,5],29],[1],[7,8],[[[40,[[0,[10,11]]]]]],[[[13,[[22,[[0,[21,11,10]]]],[0,[10,11]],12]],[0,[21,11,10]]],8],[[[14,[[22,[[0,[21,10,11]]]],[0,[10,11]],12]],[0,[21,10,11]]],23],[[[15,[[22,[[0,[10,21]]]],10]],[0,[10,21]]],8],[[1,9]],[[[40,[[0,[10,11]]]]]],[[[1,[17]],9,17],29],[[[1,[[0,[17,24]]]],9],29],[[1,49]],[[1,49]],[[1,9]],0,[[[1,[25]],[2,[25]]],23],[[[13,[[22,[[0,[21,11,10]]]],[0,[10,11]],12]],[0,[21,11,10]]],8],[[1,9]],[[1,9]],[[[14,[[0,[10,11]],12]],[14,[[0,[10,11]],12]]],45],[[4,9]],[[1,9]],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[[2,[17]]],[[29,[[1,[17]]]]]],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],50],[[],50],[[],50],[[],50],[[],50],[[],50],[[],50],[[],50],[[],50],[[],50],[[],50],[[[14,[[0,[10,11]],12]],[14,[[0,[10,11]],12]]],45],[[[13,[[0,[10,11]],12]]],45],[[[15,[10]]],45],[[[13,[[0,[10,11]],12]]],45],[[[15,[10]]],45],[7],[[4,48],[[29,[51]]]],[[4,5],[[29,[51]]]],[[[1,[6]],5],32],0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[[53,[20,52]]],9],[[[53,[20,52]]]],[[[53,[[0,[20,17]],52]]],[[53,[[0,[20,17]],52]]]],[[],[[53,[20,52]]]],[[[54,[20,52]]],20],[[[54,[20,52]]],20],[[[54,[20,52]]]],[[[53,[[0,[20,30]],52]],31],32],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[[53,[20,52]]]],[[[53,[20,52]]],[[1,[20]]]],[[[53,[20,52]]],23],[[[53,[20,52]]],[[55,[20]]]],[[[53,[20,52]]],[[56,[20]]]],[[[53,[20,52]]],9],[[],53],[[[53,[20,52]]],[[8,[20]]]],[[[53,[20,52]]],[[8,[[54,[20,52]]]]]],[[[53,[20,52]]],[[8,[20]]]],[[[54,[20,52]]],20],[[[53,[20,52]]],20],[[[53,[20,52]],20],[[29,[20]]]],[[[53,[20,52]],20]],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],50],[[],50],[[],50],[[],50],0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[57,57],[58,58],[59,59],[[57,57],19],[[58,58],19],[[59,59],19],[[[62,[20,60,61]]]],[[[62,[20,60,61]]]],[[[63,[60]]]],[[[62,[20,60,61]]]],[[57,57],23],[[58,58],23],[[59,59],23],[[[63,[20,60,61]],49],[[8,[[62,[20,60,61]]]]]],[[[62,[20,60,61]]]],[[[63,[[0,[20,30]],60,61]],31],32],[[57,31],32],[[58,31],32],[[59,31],32],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[[63,[20,60,61]]],23],[[[63,[20,60,61]]],23],[[[63,[20,60,61]]],[[64,[20,60,61]]]],[[],[[63,[58]]]],[[],[[63,[57]]]],[[],[[63,[59]]]],[[[64,[20,60,61]]],8],[[57,57],[[8,[19]]]],[[58,58],[[8,[19]]]],[[59,59],[[8,[19]]]],[[[63,[20,60,61]]],[[8,[20]]]],[[[63,[20,60,61]]],[[29,[20]]]],[[[62,[20,60,61]]],20],[[[63,[20,60,61]]],20],[[[63,[20,60,61]],20],[[29,[20]]]],[[[63,[20,60,61]],20]],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],50],[[],50],[[],50],[[],50],[[],50],[[],50],[[],50],[[],50],[[],50]],"c":[],"p":[[3,"Vec",0],[15,"slice"],[3,"Deque",0],[3,"String",0],[15,"str"],[15,"u8"],[3,"HistoryBuffer",0],[4,"Option",505],[15,"usize"],[8,"Eq",506],[8,"Hash",507],[8,"BuildHasher",507],[3,"IndexMap",0],[3,"IndexSet",0],[3,"LinearMap",0],[8,"Copy",508],[8,"Clone",509],[3,"OldestOrdered",0],[4,"Ordering",506],[8,"Ord",506],[8,"Sized",508],[8,"Borrow",510],[15,"bool"],[8,"Default",511],[8,"PartialEq",506],[4,"Entry",0],[15,"array"],[8,"IntoIterator",512],[4,"Result",513],[8,"Debug",514],[3,"Formatter",514],[6,"Result",514],[15,"u16"],[15,"i16"],[15,"i64"],[15,"i8"],[15,"i32"],[15,"u32"],[15,"u64"],[3,"OccupiedEntry",0],[8,"Hasher",515],[8,"Hasher",507],[8,"Hash",515],[3,"VacantEntry",0],[8,"Iterator",516],[3,"BuildHasherDefault",507],[8,"PartialOrd",506],[15,"char"],[8,"FnMut",517],[3,"TypeId",518],[3,"Error",514],[8,"Kind",340],[3,"BinaryHeap",340],[3,"PeekMut",340],[3,"Iter",519],[3,"IterMut",519],[3,"LinkedIndexU8",395],[3,"LinkedIndexU16",395],[3,"LinkedIndexUsize",395],[8,"SortedLinkedListIndex",395],[8,"Kind",395],[3,"FindMut",395],[3,"SortedLinkedList",395],[3,"Iter",395],[4,"Min",340],[4,"Max",340],[3,"Min",395],[3,"Max",395],[3,"Node",395]]},\ -"panic_halt":{"doc":"Set the panicking behavior to halt","t":"","n":[],"q":[],"d":[],"i":[],"f":[],"c":[],"p":[]},\ -"stable_deref_trait":{"doc":"This module defines an unsafe marker trait, StableDeref, …","t":"II","n":["CloneStableDeref","StableDeref"],"q":[[0,"stable_deref_trait"]],"d":["An unsafe marker trait for types where clones deref to the …","An unsafe marker trait for types that deref to a stable …"],"i":[0,0],"f":[0,0],"c":[],"p":[]}\ -}'); -if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)}; -if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex}; diff --git a/docs/doc/settings.html b/docs/doc/settings.html deleted file mode 100644 index d6b71c1..0000000 --- a/docs/doc/settings.html +++ /dev/null @@ -1 +0,0 @@ -Rustdoc settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/docs/doc/src-files.js b/docs/doc/src-files.js deleted file mode 100644 index ef61e92..0000000 --- a/docs/doc/src-files.js +++ /dev/null @@ -1,11 +0,0 @@ -var srcIndex = JSON.parse('{\ -"arduboy_rust":["",[["hardware",[],["buttons.rs","led.rs","mod.rs"]],["library",[],["arduboy2.rs","arduboy_tone.rs","arduboy_tone_pitch.rs","arduino.rs","ardvoice.rs","c.rs","eeprom.rs","mod.rs","progmem.rs","sprites.rs"]]],["lib.rs","prelude.rs","print.rs","serial_print.rs"]],\ -"atomic_polyfill":["",[],["lib.rs"]],\ -"byteorder":["",[],["lib.rs"]],\ -"critical_section":["",[],["lib.rs","mutex.rs"]],\ -"hash32":["",[],["fnv.rs","lib.rs","murmur3.rs"]],\ -"heapless":["",[],["binary_heap.rs","deque.rs","histbuf.rs","indexmap.rs","indexset.rs","lib.rs","linear_map.rs","sealed.rs","sorted_linked_list.rs","string.rs","vec.rs"]],\ -"panic_halt":["",[],["lib.rs"]],\ -"stable_deref_trait":["",[],["lib.rs"]]\ -}'); -createSrcSidebar(); diff --git a/docs/doc/src/arduboy_rust/hardware/buttons.rs.html b/docs/doc/src/arduboy_rust/hardware/buttons.rs.html deleted file mode 100644 index 62d4d80..0000000 --- a/docs/doc/src/arduboy_rust/hardware/buttons.rs.html +++ /dev/null @@ -1,139 +0,0 @@ -buttons.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-
//! A list of all six buttons available on the Arduboy
-/// Just a `const` for the UP button
-pub const UP: ButtonSet = ButtonSet {
-    flag_set: 0b10000000,
-};
-/// Just a `const` for the RIGHT button
-pub const RIGHT: ButtonSet = ButtonSet {
-    flag_set: 0b01000000,
-};
-/// Just a `const` for the LEFT button
-pub const LEFT: ButtonSet = ButtonSet {
-    flag_set: 0b00100000,
-};
-/// Just a `const` for the DOWN button
-pub const DOWN: ButtonSet = ButtonSet {
-    flag_set: 0b00010000,
-};
-/// Just a `const` for the A button
-pub const A: ButtonSet = ButtonSet {
-    flag_set: 0b00001000,
-};
-/// Just a `const` for the B button
-pub const B: ButtonSet = ButtonSet {
-    flag_set: 0b00000100,
-};
-/// Just a `const` for the UP button
-pub const UP_BUTTON: ButtonSet = UP;
-/// Just a `const` for the RIGHT button
-pub const RIGHT_BUTTON: ButtonSet = RIGHT;
-/// Just a `const` for the DOWN button
-pub const DOWN_BUTTON: ButtonSet = DOWN;
-/// Just a `const` for the LEFT button
-pub const LEFT_BUTTON: ButtonSet = LEFT;
-/// Just a `const` for the A button
-pub const A_BUTTON: ButtonSet = A;
-/// Just a `const` for the B button
-pub const B_BUTTON: ButtonSet = B;
-///This struct gives the library a understanding what Buttons on the Arduboy are.
-#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
-pub struct ButtonSet {
-    pub flag_set: u8,
-}
-
-impl ButtonSet {
-    pub unsafe fn pressed(&self) -> bool {
-        crate::library::arduboy2::pressed(self.flag_set)
-    }
-
-    pub unsafe fn just_pressed(&self) -> bool {
-        crate::library::arduboy2::just_pressed(self.flag_set)
-    }
-
-    pub unsafe fn just_released(&self) -> bool {
-        crate::library::arduboy2::just_released(self.flag_set)
-    }
-    pub unsafe fn not_pressed(&self) -> bool {
-        crate::library::arduboy2::not_pressed(self.flag_set)
-    }
-}
-
-impl core::ops::BitOr for ButtonSet {
-    type Output = Self;
-
-    fn bitor(self, other: Self) -> Self {
-        Self {
-            flag_set: self.flag_set | other.flag_set,
-        }
-    }
-}
-
\ No newline at end of file diff --git a/docs/doc/src/arduboy_rust/hardware/led.rs.html b/docs/doc/src/arduboy_rust/hardware/led.rs.html deleted file mode 100644 index 9aa3748..0000000 --- a/docs/doc/src/arduboy_rust/hardware/led.rs.html +++ /dev/null @@ -1,23 +0,0 @@ -led.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-
//! A list of all LED variables available
-///Just a `const` for the red led
-pub const RED_LED: u8 = 10;
-///Just a `const` for the green led
-pub const GREEN_LED: u8 = 11;
-///Just a `const` for the blue led
-pub const BLUE_LED: u8 = 9;
-///Just a `const` for led on
-pub const RGB_ON: u8 = 1;
-///Just a `const` for led off
-pub const RGB_OFF: u8 = 0;
-
\ No newline at end of file diff --git a/docs/doc/src/arduboy_rust/hardware/mod.rs.html b/docs/doc/src/arduboy_rust/hardware/mod.rs.html deleted file mode 100644 index 010373f..0000000 --- a/docs/doc/src/arduboy_rust/hardware/mod.rs.html +++ /dev/null @@ -1,7 +0,0 @@ -mod.rs - source
1
-2
-3
-
//! This is the Module to interact in a save way with the Arduboy hardware.
-pub mod buttons;
-pub mod led;
-
\ No newline at end of file diff --git a/docs/doc/src/arduboy_rust/lib.rs.html b/docs/doc/src/arduboy_rust/lib.rs.html deleted file mode 100644 index 81de551..0000000 --- a/docs/doc/src/arduboy_rust/lib.rs.html +++ /dev/null @@ -1,81 +0,0 @@ -lib.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-
#![cfg(target_arch = "avr")]
-#![no_std]
-#![feature(c_size_t)]
-//! This is the arduboy_rust crate
-//! To get started import the [prelude] to your project.
-//!
-//! Import the module:
-//! ```
-//! use arduboy_rust::prelude::*;
-//! ```
-//! ### Disable C++ libraries
-//! Inside the root directory is a file named `import_config.h`
-//!
-//! You can disable C++ libraries in the `import_config.h` file.
-//! Just comment the unused library definition out.
-//!
-//! Be careful with disabling libraries because:
-//! - The only error you get is something like this if you try to use a function that relies on the library you disabled.
-//! ```text
-//! game.90c69b91e57f285-cgu.0:(.text.loop+0x290): undefined reference to `sound_tone'
-//! ```
-//! - the benefit of disabling will be important in the feature when I add support for the ArduboyG library etc.
-//!
-//! To get an idea, the ArduboyTones Library needs additional 2-3% of the flash memory.
-//!
-//! <a href="https://github.com/zenndev1337/rust-for-arduboy" target="_blank">Here is the link to the GitHub Repo</a>
-
-extern crate panic_halt;
-pub mod hardware;
-mod library;
-pub mod prelude;
-mod print;
-#[doc(inline)]
-pub extern crate heapless;
-pub use crate::library::arduboy2::{self, Arduboy2, Color, FONT_SIZE, HEIGHT, WIDTH};
-pub use crate::library::arduboy_tone::{self, ArduboyTones};
-pub use crate::library::ardvoice::{self, ArdVoice};
-pub use crate::library::eeprom::{EEPROM, EEPROMBYTE};
-pub use crate::library::{arduino, c, sprites};
-pub mod serial_print;
-
\ No newline at end of file diff --git a/docs/doc/src/arduboy_rust/library/arduboy2.rs.html b/docs/doc/src/arduboy_rust/library/arduboy2.rs.html deleted file mode 100644 index 30c3b0e..0000000 --- a/docs/doc/src/arduboy_rust/library/arduboy2.rs.html +++ /dev/null @@ -1,1583 +0,0 @@ -arduboy2.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-
//! This is the Module to interact in a save way with the Arduboy2 C++ library.
-//!
-//! All of the functions are safe wrapped inside the [Arduboy2] struct.
-#![allow(dead_code)]
-use crate::hardware::buttons::ButtonSet;
-use crate::print::Printable;
-use core::ffi::{c_char, c_int, c_long, c_size_t, c_uchar, c_uint, c_ulong};
-use core::mem;
-use core::ops::Not;
-/// The standard font size of the arduboy
-///
-/// this is to calculate with it.
-pub const FONT_SIZE: u8 = 6;
-/// The standard width of the arduboy
-///
-/// this is to calculate with it.
-pub const WIDTH: u8 = 128;
-/// The standard height of the arduboy
-///
-/// this is to calculate with it.
-pub const HEIGHT: u8 = 64;
-
-/// This item is to chose between Black or White
-#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
-#[repr(u8)]
-pub enum Color {
-    /// Led is off
-    Black,
-    /// Led is on
-    White,
-}
-impl Not for Color {
-    type Output = Self;
-
-    fn not(self) -> Self::Output {
-        match self {
-            Color::Black => Color::White,
-            Color::White => Color::Black,
-        }
-    }
-}
-/// This struct is used by a few Arduboy functions.
-#[derive(Debug, Clone, Copy)]
-pub struct Rect {
-    /// Position X
-    pub x: i16,
-    /// Position Y
-    pub y: i16,
-    /// Rect width
-    pub width: u8,
-    /// Rect height
-    pub height: u8,
-}
-/// This struct is used by a few Arduboy functions.
-#[derive(Debug, Clone, Copy)]
-pub struct Point {
-    /// Position X
-    pub x: i16,
-    /// Position Y
-    pub y: i16,
-}
-
-/// This is the struct to interact in a save way with the Arduboy2 C++ library.
-pub struct Arduboy2 {}
-impl Arduboy2 {
-    /// gives you a new instance of the [Arduboy2]
-    /// ## Example
-    /// ```
-    /// const arduboy: Arduboy2 = Arduboy2::new();
-    /// ```
-    pub const fn new() -> Self {
-        Arduboy2 {}
-    }
-    /// Initialize the hardware, display the boot logo, provide boot utilities, etc.
-    /// This function should be called once near the start of the sketch, usually in setup(), before using any other functions in this class. It initializes the display, displays the boot logo, provides "flashlight" and system control features and initializes audio control.
-    pub fn begin(&self) {
-        unsafe { begin() }
-    }
-    /// Clear the display buffer and set the text cursor to location 0, 0.
-    pub fn clear(&self) {
-        unsafe { clear() }
-    }
-    /// Copy the contents of the display buffer to the display.
-    /// The contents of the display buffer in RAM are copied to the display and will appear on the screen.
-    pub fn display(&self) {
-        unsafe { display() }
-    }
-    ///Copy the contents of the display buffer to the display. The display buffer will be cleared to zero.
-    ///
-    ///Operation is the same as calling display() without parameters except additionally the display buffer will be cleared.
-    pub fn display_and_clear_buffer(&self) {
-        unsafe { display_and_clear_buffer() }
-    }
-    ///Draw a horizontal line.
-    ///
-    ///### Parameters:
-    ///
-    ///- x	The X coordinate of the left start point.
-    ///- y	The Y coordinate of the left start point.
-    ///- w	The width of the line.
-    ///
-    ///color	The color of the line (optional; defaults to WHITE).
-    pub fn draw_fast_hline(&self, x: i16, y: i16, w: u8, color: Color) {
-        unsafe { draw_fast_hline_raw(x, y, w, color as u8) }
-    }
-    ///Draw a vertical line.
-    ///
-    ///### Parameters:
-    ///
-    ///- x	The X coordinate of the left start point.
-    ///- y	The Y coordinate of the left start point.
-    ///- h	The height of the line.
-    ///
-    ///color	The color of the line (optional; defaults to WHITE).
-    pub fn draw_fast_vline(&self, x: i16, y: i16, h: u8, color: Color) {
-        unsafe { draw_fast_vline_raw(x, y, h, color as u8) }
-    }
-    ///Set a single pixel in the display buffer to the specified color.
-    ///
-    ///### Parameters
-    ///- x	The X coordinate of the pixel.
-    ///- y	The Y coordinate of the pixel.
-    ///- color	The color of the pixel (optional; defaults to WHITE).
-    ///
-    ///The single pixel specified location in the display buffer is set to the specified color. The values WHITE or BLACK can be used for the color. If the color parameter isn't included, the pixel will be set to WHITE.
-    pub fn draw_pixel(&self, x: i16, y: i16, color: Color) {
-        unsafe { draw_pixel_raw(x, y, color as u8) }
-    }
-    ///Draw a filled-in rectangle of a specified width and height.
-    ///
-    ///### Parameters
-    ///
-    ///- x	The X coordinate of the upper left corner.
-    ///- y	The Y coordinate of the upper left corner.
-    ///- w	The width of the rectangle.
-    ///- h	The height of the rectangle.
-    ///
-    ///color	The color of the pixel (optional; defaults to WHITE).
-    pub fn fill_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color) {
-        unsafe { fill_rect_raw(x, y, w, h, color as u8) }
-    }
-    ///Draw a rectangle of a specified width and height.
-    ///
-    ///Parameters
-    ///-    x	The X coordinate of the upper left corner.
-    ///-    y	The Y coordinate of the upper left corner.
-    ///-    w	The width of the rectangle.
-    ///-    h	The height of the rectangle.
-    ///-    color	The color of the pixel (optional; defaults to WHITE).
-    pub fn draw_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color) {
-        unsafe { draw_rect_raw(x, y, w, h, color as u8) }
-    }
-    ///Draw a circle of a given radius.
-    ///
-    ///Parameters
-    ///-    x0	The X coordinate of the circle's center.
-    ///-    y0	The Y coordinate of the circle's center.
-    ///-    r	The radius of the circle in pixels.
-    ///-    color	The circle's color (optional; defaults to WHITE).
-    pub fn draw_circle(&self, x: i16, y: i16, r: u8, color: Color) {
-        unsafe { draw_circle_raw(x, y, r, color as u8) }
-    }
-    ///Draw a filled-in circle of a given radius.
-    ///
-    ///### Parameters
-    ///
-    ///- x	The X coordinate of the circle's center.
-    ///- y	The Y coordinate of the circle's center.
-    ///- r	The radius of the circle in pixels.
-    ///
-    ///color	The circle's color (optional; defaults to WHITE).
-    pub fn fill_circle(&self, x: i16, y: i16, r: u8, color: Color) {
-        unsafe { fill_circle_raw(x, y, r, color as u8) }
-    }
-    ///Draw a filled-in rectangle with rounded corners.
-    ///
-    ///Parameters
-    ///-    x	The X coordinate of the left edge.
-    ///-    y	The Y coordinate of the top edge.
-    ///-    w	The width of the rectangle.
-    ///-    h	The height of the rectangle.
-    ///-    r	The radius of the semicircles forming the corners.
-    ///-    color	The color of the rectangle (optional; defaults to WHITE).
-    pub fn fill_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color) {
-        unsafe { fill_round_rect(x, y, w, h, r, color as u8) }
-    }
-    ///Draw a rectangle with rounded corners.
-    ///
-    ///Parameters
-    ///-    x	The X coordinate of the left edge.
-    ///-    y	The Y coordinate of the top edge.
-    ///-    w	The width of the rectangle.
-    ///-    h	The height of the rectangle.
-    ///-    r	The radius of the semicircles forming the corners.
-    ///-    color	The color of the rectangle (optional; defaults to WHITE).
-    pub fn draw_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color) {
-        unsafe { draw_round_rect(x, y, w, h, r, color as u8) }
-    }
-    ///Draw a triangle given the coordinates of each corner.
-    ///
-    ///Parameters
-    ///-    x0,x1,x2	The X coordinates of the corners.
-    ///-    y0,y1,y2	The Y coordinates of the corners.
-    ///-    color	The triangle's color (optional; defaults to WHITE).
-    ///
-    ///A triangle is drawn by specifying each of the three corner locations. The corners can be at any position with respect to the others.
-    pub fn draw_triangle(
-        &self,
-        x0: i16,
-        y0: i16,
-        x1: i16,
-        y1: i16,
-        x2: i16,
-        y2: i16,
-        color: Color,
-    ) {
-        unsafe { draw_triangle(x0, y0, x1, y1, x2, y2, color as u8) }
-    }
-    ///Draw a filled-in triangle given the coordinates of each corner.
-    ///
-    ///Parameters
-    ///-    x0,x1,x2	The X coordinates of the corners.
-    ///-    y0,y1,y2	The Y coordinates of the corners.
-    ///-    color	The triangle's color (optional; defaults to WHITE).
-    ///
-    ///A triangle is drawn by specifying each of the three corner locations. The corners can be at any position with respect to the others.
-    pub fn fill_triangle(
-        &self,
-        x0: i16,
-        y0: i16,
-        x1: i16,
-        y1: i16,
-        x2: i16,
-        y2: i16,
-        color: Color,
-    ) {
-        unsafe { fill_triangle(x0, y0, x1, y1, x2, y2, color as u8) }
-    }
-    ///Returns the state of the given pixel in the screen buffer.
-    ///
-    ///### Parameters
-    ///- x	The X coordinate of the pixel.
-    ///- y	The Y coordinate of the pixel.
-    ///
-    ///### Returns
-    ///WHITE if the pixel is on or BLACK if the pixel is off.
-    pub fn get_pixel(&self, x: u8, y: u8) -> Color {
-        unsafe { mem::transmute::<u8, Color>(get_pixel_raw(x, y)) }
-    }
-    /// Seed the random number generator with a random value.
-    ///
-    /// The Arduino pseudorandom number generator is seeded with the random value returned from a call to generateRandomSeed().
-    pub fn init_random_seed(&self) {
-        unsafe { init_random_seed() }
-    }
-    ///Check if a button has just been pressed.
-    ///
-    ///### Parameters
-    ///- button	The button to test for. Only one button should be specified.
-    ///
-    ///### Returns
-    ///true if the specified button has just been pressed.
-    ///
-    ///Return true if the given button was pressed between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.
-    ///
-    ///There is no need to check for the release of the button since it must have been released for this function to return true when pressed again.
-    ///
-    ///This function should only be used to test a single button.
-    pub fn just_pressed(&self, button: ButtonSet) -> bool {
-        unsafe { just_pressed(button.flag_set) }
-    }
-    ///Check if a button has just been released.
-    ///
-    ///### Parameters
-    ///- button	The button to test for. Only one button should be specified.
-    ///
-    ///### Returns
-    ///true if the specified button has just been released.
-    ///
-    ///Return true if the given button was released between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.
-    ///
-    ///There is no need to check for the released of the button since it must have been pressed for this function to return true when pressed again.
-    ///
-    ///This function should only be used to test a single button.
-    pub fn just_released(&self, button: ButtonSet) -> bool {
-        unsafe { just_released(button.flag_set) }
-    }
-    ///Test if the specified buttons are not pressed.
-    ///
-    ///### Parameters
-    ///
-    ///- buttons	A bit mask indicating which buttons to test. (Can be a single button)
-    ///
-    ///### Returns
-    ///
-    /// True if all buttons in the provided mask are currently released.
-    ///
-    ///Read the state of the buttons and return true if all the buttons in the specified mask are currently released.
-    pub fn not_pressed(&self, button: ButtonSet) -> bool {
-        unsafe { not_pressed(button.flag_set) }
-    }
-    ///Indicate that it's time to render the next frame.
-    ///
-    ///### Returns
-    ///true if it's time for the next frame.
-    ///
-    ///When this function returns true, the amount of time has elapsed to display the next frame, as specified by setFrameRate() or setFrameDuration().
-    ///
-    ///This function will normally be called at the start of the rendering loop which would wait for true to be returned before rendering and displaying the next frame.
-    pub fn next_frame(&self) -> bool {
-        unsafe { next_frame() }
-    }
-    ///Poll the buttons and track their state over time.
-    ///
-    ///Read and save the current state of the buttons and also keep track of the button state when this function was previously called. These states are used by the justPressed() and justReleased() functions to determine if a button has changed state between now and the previous call to pollButtons().
-    ///
-    ///This function should be called once at the start of each new frame.
-    ///
-    ///The justPressed() and justReleased() functions rely on this function.
-    pub fn poll_buttons(&self) {
-        unsafe { poll_buttons() }
-    }
-    ///Test if the all of the specified buttons are pressed.
-    ///
-    ///### Parameters
-    ///-   buttons	A bit mask indicating which buttons to test. (Can be a single button)
-    ///
-    ///### Returns
-    ///   true if all buttons in the provided mask are currently pressed.
-    ///
-    ///Read the state of the buttons and return true if all of the buttons in the specified mask are being pressed.
-    pub fn pressed(&self, button: ButtonSet) -> bool {
-        unsafe { pressed(button.flag_set) }
-    }
-    ///The Arduino Print class is available for writing text to the screen buffer.
-    ///
-    ///For an Arduboy2 class object, functions provided by the Arduino Print class can be used to write text to the screen buffer, in the same manner as the Arduino Serial.print(), etc., functions.
-    ///
-    ///Print will use the write() function to actually draw each character in the screen buffer, using the library's font5x7 font. Two character values are handled specially:
-    ///
-    ///- ASCII newline/line feed (\n, 0x0A, inverse white circle). This will move the text cursor position to the start of the next line, based on the current text size.
-    ///- ASCII carriage return (\r, 0x0D, musical eighth note). This character will be ignored.
-    ///
-    ///
-    ///Example
-    /// ```
-    /// let value: i16 = 42;
-    ///
-    /// arduboy.print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the
-    ///                                        // text cursor to the start of the next line
-    /// arduboy.print(f!(b"Hello World\n")); // Prints "Hello World" but does not use the 2kb ram
-    /// arduboy.print(value); // Prints "42"
-    /// arduboy.print("\n\0"); // Sets the text cursor to the start of the next line
-    /// arduboy.print("hello world") // Prints normal [&str]
-    /// ```
-    pub fn print(&self, x: impl Printable) {
-        x.print()
-    }
-    ///Set the location of the text cursor.
-    ///
-    ///### Parameters
-    ///-   x	The X (horizontal) coordinate, in pixels, for the new location of the text cursor.
-    ///
-    /// -  y	The Y (vertical) coordinate, in pixels, for the new location of the text cursor.
-    ///
-    ///The location of the text cursor is set the the specified coordinates. The coordinates are in pixels. Since the coordinates can specify any pixel location, the text does not have to be placed on specific rows. As with all drawing functions, location 0, 0 is the top left corner of the display. The cursor location represents the top left corner of the next character written.
-    pub fn set_cursor(&self, x: i16, y: i16) {
-        unsafe { set_cursor(x, y) }
-    }
-    ///Set the frame rate used by the frame control functions.
-    ///
-    ///### Parameters
-    ///-   rate	The desired frame rate in frames per second.
-    ///
-    ///Normally, the frame rate would be set to the desired value once, at the start of the game, but it can be changed at any time to alter the frame update rate.
-    pub fn set_frame_rate(&self, rate: u8) {
-        unsafe { set_frame_rate(rate) }
-    }
-    ///Set the text character size.
-    ///
-    ///### Parameters
-    ///-   s	The text size multiplier. Must be 1 or higher.
-    ///
-    ///Setting a text size of 1 will result in standard size characters with one pixel for each bit in the bitmap for a character. The value specified is a multiplier. A value of 2 will double the width and height. A value of 3 will triple the dimensions, etc.
-    pub fn set_text_size(&self, size: u8) {
-        unsafe { set_text_size(size) }
-    }
-    ///Turn sound on.
-    ///
-    ///The system is configured to generate sound. This function sets the sound mode only until the unit is powered off.
-    pub fn audio_on(&self) {
-        unsafe { arduboy_audio_on() }
-    }
-    ///Turn sound off (mute).
-    ///
-    ///The system is configured to not produce sound (mute). This function sets the sound mode only until the unit is powered off.
-    pub fn audio_off(&self) {
-        unsafe { arduboy_audio_off() }
-    }
-    /// Save the current sound state in EEPROM.
-    ///
-    ///The current sound state, set by on() or off(), is saved to the reserved system area in EEPROM. This allows the state to carry over between power cycles and after uploading a different sketch.
-    ///
-    ///Note
-    /// EEPROM is limited in the number of times it can be written to. Sketches should not continuously change and then save the state rapidly.
-    pub fn audio_save_on_off(&self) {
-        unsafe { arduboy_audio_save_on_off() }
-    }
-    ///Toggle the sound on/off state.
-    ///
-    ///If the system is configured for sound on, it will be changed to sound off (mute). If sound is off, it will be changed to on. This function sets the sound mode only until the unit is powered off. To save the current mode use saveOnOff().
-    pub fn audio_toggle(&self) {
-        unsafe { arduboy_audio_toggle() }
-    }
-    /// Combines the use function of `audio_on()` and `audio_save_on_off()`
-    pub fn audio_on_and_save(&self) {
-        unsafe {
-            arduboy_audio_on();
-            arduboy_audio_save_on_off()
-        }
-    }
-    ///Get the current sound state.
-    ///
-    ///### Returns
-    ///true if sound is currently enabled (not muted).
-    ///
-    ///This function should be used by code that actually generates sound. If true is returned, sound can be produced. If false is returned, sound should be muted.
-    pub fn audio_enabled(&self) -> bool {
-        unsafe { arduboy_audio_enabled() }
-    }
-    ///Invert the entire display or set it back to normal.
-    ///
-    ///### Parameters
-    ///- inverse	true will invert the display. false will set the display to no-inverted.
-    ///
-    ///Calling this function with a value of true will set the display to inverted mode. A pixel with a value of 0 will be on and a pixel set to 1 will be off.
-    ///
-    ///Once in inverted mode, the display will remain this way until it is set back to non-inverted mode by calling this function with false.
-    pub fn invert(&self, inverse: bool) {
-        unsafe { arduboy_invert(inverse) }
-    }
-    ///Test if a point falls within a rectangle.
-    ///
-    ///Parameters
-    ///-    point	A structure describing the location of the point.
-    ///-    rect	A structure describing the location and size of the rectangle.
-    ///
-    ///Returns
-    ///    true if the specified point is within the specified rectangle.
-    ///
-    ///This function is intended to detemine if an object, whose boundaries are defined by the given rectangle, is in contact with the given point.
-    pub fn collide_point(&self, point: Point, rect: Rect) -> bool {
-        point.x >= rect.x
-            && point.x < rect.x + rect.width as i16
-            && point.y >= rect.y
-            && point.y < rect.y + rect.height as i16
-    }
-    ///Test if a rectangle is intersecting with another rectangle.
-    ///
-    ///Parameters
-    /// -   rect1,rect2	Structures describing the size and locations of the rectangles.
-    ///
-    ///Returns
-    ///    true if the first rectangle is intersecting the second.
-    ///
-    ///This function is intended to detemine if an object, whose boundaries are defined by the given rectangle, is in contact with another rectangular object.
-    pub fn collide_rect(&self, rect1: Rect, rect2: Rect) -> bool {
-        !(rect2.x >= rect1.x + rect1.width as i16
-            || rect2.x + rect2.width as i16 <= rect1.x
-            || rect2.y >= rect1.y + rect1.height as i16
-            || rect2.y + rect2.height as i16 <= rect1.y)
-    }
-    /// Set one of the RGB LEDs digitally, to either fully on or fully off.
-    ///
-    /// Parameters
-    /// -    color	The name of the LED to set. The value given should be one of RED_LED, GREEN_LED or BLUE_LED.
-    /// -    val	Indicates whether to turn the specified LED on or off. The value given should be RGB_ON or RGB_OFF.
-    ///
-    /// This 2 parameter version of the function will set a single LED within the RGB LED either fully on or fully off. See the description of the 3 parameter version of this function for more details on the RGB LED.
-    pub fn digital_write_rgb_single(&self, color: u8, val: u8) {
-        unsafe { digital_write_rgb_single(color, val) }
-    }
-    ///Set the RGB LEDs digitally, to either fully on or fully off.
-    ///
-    ///Parameters
-    ///-    red,green,blue	Use value RGB_ON or RGB_OFF to set each LED.
-    ///
-    ///The RGB LED is actually individual red, green and blue LEDs placed very close together in a single package. This 3 parameter version of the function will set each LED either on or off, to set the RGB LED to 7 different colors at their highest brightness or turn it off.
-    ///```text
-    /// The colors are as follows:
-    /// RED LED    GREEN LED    BLUE LED    COLOR
-    /// RGB_OFF    RGB_OFF      RGB_OFF     OFF
-    /// RGB_OFF    RGB_OFF      RGB_ON      Blue
-    /// RGB_OFF    RGB_ON       RGB_OFF     Green
-    /// RGB_OFF    RGB_ON       RGB_ON      Cyan
-    /// RGB_ON     RGB_OFF      RGB_OFF     Red
-    /// RGB_ON     RGB_OFF      RGB_ON      Magenta
-    /// RGB_ON     RGB_ON       RGB_OFF     Yellow
-    /// RGB_ON     RGB_ON       RGB_ON      White
-    /// ```
-    pub fn digital_write_rgb(&self, red: u8, green: u8, blue: u8) {
-        unsafe { digital_write_rgb(red, green, blue) }
-    }
-    ///Set the brightness of one of the RGB LEDs without affecting the others.
-    ///
-    ///Parameters
-    ///-    color	The name of the LED to set. The value given should be one of RED_LED, GREEN_LED or BLUE_LED.
-    ///-    val	The brightness value for the LED, from 0 to 255.
-    /// 
-    ///**Note**
-    ///> In order to use this function, the 3 parameter version must first be called at least once, in order to initialize the hardware.
-    /// 
-    ///This 2 parameter version of the function will set the brightness of a single LED within the RGB LED without affecting the current brightness of the other two. See the description of the 3 parameter version of this function for more details on the RGB LED.
-    pub fn set_rgb_led_single(&self, color: u8, val: u8) {
-        unsafe { set_rgb_led_single(color, val) }
-    }
-    /// Set the light output of the RGB LED.
-    ///
-    ///Parameters
-    ///-    red,green,blue	The brightness value for each LED.
-    ///
-    /// The RGB LED is actually individual red, green and blue LEDs placed very close together in a single package. By setting the brightness of each LED, the RGB LED can show various colors and intensities. The brightness of each LED can be set to a value from 0 (fully off) to 255 (fully on).
-    ///
-    ///**Note**
-    ///> Certain libraries that take control of the hardware timers may interfere with the ability of this function to properly control the RGB LED. ArduboyPlaytune is one such library known to do this. The `digital_write_rgb()` function will still work properly in this case.
-    ///
-    ///
-    ///**Note**
-    ///> Many of the Kickstarter Arduboys were accidentally shipped with the RGB LED installed incorrectly. For these units, the green LED cannot be lit. As long as the green led is set to off, setting the red LED will actually control the blue LED and setting the blue LED will actually control the red LED. If the green LED is turned fully on, none of the LEDs will light.
-    pub fn set_rgb_led(&self, red: u8, green: u8, blue: u8) {
-        unsafe { set_rgb_led(red, green, blue) }
-    }
-    ///Indicate if the specified number of frames has elapsed.
-    ///
-    ///Parameters
-    ///-    frames	The desired number of elapsed frames.
-    ///
-    ///Returns
-    ///    true if the specified number of frames has elapsed.
-    ///
-    ///This function should be called with the same value each time for a given event. It will return true if the given number of frames has elapsed since the previous frame in which it returned true.
-    ///
-    ///## Example
-    ///If you wanted to fire a shot every 5 frames while the A button is being held down:
-    /// ```
-    /// if arduboy.everyXFrames(5) {
-    ///     if arduboy.pressed(A_BUTTON) {
-    ///         fireShot();
-    ///     }
-    /// }
-    /// ```
-    pub fn every_x_frames(&self, frames: u8) -> bool {
-        unsafe { every_x_frames(frames) }
-    }
-    ///Flip the display vertically or set it back to normal.
-    ///
-    ///Parameters
-    ///-    flipped	true will set vertical flip mode. false will set normal vertical orientation.
-    ///
-    ///Calling this function with a value of true will cause the Y coordinate to start at the bottom edge of the display instead of the top, effectively flipping the display vertically.
-    ///
-    ///Once in vertical flip mode, it will remain this way until normal vertical mode is set by calling this function with a value of false.
-    pub fn flip_vertical(&self, flipped: bool) {
-        unsafe { flip_vertical(flipped) }
-    }
-    ///Flip the display horizontally or set it back to normal.
-    ///
-    ///Parameters
-    /// -   flipped	true will set horizontal flip mode. false will set normal horizontal orientation.
-    ///
-    ///Calling this function with a value of true will cause the X coordinate to start at the left edge of the display instead of the right, effectively flipping the display horizontally.
-    ///
-    ///Once in horizontal flip mode, it will remain this way until normal horizontal mode is set by calling this function with a value of false.
-    pub fn flip_horizontal(&self, flipped: bool) {
-        unsafe { flip_horizontal(flipped) }
-    }
-    ///Set the text foreground color.
-    ///
-    ///Parameters
-    ///-    color	The color to be used for following text. The values WHITE or BLACK should be used.
-    pub fn set_text_color(&self, color: Color) {
-        unsafe { set_text_color(color as u8) }
-    }
-    ///Set the text background color.
-    ///
-    ///Parameters
-    ///-    color	The background color to be used for following text. The values WHITE or BLACK should be used.
-    ///
-    ///The background pixels of following characters will be set to the specified color.
-    ///
-    ///However, if the background color is set to be the same as the text color, the background will be transparent. Only the foreground pixels will be drawn. The background pixels will remain as they were before the character was drawn.
-    pub fn set_text_background_color(&self, color: Color) {
-        unsafe { set_text_background_color(color as u8) }
-    }
-    ///Set the X coordinate of the text cursor location.
-    ///
-    ///Parameters
-    /// -   x	The X (horizontal) coordinate, in pixels, for the new location of the text cursor.
-    ///
-    ///The X coordinate for the location of the text cursor is set to the specified value, leaving the Y coordinate unchanged. For more details about the text cursor, see the setCursor() function.
-    pub fn set_cursor_x(&self, x: i16) {
-        unsafe { set_cursor_x(x) }
-    }
-    ///Set the Y coordinate of the text cursor location.
-    ///
-    ///Parameters
-    ///-    y	The Y (vertical) coordinate, in pixels, for the new location of the text cursor.
-    ///
-    ///The Y coordinate for the location of the text cursor is set to the specified value, leaving the X coordinate unchanged. For more details about the text cursor, see the setCursor() function.
-    pub fn set_cursor_y(&self, y: i16) {
-        unsafe { set_cursor_y(y) }
-    }
-    ///Set or disable text wrap mode.
-    ///
-    ///Parameters
-    /// -   w	true enables text wrap mode. false disables it.
-    ///
-    ///Text wrap mode is enabled by specifying true. In wrap mode, if a character to be drawn would end up partially or fully past the right edge of the screen (based on the current text size), it will be placed at the start of the next line. The text cursor will be adjusted accordingly.
-    ///
-    ///If wrap mode is disabled, characters will always be written at the current text cursor position. A character near the right edge of the screen may only be partially displayed and characters drawn at a position past the right edge of the screen will remain off screen.
-    pub fn set_text_wrap(&self, w: bool) {
-        unsafe { set_text_wrap(w) }
-    }
-    ///Idle the CPU to save power.
-    ///
-    ///This puts the CPU in idle sleep mode. You should call this as often as you can for the best power savings. The timer 0 overflow interrupt will wake up the chip every 1ms, so even at 60 FPS a well written app should be able to sleep maybe half the time in between rendering it's own frames.
-    pub fn idle(&self) {
-        unsafe { idle() }
-    }
-}
-
-extern "C" {
-
-    #[link_name = "arduboy_begin"]
-    fn begin();
-
-    #[link_name = "arduboy_clear"]
-    fn clear();
-
-    #[link_name = "arduboy_display"]
-    fn display();
-
-    #[link_name = "arduboy_display_and_clear_buffer"]
-    fn display_and_clear_buffer();
-
-    #[link_name = "arduboy_draw_fast_hline"]
-    fn draw_fast_hline_raw(x: i16, y: i16, w: u8, color: u8);
-
-    #[link_name = "arduboy_draw_fast_vline"]
-    fn draw_fast_vline_raw(x: i16, y: i16, h: u8, color: u8);
-
-    #[link_name = "arduboy_draw_pixel"]
-    fn draw_pixel_raw(x: i16, y: i16, color: u8);
-
-    #[link_name = "arduboy_draw_circle"]
-    fn draw_circle_raw(x: i16, y: i16, r: u8, color: u8);
-
-    #[link_name = "arduboy_draw_rect"]
-    fn draw_rect_raw(x: i16, y: i16, w: u8, h: u8, color: u8);
-
-    #[link_name = "arduboy_fill_circle"]
-    fn fill_circle_raw(x: i16, y: i16, r: u8, color: u8);
-
-    #[link_name = "arduboy_fill_rect"]
-    fn fill_rect_raw(x: i16, y: i16, w: u8, h: u8, color: u8);
-
-    #[link_name = "arduboy_fill_round_rect"]
-    fn fill_round_rect(x: i16, y: i16, w: u8, h: u8, r: u8, color: u8);
-
-    #[link_name = "arduboy_draw_round_rect"]
-    fn draw_round_rect(x: i16, y: i16, w: u8, h: u8, r: u8, color: u8);
-
-    #[link_name = "arduboy_fill_triangle"]
-    fn fill_triangle(x0: i16, y0: i16, x1: i16, y1: i16, x2: i16, y2: i16, color: u8);
-
-    #[link_name = "arduboy_draw_triangle"]
-    fn draw_triangle(x0: i16, y0: i16, x1: i16, y1: i16, x2: i16, y2: i16, color: u8);
-
-    #[link_name = "arduboy_get_pixel"]
-    fn get_pixel_raw(x: u8, y: u8) -> u8;
-    #[doc(hidden)]
-    #[link_name = "arduboy_init_random_seed"]
-    fn init_random_seed();
-    #[doc(hidden)]
-    #[link_name = "arduboy_just_pressed"]
-    pub fn just_pressed(button: u8) -> bool;
-    #[doc(hidden)]
-    #[link_name = "arduboy_just_released"]
-    pub fn just_released(button: u8) -> bool;
-    #[doc(hidden)]
-    #[link_name = "arduboy_not_pressed"]
-    pub fn not_pressed(button: u8) -> bool;
-
-    #[link_name = "arduboy_next_frame"]
-    fn next_frame() -> bool;
-
-    #[link_name = "arduboy_poll_buttons"]
-    fn poll_buttons();
-    #[doc(hidden)]
-    #[link_name = "arduboy_pressed"]
-    pub fn pressed(buttons: u8) -> bool;
-    #[doc(hidden)]
-    #[link_name = "arduboy_print_chars"]
-    pub fn print_chars(cstr: *const c_char);
-    #[doc(hidden)]
-    #[link_name = "arduboy_print_chars_progmem"]
-    pub fn print_chars_progmem(pstring: *const c_char);
-
-    // #[link_name = "arduboy_print_char"]
-    // fn print_char(c: c_char) -> c_size_t;
-    #[doc(hidden)]
-    #[link_name = "arduboy_print_int"]
-    pub fn print_int(n: c_int, base: c_int) -> c_size_t;
-    #[doc(hidden)]
-    #[link_name = "arduboy_print_long"]
-    pub fn print_long(n: c_long, base: c_int) -> c_size_t;
-    #[doc(hidden)]
-    #[link_name = "arduboy_print_unsigned_char"]
-    pub fn print_unsigned_char(n: c_uchar, base: c_int) -> c_size_t;
-    #[doc(hidden)]
-    #[link_name = "arduboy_print_unsigned_int"]
-    pub fn print_unsigned_int(n: c_uint, base: c_int) -> c_size_t;
-    #[doc(hidden)]
-    #[link_name = "arduboy_print_unsigned_long"]
-    pub fn print_unsigned_long(n: c_ulong, base: c_int) -> c_size_t;
-
-    #[link_name = "arduboy_set_cursor"]
-    fn set_cursor(x: i16, y: i16);
-
-    #[link_name = "arduboy_set_frame_rate"]
-    fn set_frame_rate(rate: u8);
-
-    #[link_name = "arduboy_set_text_size"]
-    fn set_text_size(size: u8);
-
-    #[link_name = "arduboy_audio_on"]
-    fn arduboy_audio_on();
-
-    #[link_name = "arduboy_audio_off"]
-    fn arduboy_audio_off();
-
-    #[link_name = "arduboy_audio_save_on_off"]
-    fn arduboy_audio_save_on_off();
-
-    #[link_name = "arduboy_audio_toggle"]
-    fn arduboy_audio_toggle();
-
-    #[link_name = "arduboy_audio_enabled"]
-    fn arduboy_audio_enabled() -> bool;
-
-    #[link_name = "arduboy_invert"]
-    fn arduboy_invert(inverse: bool);
-
-    #[link_name = "arduboy_every_x_frames"]
-    fn every_x_frames(frames: u8) -> bool;
-
-    #[link_name = "arduboy_flip_horizontal"]
-    fn flip_horizontal(flipped: bool);
-
-    #[link_name = "arduboy_flip_vertical"]
-    fn flip_vertical(flipped: bool);
-
-    #[link_name = "arduboy_set_text_color"]
-    fn set_text_color(color: u8);
-
-    #[link_name = "arduboy_set_text_background_color"]
-    fn set_text_background_color(color: u8);
-
-    #[link_name = "arduboy_set_cursor_x"]
-    fn set_cursor_x(x: i16);
-    #[link_name = "arduboy_set_cursor_y"]
-    fn set_cursor_y(y: i16);
-
-    #[link_name = "arduboy_set_text_wrap"]
-    fn set_text_wrap(w: bool);
-
-    #[link_name = "arduboy_idle"]
-    fn idle();
-
-    #[link_name = "arduboy_digital_write_rgb_single"]
-    fn digital_write_rgb_single(color: c_uchar, val: c_uchar);
-
-    #[link_name = "arduboy_digital_write_rgb"]
-    fn digital_write_rgb(red: c_uchar, green: c_uchar, blue: c_uchar);
-
-    #[link_name = "arduboy_set_rgb_led_single"]
-    fn set_rgb_led_single(color: c_uchar, val: c_uchar);
-
-    #[link_name = "arduboy_set_rgb_led"]
-    fn set_rgb_led(red: c_uchar, green: c_uchar, blue: c_uchar);
-}
-
\ No newline at end of file diff --git a/docs/doc/src/arduboy_rust/library/arduboy_tone.rs.html b/docs/doc/src/arduboy_rust/library/arduboy_tone.rs.html deleted file mode 100644 index 8db3ac9..0000000 --- a/docs/doc/src/arduboy_rust/library/arduboy_tone.rs.html +++ /dev/null @@ -1,305 +0,0 @@ -arduboy_tone.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-
//!This is the Module to interact in a save way with the ArduboyTones C++ library.
-//!
-//! You will need to uncomment the ArduboyTones_Library in the import_config.h file.
-pub use crate::library::arduboy_tone_pitch;
-use core::ffi::{c_uchar, c_uint, c_ulong};
-extern "C" {
-    #[link_name = "sound_tone"]
-    fn sound_tone(frequency: c_uint, duration: c_ulong);
-    #[link_name = "sound_tone2"]
-    fn sound_tone2(frequency1: c_uint, duration1: c_ulong, frequency2: c_uint, duration2: c_ulong);
-    #[link_name = "sound_tone3"]
-    fn sound_tone3(
-        frequency1: c_uint,
-        duration1: c_ulong,
-        frequency2: c_uint,
-        duration2: c_ulong,
-        frequency3: c_uint,
-        duration3: c_ulong,
-    );
-
-    #[link_name = "sound_tones"]
-    fn sound_tones(tones: *const c_uint);
-
-    #[link_name = "sound_no_tone"]
-    fn sound_no_tone();
-
-    #[link_name = "sound_playing"]
-    fn sound_playing() -> bool;
-
-    #[link_name = "sound_tones_in_ram"]
-    fn sound_tones_in_ram(tones: *mut c_ulong);
-
-    #[link_name = "sound_volume_mode"]
-    fn sound_volume_mode(mode: c_uchar);
-
-}
-///This is the struct to interact in a save way with the ArduboyTones C++ library.
-///
-/// You will need to uncomment the ArduboyTones_Library in the import_config.h file.
-pub struct ArduboyTones {}
-impl ArduboyTones {
-    ///Get a new instance of [ArduboyTones]
-    /// ## Example
-    /// ```
-    /// const sound: ArduboyTones = ArduboyTones::new();
-    /// ```
-    pub const fn new() -> ArduboyTones {
-        ArduboyTones {}
-    }
-    ///Play a single tone.
-    ///
-    ///- freq The frequency of the tone, in hertz.
-    ///- dur The duration to play the tone for, in 1024ths of a
-    ///second (very close to milliseconds). A duration of 0, or if not provided,
-    ///means play forever, or until `noTone()` is called or a new tone or
-    ///sequence is started.
-    pub fn tone(&self, frequency: u16, duration: u32) {
-        unsafe { sound_tone(frequency, duration) }
-    }
-    /// Play two tones in sequence.
-    ///
-    /// - freq1,freq2 The frequency of the tone in hertz.
-    /// - dur1,dur2 The duration to play the tone for, in 1024ths of a
-    /// second (very close to milliseconds).
-    pub fn tone2(&self, frequency1: u16, duration1: u32, frequency2: u16, duration2: u32) {
-        unsafe { sound_tone2(frequency1, duration1, frequency2, duration2) }
-    }
-    /// Play three tones in sequence.
-    ///
-    /// - freq1,freq2,freq3 The frequency of the tone, in hertz.
-    /// - dur1,dur2,dur3 The duration to play the tone for, in 1024ths of a
-    /// second (very close to milliseconds).
-    pub fn tone3(
-        &self,
-        frequency1: u16,
-        duration1: u32,
-        frequency2: u16,
-        duration2: u32,
-        frequency3: u16,
-        duration3: u32,
-    ) {
-        unsafe { sound_tone3(frequency1, duration1, frequency2, duration2, frequency3, duration3) }
-    }
-    /// Play a tone sequence from frequency/duration pairs in a PROGMEM array.
-    ///
-    /// - tones A pointer to an array of frequency/duration pairs.
-    ///
-    /// The array must be placed in code space using `PROGMEM`.
-    ///
-    /// See the `tone()` function for details on the frequency and duration values.
-    /// A frequency of 0 for any tone means silence (a musical rest).
-    ///
-    /// The last element of the array must be `TONES_END` or `TONES_REPEAT`.
-    ///
-    /// Example:
-    /// ```
-    /// progmem!(
-    ///     static sound1:[u8;_]=[220,1000, 0,250, 440,500, 880,2000,TONES_END]
-    /// );
-    ///
-    /// tones(get_tones_addr!(sound1));
-    /// ```
-    pub fn tones(&self, tones: *const u16) {
-        unsafe { sound_tones(tones) }
-    }
-    /// Stop playing the tone or sequence.
-    ///
-    /// If a tone or sequence is playing, it will stop. If nothing
-    /// is playing, this function will do nothing.
-    pub fn no_tone(&self) {
-        unsafe { sound_no_tone() }
-    }
-    /// Check if a tone or tone sequence is playing.
-    ///
-    /// - return boolean `true` if playing (even if sound is muted).
-    pub fn playing(&self) -> bool {
-        unsafe { sound_playing() }
-    }
-    /// Play a tone sequence from frequency/duration pairs in an array in RAM.
-    ///
-    /// - tones A pointer to an array of frequency/duration pairs.
-    ///
-    /// The array must be located in RAM.
-    ///
-    /// See the `tone()` function for details on the frequency and duration values.
-    /// A frequency of 0 for any tone means silence (a musical rest).
-    ///
-    /// The last element of the array must be `TONES_END` or `TONES_REPEAT`.
-    ///
-    /// Example:
-    ///
-    /// ```
-    /// let sound2: [u16; 9] = [220, 1000, 0, 250, 440, 500, 880, 2000, TONES_END];
-    /// ```
-    /// Using `tones()`, with the data in PROGMEM, is normally a better
-    /// choice. The only reason to use tonesInRAM() would be if dynamically
-    /// altering the contents of the array is required.
-    pub fn tones_in_ram(&self, tones: *mut u32) {
-        unsafe { sound_tones_in_ram(tones) }
-    }
-    /// Set the volume to always normal, always high, or tone controlled.
-    ///
-    /// One of the following values should be used:
-    ///
-    /// - `VOLUME_IN_TONE` The volume of each tone will be specified in the tone
-    ///    itself.
-    /// - `VOLUME_ALWAYS_NORMAL` All tones will play at the normal volume level.
-    /// - `VOLUME_ALWAYS_HIGH` All tones will play at the high volume level.
-    pub fn volume_mode(&self, mode: u8) {
-        unsafe { sound_volume_mode(mode) }
-    }
-}
-
\ No newline at end of file diff --git a/docs/doc/src/arduboy_rust/library/arduboy_tone_pitch.rs.html b/docs/doc/src/arduboy_rust/library/arduboy_tone_pitch.rs.html deleted file mode 100644 index fc4382d..0000000 --- a/docs/doc/src/arduboy_rust/library/arduboy_tone_pitch.rs.html +++ /dev/null @@ -1,501 +0,0 @@ -arduboy_tone_pitch.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-
//! A list of all tones available and used by the Sounds library Arduboy2Tones
-pub const TONES_END: u16 = 0x8000;
-pub const TONES_REPEAT: u16 = 0x8001;
-pub const TONE_HIGH_VOLUME: u16 = 0x8000;
-pub const VOLUME_IN_TONE: u8 = 0;
-pub const VOLUME_ALWAYS_NORMAL: u8 = 1;
-pub const VOLUME_ALWAYS_HIGH: u8 = 2;
-
-pub const NOTE_REST: u16 = 0;
-pub const NOTE_C0: u16 = 16;
-pub const NOTE_CS0: u16 = 17;
-pub const NOTE_D0: u16 = 18;
-pub const NOTE_DS0: u16 = 19;
-pub const NOTE_E0: u16 = 21;
-pub const NOTE_F0: u16 = 22;
-pub const NOTE_FS0: u16 = 23;
-pub const NOTE_G0: u16 = 25;
-pub const NOTE_GS0: u16 = 26;
-pub const NOTE_A0: u16 = 28;
-pub const NOTE_AS0: u16 = 29;
-pub const NOTE_B0: u16 = 31;
-pub const NOTE_C1: u16 = 33;
-pub const NOTE_CS1: u16 = 35;
-pub const NOTE_D1: u16 = 37;
-pub const NOTE_DS1: u16 = 39;
-pub const NOTE_E1: u16 = 41;
-pub const NOTE_F1: u16 = 44;
-pub const NOTE_FS1: u16 = 46;
-pub const NOTE_G1: u16 = 49;
-pub const NOTE_GS1: u16 = 52;
-pub const NOTE_A1: u16 = 55;
-pub const NOTE_AS1: u16 = 58;
-pub const NOTE_B1: u16 = 62;
-pub const NOTE_C2: u16 = 65;
-pub const NOTE_CS2: u16 = 69;
-pub const NOTE_D2: u16 = 73;
-pub const NOTE_DS2: u16 = 78;
-pub const NOTE_E2: u16 = 82;
-pub const NOTE_F2: u16 = 87;
-pub const NOTE_FS2: u16 = 93;
-pub const NOTE_G2: u16 = 98;
-pub const NOTE_GS2: u16 = 104;
-pub const NOTE_A2: u16 = 110;
-pub const NOTE_AS2: u16 = 117;
-pub const NOTE_B2: u16 = 123;
-pub const NOTE_C3: u16 = 131;
-pub const NOTE_CS3: u16 = 139;
-pub const NOTE_D3: u16 = 147;
-pub const NOTE_DS3: u16 = 156;
-pub const NOTE_E3: u16 = 165;
-pub const NOTE_F3: u16 = 175;
-pub const NOTE_FS3: u16 = 185;
-pub const NOTE_G3: u16 = 196;
-pub const NOTE_GS3: u16 = 208;
-pub const NOTE_A3: u16 = 220;
-pub const NOTE_AS3: u16 = 233;
-pub const NOTE_B3: u16 = 247;
-pub const NOTE_C4: u16 = 262;
-pub const NOTE_CS4: u16 = 277;
-pub const NOTE_D4: u16 = 294;
-pub const NOTE_DS4: u16 = 311;
-pub const NOTE_E4: u16 = 330;
-pub const NOTE_F4: u16 = 349;
-pub const NOTE_FS4: u16 = 370;
-pub const NOTE_G4: u16 = 392;
-pub const NOTE_GS4: u16 = 415;
-pub const NOTE_A4: u16 = 440;
-pub const NOTE_AS4: u16 = 466;
-pub const NOTE_B4: u16 = 494;
-pub const NOTE_C5: u16 = 523;
-pub const NOTE_CS5: u16 = 554;
-pub const NOTE_D5: u16 = 587;
-pub const NOTE_DS5: u16 = 622;
-pub const NOTE_E5: u16 = 659;
-pub const NOTE_F5: u16 = 698;
-pub const NOTE_FS5: u16 = 740;
-pub const NOTE_G5: u16 = 784;
-pub const NOTE_GS5: u16 = 831;
-pub const NOTE_A5: u16 = 880;
-pub const NOTE_AS5: u16 = 932;
-pub const NOTE_B5: u16 = 988;
-pub const NOTE_C6: u16 = 1047;
-pub const NOTE_CS6: u16 = 1109;
-pub const NOTE_D6: u16 = 1175;
-pub const NOTE_DS6: u16 = 1245;
-pub const NOTE_E6: u16 = 1319;
-pub const NOTE_F6: u16 = 1397;
-pub const NOTE_FS6: u16 = 1480;
-pub const NOTE_G6: u16 = 1568;
-pub const NOTE_GS6: u16 = 1661;
-pub const NOTE_A6: u16 = 1760;
-pub const NOTE_AS6: u16 = 1865;
-pub const NOTE_B6: u16 = 1976;
-pub const NOTE_C7: u16 = 2093;
-pub const NOTE_CS7: u16 = 2218;
-pub const NOTE_D7: u16 = 2349;
-pub const NOTE_DS7: u16 = 2489;
-pub const NOTE_E7: u16 = 2637;
-pub const NOTE_F7: u16 = 2794;
-pub const NOTE_FS7: u16 = 2960;
-pub const NOTE_G7: u16 = 3136;
-pub const NOTE_GS7: u16 = 3322;
-pub const NOTE_A7: u16 = 3520;
-pub const NOTE_AS7: u16 = 3729;
-pub const NOTE_B7: u16 = 3951;
-pub const NOTE_C8: u16 = 4186;
-pub const NOTE_CS8: u16 = 4435;
-pub const NOTE_D8: u16 = 4699;
-pub const NOTE_DS8: u16 = 4978;
-pub const NOTE_E8: u16 = 5274;
-pub const NOTE_F8: u16 = 5588;
-pub const NOTE_FS8: u16 = 5920;
-pub const NOTE_G8: u16 = 6272;
-pub const NOTE_GS8: u16 = 6645;
-pub const NOTE_A8: u16 = 7040;
-pub const NOTE_AS8: u16 = 7459;
-pub const NOTE_B8: u16 = 7902;
-pub const NOTE_C9: u16 = 8372;
-pub const NOTE_CS9: u16 = 8870;
-pub const NOTE_D9: u16 = 9397;
-pub const NOTE_DS9: u16 = 9956;
-pub const NOTE_E9: u16 = 10548;
-pub const NOTE_F9: u16 = 11175;
-pub const NOTE_FS9: u16 = 11840;
-pub const NOTE_G9: u16 = 12544;
-pub const NOTE_GS9: u16 = 13290;
-pub const NOTE_A9: u16 = 14080;
-pub const NOTE_AS9: u16 = 14917;
-pub const NOTE_B9: u16 = 15804;
-
-pub const NOTE_C0H: u16 = NOTE_C0 + TONE_HIGH_VOLUME;
-pub const NOTE_CS0H: u16 = NOTE_CS0 + TONE_HIGH_VOLUME;
-pub const NOTE_D0H: u16 = NOTE_D0 + TONE_HIGH_VOLUME;
-pub const NOTE_DS0H: u16 = NOTE_DS0 + TONE_HIGH_VOLUME;
-pub const NOTE_E0H: u16 = NOTE_E0 + TONE_HIGH_VOLUME;
-pub const NOTE_F0H: u16 = NOTE_F0 + TONE_HIGH_VOLUME;
-pub const NOTE_FS0H: u16 = NOTE_FS0 + TONE_HIGH_VOLUME;
-pub const NOTE_G0H: u16 = NOTE_G0 + TONE_HIGH_VOLUME;
-pub const NOTE_GS0H: u16 = NOTE_GS0 + TONE_HIGH_VOLUME;
-pub const NOTE_A0H: u16 = NOTE_A0 + TONE_HIGH_VOLUME;
-pub const NOTE_AS0H: u16 = NOTE_AS0 + TONE_HIGH_VOLUME;
-pub const NOTE_B0H: u16 = NOTE_B0 + TONE_HIGH_VOLUME;
-pub const NOTE_C1H: u16 = NOTE_C1 + TONE_HIGH_VOLUME;
-pub const NOTE_CS1H: u16 = NOTE_CS1 + TONE_HIGH_VOLUME;
-pub const NOTE_D1H: u16 = NOTE_D1 + TONE_HIGH_VOLUME;
-pub const NOTE_DS1H: u16 = NOTE_DS1 + TONE_HIGH_VOLUME;
-pub const NOTE_E1H: u16 = NOTE_E1 + TONE_HIGH_VOLUME;
-pub const NOTE_F1H: u16 = NOTE_F1 + TONE_HIGH_VOLUME;
-pub const NOTE_FS1H: u16 = NOTE_FS1 + TONE_HIGH_VOLUME;
-pub const NOTE_G1H: u16 = NOTE_G1 + TONE_HIGH_VOLUME;
-pub const NOTE_GS1H: u16 = NOTE_GS1 + TONE_HIGH_VOLUME;
-pub const NOTE_A1H: u16 = NOTE_A1 + TONE_HIGH_VOLUME;
-pub const NOTE_AS1H: u16 = NOTE_AS1 + TONE_HIGH_VOLUME;
-pub const NOTE_B1H: u16 = NOTE_B1 + TONE_HIGH_VOLUME;
-pub const NOTE_C2H: u16 = NOTE_C2 + TONE_HIGH_VOLUME;
-pub const NOTE_CS2H: u16 = NOTE_CS2 + TONE_HIGH_VOLUME;
-pub const NOTE_D2H: u16 = NOTE_D2 + TONE_HIGH_VOLUME;
-pub const NOTE_DS2H: u16 = NOTE_DS2 + TONE_HIGH_VOLUME;
-pub const NOTE_E2H: u16 = NOTE_E2 + TONE_HIGH_VOLUME;
-pub const NOTE_F2H: u16 = NOTE_F2 + TONE_HIGH_VOLUME;
-pub const NOTE_FS2H: u16 = NOTE_FS2 + TONE_HIGH_VOLUME;
-pub const NOTE_G2H: u16 = NOTE_G2 + TONE_HIGH_VOLUME;
-pub const NOTE_GS2H: u16 = NOTE_GS2 + TONE_HIGH_VOLUME;
-pub const NOTE_A2H: u16 = NOTE_A2 + TONE_HIGH_VOLUME;
-pub const NOTE_AS2H: u16 = NOTE_AS2 + TONE_HIGH_VOLUME;
-pub const NOTE_B2H: u16 = NOTE_B2 + TONE_HIGH_VOLUME;
-pub const NOTE_C3H: u16 = NOTE_C3 + TONE_HIGH_VOLUME;
-pub const NOTE_CS3H: u16 = NOTE_CS3 + TONE_HIGH_VOLUME;
-pub const NOTE_D3H: u16 = NOTE_D3 + TONE_HIGH_VOLUME;
-pub const NOTE_DS3H: u16 = NOTE_DS3 + TONE_HIGH_VOLUME;
-pub const NOTE_E3H: u16 = NOTE_E3 + TONE_HIGH_VOLUME;
-pub const NOTE_F3H: u16 = NOTE_F3 + TONE_HIGH_VOLUME;
-pub const NOTE_FS3H: u16 = NOTE_F3 + TONE_HIGH_VOLUME;
-pub const NOTE_G3H: u16 = NOTE_G3 + TONE_HIGH_VOLUME;
-pub const NOTE_GS3H: u16 = NOTE_GS3 + TONE_HIGH_VOLUME;
-pub const NOTE_A3H: u16 = NOTE_A3 + TONE_HIGH_VOLUME;
-pub const NOTE_AS3H: u16 = NOTE_AS3 + TONE_HIGH_VOLUME;
-pub const NOTE_B3H: u16 = NOTE_B3 + TONE_HIGH_VOLUME;
-pub const NOTE_C4H: u16 = NOTE_C4 + TONE_HIGH_VOLUME;
-pub const NOTE_CS4H: u16 = NOTE_CS4 + TONE_HIGH_VOLUME;
-pub const NOTE_D4H: u16 = NOTE_D4 + TONE_HIGH_VOLUME;
-pub const NOTE_DS4H: u16 = NOTE_DS4 + TONE_HIGH_VOLUME;
-pub const NOTE_E4H: u16 = NOTE_E4 + TONE_HIGH_VOLUME;
-pub const NOTE_F4H: u16 = NOTE_F4 + TONE_HIGH_VOLUME;
-pub const NOTE_FS4H: u16 = NOTE_FS4 + TONE_HIGH_VOLUME;
-pub const NOTE_G4H: u16 = NOTE_G4 + TONE_HIGH_VOLUME;
-pub const NOTE_GS4H: u16 = NOTE_GS4 + TONE_HIGH_VOLUME;
-pub const NOTE_A4H: u16 = NOTE_A4 + TONE_HIGH_VOLUME;
-pub const NOTE_AS4H: u16 = NOTE_AS4 + TONE_HIGH_VOLUME;
-pub const NOTE_B4H: u16 = NOTE_B4 + TONE_HIGH_VOLUME;
-pub const NOTE_C5H: u16 = NOTE_C5 + TONE_HIGH_VOLUME;
-pub const NOTE_CS5H: u16 = NOTE_CS5 + TONE_HIGH_VOLUME;
-pub const NOTE_D5H: u16 = NOTE_D5 + TONE_HIGH_VOLUME;
-pub const NOTE_DS5H: u16 = NOTE_DS5 + TONE_HIGH_VOLUME;
-pub const NOTE_E5H: u16 = NOTE_E5 + TONE_HIGH_VOLUME;
-pub const NOTE_F5H: u16 = NOTE_F5 + TONE_HIGH_VOLUME;
-pub const NOTE_FS5H: u16 = NOTE_FS5 + TONE_HIGH_VOLUME;
-pub const NOTE_G5H: u16 = NOTE_G5 + TONE_HIGH_VOLUME;
-pub const NOTE_GS5H: u16 = NOTE_GS5 + TONE_HIGH_VOLUME;
-pub const NOTE_A5H: u16 = NOTE_A5 + TONE_HIGH_VOLUME;
-pub const NOTE_AS5H: u16 = NOTE_AS5 + TONE_HIGH_VOLUME;
-pub const NOTE_B5H: u16 = NOTE_B5 + TONE_HIGH_VOLUME;
-pub const NOTE_C6H: u16 = NOTE_C6 + TONE_HIGH_VOLUME;
-pub const NOTE_CS6H: u16 = NOTE_CS6 + TONE_HIGH_VOLUME;
-pub const NOTE_D6H: u16 = NOTE_D6 + TONE_HIGH_VOLUME;
-pub const NOTE_DS6H: u16 = NOTE_DS6 + TONE_HIGH_VOLUME;
-pub const NOTE_E6H: u16 = NOTE_E6 + TONE_HIGH_VOLUME;
-pub const NOTE_F6H: u16 = NOTE_F6 + TONE_HIGH_VOLUME;
-pub const NOTE_FS6H: u16 = NOTE_FS6 + TONE_HIGH_VOLUME;
-pub const NOTE_G6H: u16 = NOTE_G6 + TONE_HIGH_VOLUME;
-pub const NOTE_GS6H: u16 = NOTE_GS6 + TONE_HIGH_VOLUME;
-pub const NOTE_A6H: u16 = NOTE_A6 + TONE_HIGH_VOLUME;
-pub const NOTE_AS6H: u16 = NOTE_AS6 + TONE_HIGH_VOLUME;
-pub const NOTE_B6H: u16 = NOTE_B6 + TONE_HIGH_VOLUME;
-pub const NOTE_C7H: u16 = NOTE_C7 + TONE_HIGH_VOLUME;
-pub const NOTE_CS7H: u16 = NOTE_CS7 + TONE_HIGH_VOLUME;
-pub const NOTE_D7H: u16 = NOTE_D7 + TONE_HIGH_VOLUME;
-pub const NOTE_DS7H: u16 = NOTE_DS7 + TONE_HIGH_VOLUME;
-pub const NOTE_E7H: u16 = NOTE_E7 + TONE_HIGH_VOLUME;
-pub const NOTE_F7H: u16 = NOTE_F7 + TONE_HIGH_VOLUME;
-pub const NOTE_FS7H: u16 = NOTE_FS7 + TONE_HIGH_VOLUME;
-pub const NOTE_G7H: u16 = NOTE_G7 + TONE_HIGH_VOLUME;
-pub const NOTE_GS7H: u16 = NOTE_GS7 + TONE_HIGH_VOLUME;
-pub const NOTE_A7H: u16 = NOTE_A7 + TONE_HIGH_VOLUME;
-pub const NOTE_AS7H: u16 = NOTE_AS7 + TONE_HIGH_VOLUME;
-pub const NOTE_B7H: u16 = NOTE_B7 + TONE_HIGH_VOLUME;
-pub const NOTE_C8H: u16 = NOTE_C8 + TONE_HIGH_VOLUME;
-pub const NOTE_CS8H: u16 = NOTE_CS8 + TONE_HIGH_VOLUME;
-pub const NOTE_D8H: u16 = NOTE_D8 + TONE_HIGH_VOLUME;
-pub const NOTE_DS8H: u16 = NOTE_DS8 + TONE_HIGH_VOLUME;
-pub const NOTE_E8H: u16 = NOTE_E8 + TONE_HIGH_VOLUME;
-pub const NOTE_F8H: u16 = NOTE_F8 + TONE_HIGH_VOLUME;
-pub const NOTE_FS8H: u16 = NOTE_FS8 + TONE_HIGH_VOLUME;
-pub const NOTE_G8H: u16 = NOTE_G8 + TONE_HIGH_VOLUME;
-pub const NOTE_GS8H: u16 = NOTE_GS8 + TONE_HIGH_VOLUME;
-pub const NOTE_A8H: u16 = NOTE_A8 + TONE_HIGH_VOLUME;
-pub const NOTE_AS8H: u16 = NOTE_AS8 + TONE_HIGH_VOLUME;
-pub const NOTE_B8H: u16 = NOTE_B8 + TONE_HIGH_VOLUME;
-pub const NOTE_C9H: u16 = NOTE_C9 + TONE_HIGH_VOLUME;
-pub const NOTE_CS9H: u16 = NOTE_CS9 + TONE_HIGH_VOLUME;
-pub const NOTE_D9H: u16 = NOTE_D9 + TONE_HIGH_VOLUME;
-pub const NOTE_DS9H: u16 = NOTE_DS9 + TONE_HIGH_VOLUME;
-pub const NOTE_E9H: u16 = NOTE_E9 + TONE_HIGH_VOLUME;
-pub const NOTE_F9H: u16 = NOTE_F9 + TONE_HIGH_VOLUME;
-pub const NOTE_FS9H: u16 = NOTE_FS9 + TONE_HIGH_VOLUME;
-pub const NOTE_G9H: u16 = NOTE_G9 + TONE_HIGH_VOLUME;
-pub const NOTE_GS9H: u16 = NOTE_GS9 + TONE_HIGH_VOLUME;
-pub const NOTE_A9H: u16 = NOTE_A9 + TONE_HIGH_VOLUME;
-pub const NOTE_AS9H: u16 = NOTE_AS9 + TONE_HIGH_VOLUME;
-pub const NOTE_B9H: u16 = NOTE_B9 + TONE_HIGH_VOLUME;
-
\ No newline at end of file diff --git a/docs/doc/src/arduboy_rust/library/arduino.rs.html b/docs/doc/src/arduboy_rust/library/arduino.rs.html deleted file mode 100644 index 1ceba57..0000000 --- a/docs/doc/src/arduboy_rust/library/arduino.rs.html +++ /dev/null @@ -1,55 +0,0 @@ -arduino.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-
//! This is the Module to interact in a save way with the Arduino C++ library.
-use core::ffi::{c_long, c_ulong};
-
-extern "C" {
-    #[link_name = "arduino_random_between"]
-    fn arduino_random_between_raw(min: c_long, max: c_long) -> c_long;
-
-    #[link_name = "arduino_random_less_than"]
-    fn arduino_random_less_than_raw(max: c_long) -> c_long;
-
-    #[link_name = "arduino_delay"]
-    fn arduino_delay(ms: c_ulong);
-}
-/// A Arduino function to get a random number between 2 numbers
-/// seed based
-pub fn random_between(min: i32, max: i32) -> i32 {
-    unsafe { arduino_random_between_raw(min, max) }
-}
-/// A Arduino function to get a random number smaller than the number given
-/// seed based
-pub fn random_less_than(max: i32) -> i32 {
-    unsafe { arduino_random_less_than_raw(max) }
-}
-/// A Arduino function to pause the cpu circles for a given amount of ms
-pub fn delay(ms: u32) {
-    unsafe { arduino_delay(ms) }
-}
-
\ No newline at end of file diff --git a/docs/doc/src/arduboy_rust/library/ardvoice.rs.html b/docs/doc/src/arduboy_rust/library/ardvoice.rs.html deleted file mode 100644 index bb55893..0000000 --- a/docs/doc/src/arduboy_rust/library/ardvoice.rs.html +++ /dev/null @@ -1,85 +0,0 @@ -ardvoice.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-
//! This is the Module to interact in a save way with the ArdVoice C++ library.
-//!
-//! You will need to uncomment the ArdVoice_Library in the import_config.h file.
-
-use core::ffi::{c_float, c_uchar, c_ulong};
-
-extern "C" {
-    #[link_name = "ardvoice_play_voice"]
-    fn ardvoice_play_voice_raw(audio: *const c_uchar);
-    #[link_name = "ardvoice_play_voice_complex"]
-    fn ardvoice_play_voice_complex_raw(
-        audio: *const c_uchar,
-        startTime: c_ulong,
-        endTime: c_ulong,
-        speed: c_float,
-    );
-    #[link_name = "ardvoice_stop_voice"]
-    fn ardvoice_stop_voice_raw();
-    #[link_name = "ardvoice_is_voice_playing"]
-    fn ardvoice_is_voice_playing_raw() -> bool;
-}
-///This is the struct to interact in a save way with the ArdVoice C++ library.
-///
-///You will need to uncomment the ArdVoice_Library in the import_config.h file.
-pub struct ArdVoice {}
-impl ArdVoice {
-    pub const fn new() -> Self {
-        ArdVoice {}
-    }
-    pub fn play_voice(&self, audio: *const u8) {
-        unsafe { ardvoice_play_voice_raw(audio) }
-    }
-    pub fn play_voice_complex(&self, audio: *const u8, start_time: u32, end_time: u32, speed: f32) {
-        unsafe { ardvoice_play_voice_complex_raw(audio, start_time, end_time, speed) }
-    }
-    pub fn stop_voice(&self) {
-        unsafe { ardvoice_stop_voice_raw() }
-    }
-    pub fn is_voice_playing(&self) -> bool {
-        unsafe { ardvoice_is_voice_playing_raw() }
-    }
-}
-
\ No newline at end of file diff --git a/docs/doc/src/arduboy_rust/library/c.rs.html b/docs/doc/src/arduboy_rust/library/c.rs.html deleted file mode 100644 index 06b8798..0000000 --- a/docs/doc/src/arduboy_rust/library/c.rs.html +++ /dev/null @@ -1,23 +0,0 @@ -c.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-
//! Clib functions you can use on the Arduboy
-use core::ffi::{c_char, c_size_t};
-
-extern "C" {
-    #[link_name = "strlen"]
-    fn c_strlen(cstr: *const c_char) -> c_size_t;
-}
-/// A C function to get the length of a string
-pub fn strlen(cstr: *const i8) -> usize {
-    unsafe { c_strlen(cstr) }
-}
-
\ No newline at end of file diff --git a/docs/doc/src/arduboy_rust/library/eeprom.rs.html b/docs/doc/src/arduboy_rust/library/eeprom.rs.html deleted file mode 100644 index d618b29..0000000 --- a/docs/doc/src/arduboy_rust/library/eeprom.rs.html +++ /dev/null @@ -1,331 +0,0 @@ -eeprom.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-
use core::ffi::{c_int, c_uchar};
-
-pub const EEPROM_STORAGE_SPACE_START: i16 = 16;
-
-extern "C" {
-    #[link_name = "arduboy_eeprom_read"]
-    fn arduboy_eeprom_read_raw(idx: c_int) -> c_uchar;
-    #[link_name = "arduboy_eeprom_update"]
-    fn arduboy_eeprom_update_raw(idx: c_int, val: c_uchar);
-    #[link_name = "arduboy_eeprom_write"]
-    fn arduboy_eeprom_write_raw(idx: c_int, val: c_uchar);
-    #[link_name = "arduboy_eeprom_get"]
-    fn arduboy_eeprom_get_raw(idx: c_int, object: *mut u8, size: usize);
-    #[link_name = "arduboy_eeprom_put"]
-    fn arduboy_eeprom_put_raw(idx: c_int, object: *const u8, size: usize);
-}
-///This is the struct to store and read structs objects to/from eeprom memory.
-/// ## Example
-/// ```
-/// static e: EEPROM = EEPROM::new(10);
-/// struct Scorebord {
-///     player1: u16,
-///     text: &'static str,
-/// }
-/// static mut s: Scorebord = Scorebord {
-///     player1: 0,
-///     text: "lol\0",
-/// };
-///
-/// // init inside of the setup function
-/// e.init(&mut s);
-/// ```
-pub struct EEPROM {
-    start_c1: i16,
-    start_c2: i16,
-    idx: i16,
-}
-impl EEPROM {
-    pub const fn new(mut idx: i16) -> EEPROM {
-        if idx > 950 {
-            idx = 0
-        }
-        EEPROM {
-            start_c1: EEPROM_STORAGE_SPACE_START + idx,
-            start_c2: EEPROM_STORAGE_SPACE_START + idx + 1,
-            idx: EEPROM_STORAGE_SPACE_START + idx + 2,
-        }
-    }
-    pub fn init<T>(&self, your_struct: &mut T) {
-        let c1 = self.read(self.start_c1);
-        let c2 = self.read(self.start_c2);
-
-        if c1 != b'Z' || c2 != b'D' {
-            self.update(self.start_c1, b'Z');
-            self.update(self.start_c2, b'D');
-            self.put(your_struct);
-        };
-        self.get(your_struct)
-    }
-    fn read(&self, idx: i16) -> u8 {
-        unsafe { arduboy_eeprom_read_raw(idx) }
-    }
-    fn update(&self, idx: i16, val: u8) {
-        unsafe { arduboy_eeprom_update_raw(idx, val) }
-    }
-    pub fn get<T>(&self, your_struct: &mut T) {
-        let pointer = your_struct as *mut T;
-        let object_pointer = pointer as *mut u8;
-        let object_size = core::mem::size_of::<T>();
-
-        unsafe {
-            arduboy_eeprom_get_raw(self.idx, object_pointer, object_size);
-        };
-    }
-    pub fn get_direct<T>(&self) -> T {
-        let mut buffer = core::mem::MaybeUninit::<T>::uninit();
-
-        let pointer = buffer.as_mut_ptr();
-        let object_pointer = pointer as *mut u8;
-        let object_size = core::mem::size_of::<T>();
-
-        unsafe {
-            arduboy_eeprom_get_raw(self.idx, object_pointer, object_size);
-        };
-
-        return unsafe { buffer.assume_init() };
-    }
-    pub fn put<T>(&self, your_struct: &T) {
-        let pointer = your_struct as *const T;
-        let object_pointer = pointer as *const u8;
-        let object_size = core::mem::size_of::<T>();
-
-        unsafe {
-            arduboy_eeprom_put_raw(self.idx, object_pointer, object_size);
-        };
-    }
-}
-///Use this struct to store and read single bytes to/from eeprom memory.
-pub struct EEPROMBYTE {
-    start_c1: i16,
-    start_c2: i16,
-    idx: i16,
-}
-impl EEPROMBYTE {
-    pub const fn new(mut idx: i16) -> EEPROMBYTE {
-        if idx > 1010 {
-            idx = 0
-        }
-        EEPROMBYTE {
-            start_c1: EEPROM_STORAGE_SPACE_START + idx,
-            start_c2: EEPROM_STORAGE_SPACE_START + idx + 1,
-            idx: EEPROM_STORAGE_SPACE_START + idx + 2,
-        }
-    }
-    pub fn init(&self) {
-        let c1 = self.read_intern(self.start_c1);
-        let c2 = self.read_intern(self.start_c2);
-
-        if c1 != b'Z' || c2 != b'D' {
-            self.update_intern(self.start_c1, b'Z');
-            self.update_intern(self.start_c2, b'D');
-            self.update(0);
-        };
-    }
-    fn read_intern(&self, idx: i16) -> u8 {
-        unsafe { arduboy_eeprom_read_raw(idx) }
-    }
-    pub fn read(&self) -> u8 {
-        unsafe { arduboy_eeprom_read_raw(self.idx) }
-    }
-    fn update_intern(&self, idx: i16, val: u8) {
-        unsafe { arduboy_eeprom_update_raw(idx, val) }
-    }
-    pub fn update(&self, val: u8) {
-        unsafe { arduboy_eeprom_update_raw(self.idx, val) }
-    }
-    pub fn write(&self, val: u8) {
-        unsafe { arduboy_eeprom_write_raw(self.idx, val) }
-    }
-}
-
-///Use this struct to store and read single bytes to/from eeprom memory without using a check digit.
-///Unlike the other eeprom structs, this does not need to be initialised.
-pub struct EEPROMBYTECHECKLESS {
-    idx: i16,
-}
-impl EEPROMBYTECHECKLESS {
-    pub const fn new(mut idx: i16) -> EEPROMBYTECHECKLESS {
-        if idx > 1010 {
-            idx = 0
-        }
-        EEPROMBYTECHECKLESS {
-            idx: EEPROM_STORAGE_SPACE_START + idx,
-        }
-    }
-    pub fn read(&self) -> u8 {
-        unsafe { arduboy_eeprom_read_raw(self.idx) }
-    }
-    pub fn update(&self, val: u8) {
-        unsafe { arduboy_eeprom_update_raw(self.idx, val) }
-    }
-    pub fn write(&self, val: u8) {
-        unsafe { arduboy_eeprom_write_raw(self.idx, val) }
-    }
-}
-
\ No newline at end of file diff --git a/docs/doc/src/arduboy_rust/library/mod.rs.html b/docs/doc/src/arduboy_rust/library/mod.rs.html deleted file mode 100644 index a7309b5..0000000 --- a/docs/doc/src/arduboy_rust/library/mod.rs.html +++ /dev/null @@ -1,19 +0,0 @@ -mod.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-
pub mod arduboy2;
-pub mod arduboy_tone;
-pub mod arduboy_tone_pitch;
-pub mod arduino;
-pub mod ardvoice;
-pub mod c;
-pub mod eeprom;
-pub mod progmem;
-pub mod sprites;
-
\ No newline at end of file diff --git a/docs/doc/src/arduboy_rust/library/progmem.rs.html b/docs/doc/src/arduboy_rust/library/progmem.rs.html deleted file mode 100644 index 75114a2..0000000 --- a/docs/doc/src/arduboy_rust/library/progmem.rs.html +++ /dev/null @@ -1,285 +0,0 @@ -progmem.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-
#![allow(unused_imports)]
-/// Create a space for Progmem variable
-/// ## Example
-/// ```
-/// //for text
-/// progmem!(
-///     static text: [u8; _] = *b"I'm a PROGMEM Text\0";
-/// );
-/// //for tone sequence
-/// progmem!(
-///     static tone: [u16; _] = [
-///         NOTE_E4, 400, NOTE_D4, 200, NOTE_C4, 400, NOTE_D4, 200, NOTE_C4, 300, NOTE_REST,
-///     ];
-/// );
-/// //for for bitmap
-/// progmem!(
-///     static image: [u8; _] = [8, 8, 0x81, 0x00, 0x12, 0x40, 0x04, 0x11, 0x00, 0x04];
-/// );
-///
-/// // for a Vector
-/// progmem!(
-///     static mut walls: Vec<Player, 100> = Vec::new();
-/// );
-/// ```
-#[macro_export]
-macro_rules! progmem {
-    (
-        $( #[$attr:meta] )*
-        $v:vis $id:ident $name:ident: [$ty:ty; _] = $value:expr;
-        $($rest:tt)*
-    ) => {
-        $( #[$attr] )*
-        #[link_section = ".progmem.data"]
-        $v $id $name: [$ty; $value.len()] = $value;
-        $crate::progmem!{
-			$($rest)*
-		}
-    };
-    (
-        $( #[$attr:meta] )*
-        $v:vis $id:ident mut $name:ident: [$ty:ty; _] = $value:expr;
-        $($rest:tt)*
-    ) => {
-        $( #[$attr] )*
-        #[link_section = ".progmem.data"]
-        $v $id mut $name: [$ty; $value.len()] = $value;
-        $crate::progmem!{
-			$($rest)*
-		}
-    };
-    (
-        $( #[$attr:meta] )*
-        $v:vis $id:ident $name:ident: $ty:ty = $value:expr;
-        $($rest:tt)*
-    ) => {
-        $( #[$attr] )*
-        #[link_section = ".progmem.data"]
-        $v $id $name: $ty = $value;
-        $crate::progmem!{
-			$($rest)*
-		}
-    };
-    (
-        $( #[$attr:meta] )*
-        $v:vis $id:ident mut $name:ident: $ty:ty = $value:expr;
-        $($rest:tt)*
-    ) => {
-        $( #[$attr] )*
-        #[link_section = ".progmem.data"]
-        $v $id mut $name: $ty = $value;
-        $crate::progmem!{
-			$($rest)*
-		}
-    };
-    () => ()
-}
-
-pub(super) use progmem;
-///Create a `const` raw pointer to a sprite as u8, without creating an intermediate reference.
-#[macro_export]
-macro_rules! get_sprite_addr {
-    ( $s:expr ) => {
-        unsafe { addr_of!($s) as *const u8 }
-    };
-}
-pub(super) use get_sprite_addr;
-
-///Create a `const` raw pointer to a ardvoice tone as u8, without creating an intermediate reference.
-#[macro_export]
-macro_rules! get_ardvoice_tone_addr {
-    ( $s:expr ) => {
-        unsafe { addr_of!($s) as *const u8 }
-    };
-}
-pub(super) use get_ardvoice_tone_addr;
-///Create a `const` raw pointer to a tone sequenze as u16, without creating an intermediate reference.
-#[macro_export]
-macro_rules! get_tones_addr {
-    ( $s:expr ) => {
-        unsafe { addr_of!($s) as *const u16 }
-    };
-}
-pub(super) use get_tones_addr;
-
-///Create a `const` raw pointer to a \[u8;_] that saves text, without creating an intermediate reference.
-#[macro_export]
-macro_rules! get_string_addr {
-    ( $s:expr ) => {
-        Pstring {
-            pointer: unsafe { addr_of!($s) as *const i8 },
-        }
-    };
-}
-pub(super) use get_string_addr;
-///This is the way to go if you want print some random text
-///
-/// This doesn't waste the 2kb ram it saves to progmem (28kb)
-/// This automatically saves the given text to the Progmem.
-/// ## Example
-/// ```
-/// arduboy.print(f!(b"Random text to print\0"))
-/// ```
-#[macro_export]
-macro_rules! f {
-    ($string_literal:literal) => {{
-        progmem!(
-            static local: [u8; _] = *$string_literal;
-        );
-
-        get_string_addr!(local)
-    }};
-}
-pub(super) use f;
-
-/// This struct is important for the Progmem functionality.
-///
-/// Typically you will never use this by your self.
-/// It will be used by the get_string_addr macro in combination with a print command.
-#[derive(Copy, Clone)]
-pub struct Pstring {
-    pub pointer: *const i8,
-}
-
\ No newline at end of file diff --git a/docs/doc/src/arduboy_rust/library/sprites.rs.html b/docs/doc/src/arduboy_rust/library/sprites.rs.html deleted file mode 100644 index 6da2903..0000000 --- a/docs/doc/src/arduboy_rust/library/sprites.rs.html +++ /dev/null @@ -1,359 +0,0 @@ -sprites.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-
//!This is the module to interact in a save way with the Sprites C++ library.
-use core::ffi::{c_int, c_uchar};
-
-extern "C" {
-    #[link_name = "arduino_draw_override"]
-    fn arduino_draw_override_raw(x: c_int, y: c_int, bitmap: *const c_uchar, frame: c_uchar);
-    #[link_name = "arduino_draw_external_mask"]
-    fn arduino_draw_external_mask_raw(
-        x: c_int,
-        y: c_int,
-        bitmap: *const c_uchar,
-        mask: *const c_uchar,
-        frame: c_uchar,
-        mask_frame: c_uchar,
-    );
-    #[link_name = "arduino_draw_plus_mask"]
-    fn arduino_draw_plus_mask_raw(x: c_int, y: c_int, bitmap: *const c_uchar, frame: c_uchar);
-    #[link_name = "arduino_draw_erase"]
-    fn arduino_draw_erase_raw(x: c_int, y: c_int, bitmap: *const c_uchar, frame: c_uchar);
-    #[link_name = "arduino_draw_self_masked"]
-    fn arduino_draw_self_masked_raw(x: c_int, y: c_int, bitmap: *const c_uchar, frame: c_uchar);
-
-}
-/// Draw a sprite by replacing the existing content completely.
-///
-/// ### Parameters
-///
-/// - x,y	The coordinates of the top left pixel location.
-/// - bitmap	A pointer to the array containing the image frames.
-/// - frame	The frame number of the image to draw.
-///
-/// A sprite is drawn by overwriting the pixels in the buffer with the data from the specified frame in the array. No masking is done. A bit set to 1 in the frame will set the pixel to 1 in the buffer, and a 0 in the array will set a 0 in the buffer.
-///```text
-/// image  before  after  (# = 1, - = 0)
-///
-/// -----  -----   -----
-/// --#--  -----   --#--
-/// ##-##  -----   ##-##
-/// --#--  -----   --#--
-/// -----  -----   -----
-///
-/// image  before  after
-///
-/// -----  #####   -----
-/// --#--  #####   --#--
-/// ##-##  #####   ##-##
-/// --#--  #####   --#--
-/// -----  #####   -----
-/// ```
-pub fn draw_override(x: i16, y: i16, bitmap: *const u8, frame: u8) {
-    unsafe { arduino_draw_override_raw(x, y, bitmap, frame) }
-}
-///Draw a sprite using a separate image and mask array.
-///
-///Parameters
-///-    x,y	The coordinates of the top left pixel location.
-///-    bitmap	A pointer to the array containing the image frames.
-///-    mask	A pointer to the array containing the mask frames.
-///-    frame	The frame number of the image to draw.
-///-    mask_frame	The frame number for the mask to use (can be different from the image frame number).
-///
-///An array containing the image frames, and another array containing corresponding mask frames, are used to draw a sprite.
-///
-///For the mask array, the width and height are not included but must contain data of the same dimensions as the corresponding image array.
-///
-///Bits set to 1 in the mask indicate that the pixel will be set to the value of the corresponding image bit. Bits set to 0 in the mask will be left unchanged.
-///```text
-/// image  mask   before  after  (# = 1, - = 0)
-///
-/// -----  -###-  -----   -----
-/// --#--  #####  -----   --#--
-/// ##-##  ##-##  -----   ##-##
-/// --#--  #####  -----   --#--
-/// -----  -###-  -----   -----
-///
-/// image  mask   before  after
-///
-/// -----  -###-  #####   #---#
-/// --#--  #####  #####   --#--
-/// ##-##  #####  #####   ##-##
-/// --#--  #####  #####   --#--
-/// -----  -###-  #####   #---#
-/// ```
-pub fn draw_external_mask(
-    x: i16,
-    y: i16,
-    bitmap: *const u8,
-    mask: *const u8,
-    frame: u8,
-    mask_frame: u8,
-) {
-    unsafe { arduino_draw_external_mask_raw(x, y, bitmap, mask, frame, mask_frame) }
-}
-///Draw a sprite using an array containing both image and mask values.
-///
-///Parameters
-/// -   x,y	The coordinates of the top left pixel location.
-/// -   bitmap	A pointer to the array containing the image/mask frames.
-/// -   frame	The frame number of the image to draw.
-///
-///An array containing combined image and mask data is used to draw a sprite. Bytes are given in pairs with the first byte representing the image pixels and the second byte specifying the corresponding mask. The width given in the array still specifies the image width, so each row of image and mask bytes will be twice the width value.
-///
-///Bits set to 1 in the mask indicate that the pixel will be set to the value of the corresponding image bit. Bits set to 0 in the mask will be left unchanged.
-///
-///image  mask   before  after  (# = 1, - = 0)
-///```text
-/// -----  -###-  -----   -----
-/// --#--  #####  -----   --#--
-/// ##-##  ##-##  -----   ##-##
-/// --#--  #####  -----   --#--
-/// -----  -###-  -----   -----
-///
-/// image  mask   before  after
-///
-/// -----  -###-  #####   #---#
-/// --#--  #####  #####   --#--
-/// ##-##  #####  #####   ##-##
-/// --#--  #####  #####   --#--
-/// -----  -###-  #####   #---#
-/// ```
-pub fn draw_plus_mask(x: i16, y: i16, bitmap: *const u8, frame: u8) {
-    unsafe { arduino_draw_plus_mask_raw(x, y, bitmap, frame) }
-}
-///"Erase" a sprite.
-///
-///Parameters
-/// -   x,y	The coordinates of the top left pixel location.
-/// -   bitmap	A pointer to the array containing the image frames.
-/// -   frame	The frame number of the image to erase.
-///
-///The data from the specified frame in the array is used to erase a sprite. To "erase" a sprite, bits set to 1 in the frame will set the corresponding pixel in the buffer to 0. Frame bits set to 0 will remain unchanged in the buffer.
-///```text
-/// image  before  after  (# = 1, - = 0)
-///
-/// -----  -----   -----
-/// --#--  -----   -----
-/// ##-##  -----   -----
-/// --#--  -----   -----
-/// -----  -----   -----
-///
-/// image  before  after
-///
-/// -----  #####   #####
-/// --#--  #####   ##-##
-/// ##-##  #####   --#--
-/// --#--  #####   ##-##
-/// -----  #####   #####
-/// ```
-pub fn draw_erase(x: i16, y: i16, bitmap: *const u8, frame: u8) {
-    unsafe { arduino_draw_erase_raw(x, y, bitmap, frame) }
-}
-///Draw a sprite using only the bits set to 1.
-///
-///Parameters
-/// -   x,y	The coordinates of the top left pixel location.
-/// -   bitmap	A pointer to the array containing the image frames.
-/// -   frame	The frame number of the image to draw.
-///
-///Bits set to 1 in the frame will be used to draw the sprite by setting the corresponding pixel in the buffer to 1. Bits set to 0 in the frame will remain unchanged in the buffer.
-///```text
-/// image  before  after  (# = 1, - = 0)
-///
-/// -----  -----   -----
-/// --#--  -----   --#--
-/// ##-##  -----   ##-##
-/// --#--  -----   --#--
-/// -----  -----   -----
-///
-/// image  before  after
-///
-/// -----  #####   #####  (no change because all pixels were
-/// --#--  #####   #####  already white)
-/// ##-##  #####   #####
-/// --#--  #####   #####
-/// -----  #####   #####
-/// ```
-pub fn draw_self_masked(x: i16, y: i16, bitmap: *const u8, frame: u8) {
-    unsafe { arduino_draw_self_masked_raw(x, y, bitmap, frame) }
-}
-
\ No newline at end of file diff --git a/docs/doc/src/arduboy_rust/prelude.rs.html b/docs/doc/src/arduboy_rust/prelude.rs.html deleted file mode 100644 index 406277f..0000000 --- a/docs/doc/src/arduboy_rust/prelude.rs.html +++ /dev/null @@ -1,73 +0,0 @@ -prelude.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-
//! This is the important one to use this library effective in your project
-//!
-//! Import the module:
-//! ```
-//! use arduboy_rust::prelude::*;
-//! ```
-#[doc(inline)]
-pub use crate::hardware::buttons::{self, *};
-#[doc(inline)]
-pub use crate::hardware::led::{self, *};
-pub use crate::heapless::{LinearMap, String, Vec};
-pub use crate::library::arduboy2::{self, *};
-pub use crate::library::arduboy_tone::{self, ArduboyTones};
-pub use crate::library::arduino::*;
-pub use crate::library::ardvoice::{self, ArdVoice};
-pub use crate::library::c::*;
-pub use crate::library::eeprom::{EEPROM, EEPROMBYTE, EEPROMBYTECHECKLESS};
-#[doc(hidden)]
-pub use crate::library::progmem::Pstring;
-pub use crate::library::sprites;
-pub use crate::print::*;
-pub use crate::{
-    f, get_ardvoice_tone_addr, get_sprite_addr, get_string_addr, get_tones_addr, progmem,
-    serial_print as serial,
-};
-use core::cmp;
-pub use core::ffi::{
-    c_char, c_double, c_float, c_int, c_long, c_longlong, c_size_t, c_uchar, c_uint, c_ulong,
-    c_ulonglong,
-};
-#[doc(hidden)]
-pub use core::ptr::addr_of;
-
-pub fn constrain<T: Ord>(x: T, a: T, b: T) -> T {
-    cmp::max(cmp::min(x, b), a)
-}
-
\ No newline at end of file diff --git a/docs/doc/src/arduboy_rust/print.rs.html b/docs/doc/src/arduboy_rust/print.rs.html deleted file mode 100644 index 904f594..0000000 --- a/docs/doc/src/arduboy_rust/print.rs.html +++ /dev/null @@ -1,255 +0,0 @@ -print.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-
use crate::prelude::Pstring;
-use core::ffi::c_int;
-
-#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
-pub enum Base {
-    Bin = 2,
-    Oct = 8,
-    Dec = 10,
-    Hex = 16,
-}
-
-pub trait Printable
-where
-    Self: Sized,
-{
-    type Parameters;
-
-    fn print_2(self, params: Self::Parameters);
-    fn default_parameters() -> Self::Parameters;
-
-    fn print(self) {
-        self.print_2(Self::default_parameters());
-    }
-}
-
-impl Printable for i16 {
-    type Parameters = Base;
-
-    fn print_2(self, params: Self::Parameters) {
-        unsafe {
-            crate::library::arduboy2::print_int(self, params as c_int);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {
-        Base::Dec
-    }
-}
-
-impl Printable for u16 {
-    type Parameters = Base;
-
-    fn print_2(self, params: Self::Parameters) {
-        unsafe {
-            crate::library::arduboy2::print_unsigned_int(self, params as c_int);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {
-        Base::Dec
-    }
-}
-
-impl Printable for i32 {
-    type Parameters = Base;
-
-    fn print_2(self, params: Self::Parameters) {
-        unsafe {
-            crate::library::arduboy2::print_long(self, params as c_int);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {
-        Base::Dec
-    }
-}
-
-impl Printable for u32 {
-    type Parameters = Base;
-
-    fn print_2(self, params: Self::Parameters) {
-        unsafe {
-            crate::library::arduboy2::print_unsigned_long(self, params as c_int);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {
-        Base::Dec
-    }
-}
-
-impl Printable for &[u8] {
-    type Parameters = ();
-
-    fn print_2(self, _params: Self::Parameters) {
-        unsafe {
-            crate::library::arduboy2::print_chars(self as *const [u8] as *const i8);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {}
-}
-
-impl Printable for &str {
-    type Parameters = ();
-
-    fn print_2(self, _params: Self::Parameters) {
-        unsafe {
-            crate::library::arduboy2::print_chars(self.as_bytes() as *const [u8] as *const i8);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {}
-}
-impl<const N: usize> Printable for crate::heapless::String<N> {
-    type Parameters = ();
-
-    fn print_2(self, _params: Self::Parameters) {
-        unsafe {
-            crate::library::arduboy2::print_chars(self.as_bytes() as *const [u8] as *const i8);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {}
-}
-
-impl Printable for Pstring {
-    type Parameters = ();
-
-    fn print_2(self, _params: Self::Parameters) {
-        unsafe {
-            crate::library::arduboy2::print_chars_progmem(self.pointer);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {}
-}
-
\ No newline at end of file diff --git a/docs/doc/src/arduboy_rust/serial_print.rs.html b/docs/doc/src/arduboy_rust/serial_print.rs.html deleted file mode 100644 index cb97000..0000000 --- a/docs/doc/src/arduboy_rust/serial_print.rs.html +++ /dev/null @@ -1,825 +0,0 @@ -serial_print.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-
//! This is the Module to interact in a save way with the Arduino Serial C++ library.
-//!
-//! You will need to uncomment the Arduino_Serial_Library in the import_config.h file.
-use crate::prelude::Pstring;
-use core::ffi::{c_char, c_int, c_long, c_size_t, c_uchar, c_uint, c_ulong};
-
-use crate::print::Base;
-extern "C" {
-    #[link_name = "arduino_serial_begin"]
-    fn serial_begin(serial: c_ulong);
-    #[link_name = "arduino_serial_end"]
-    fn serial_end();
-    #[link_name = "arduino_serial_available"]
-    fn serial_available() -> c_int;
-    #[link_name = "arduino_serial_read"]
-    fn serial_read() -> c_int;
-}
-
-///The Arduino Serial Print class is available for writing text to the screen buffer.
-///
-///In the same manner as the Arduino arduboy.print(), etc., functions.
-///
-///
-///Example
-/// ```
-/// let value: i16 = 42;
-///
-/// serial::print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the
-///                                        // text cursor to the start of the next line
-/// serial::print(f!(b"Hello World\n")); // Prints "Hello World" but does not use the 2kb ram
-/// serial::print(value); // Prints "42"
-/// serial::print("\n\0"); // Sets the text cursor to the start of the next line
-/// serial::print("hello world") // Prints normal [&str]
-/// ```
-pub fn print(x: impl Serialprintable) {
-    x.print()
-}
-///The Arduino Serial Print class is available for writing text to the screen buffer.
-///
-///In the same manner as the Arduino arduboy.print(), etc., functions.
-///
-///
-///Example
-/// ```
-/// let value: i16 = 42;
-///
-/// serial::print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the
-///                                        // text cursor to the start of the next line
-/// serial::print(f!(b"Hello World\n")); // Prints "Hello World" but does not use the 2kb ram
-/// serial::print(value); // Prints "42"
-/// serial::print("\n\0"); // Sets the text cursor to the start of the next line
-/// serial::print("hello world") // Prints normal [&str]
-/// ```
-pub fn println(x: impl Serialprintlnable) {
-    x.println()
-}
-/// Sets the data rate in bits per second (baud) for serial data transmission. For communicating with Serial Monitor, make sure to use one of the baud rates listed in the menu at the bottom right corner of its screen. You can, however, specify other rates - for example, to communicate over pins 0 and 1 with a component that requires a particular baud rate.
-///
-/// ### Example
-/// ```
-/// serial::begin(9600)
-/// ```
-pub fn begin(baud_rates: u32) {
-    unsafe { serial_begin(baud_rates) }
-}
-/// Disables serial communication, allowing the RX and TX pins to be used for general input and output. To re-enable serial communication, call [begin()].
-pub fn end() {
-    unsafe { serial_end() }
-}
-/// Reads incoming serial data.
-/// Use only inside of [available()]:
-/// ```
-/// if (serial::available() > 0) {
-///     // read the incoming byte:
-///     let incoming_byte: i16 = Serial::read();
-///
-///     // say what you got:
-///     serial::print("I received: ");
-///     serial::println(incoming_byte);
-/// }
-/// ```
-/// ### Returns
-///
-///The first byte of incoming serial data available (or -1 if no data is available). Data type: int.
-pub fn read() -> i16 {
-    unsafe { serial_read() }
-}
-/// Reads incoming serial data.
-///
-/// Use only inside of [available()]:
-/// ```
-/// if (Serial::available() > 0) {
-///     // read the incoming byte:
-///     let incomingByte: &str = Serial::read_as_utf8_str();
-///
-///     // say what you got:
-///     Serial::print("I received: ");
-///     Serial::println(incomingByte);
-/// }
-/// ```
-/// ### Returns
-///
-///The first byte of incoming serial data available (or -1 if no data is available). Data type: &str.
-pub fn read_as_utf8_str() -> &'static str {
-    let intcoming_byte = unsafe { serial_read() };
-    static mut L: [u8; 2] = [0, 0];
-    unsafe {
-        L[0] = intcoming_byte as u8;
-    }
-    unsafe { core::str::from_utf8(&L).unwrap() }
-}
-
-/// Get the number of bytes (characters) available for reading from the serial port. This is data that’s already arrived and stored in the serial receive buffer (which holds 64 bytes).
-/// ### Example
-/// ```
-/// if (Serial::available() > 0) {
-///     // read the incoming byte:
-///     incomingByte = Serial::read();
-///
-///     // say what you got:
-///     Serial::print("I received: ");
-///     Serial::println(incomingByte);
-/// }
-/// ```
-pub fn available() -> i16 {
-    unsafe { serial_available() }
-}
-pub trait Serialprintlnable
-where
-    Self: Sized,
-{
-    type Parameters;
-
-    fn println_2(self, params: Self::Parameters);
-    fn default_parameters() -> Self::Parameters;
-
-    fn println(self) {
-        self.println_2(Self::default_parameters());
-    }
-}
-
-impl Serialprintlnable for i16 {
-    type Parameters = Base;
-
-    fn println_2(self, params: Self::Parameters) {
-        unsafe {
-            println_int(self, params as c_int);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {
-        Base::Dec
-    }
-}
-
-impl Serialprintlnable for u16 {
-    type Parameters = Base;
-
-    fn println_2(self, params: Self::Parameters) {
-        unsafe {
-            println_unsigned_int(self, params as c_int);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {
-        Base::Dec
-    }
-}
-
-impl Serialprintlnable for i32 {
-    type Parameters = Base;
-
-    fn println_2(self, params: Self::Parameters) {
-        unsafe {
-            println_long(self, params as c_int);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {
-        Base::Dec
-    }
-}
-
-impl Serialprintlnable for u32 {
-    type Parameters = Base;
-
-    fn println_2(self, params: Self::Parameters) {
-        unsafe {
-            println_unsigned_long(self, params as c_int);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {
-        Base::Dec
-    }
-}
-
-impl Serialprintlnable for &[u8] {
-    type Parameters = ();
-
-    fn println_2(self, _params: Self::Parameters) {
-        unsafe {
-            println_chars(self as *const [u8] as *const i8);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {}
-}
-
-impl Serialprintlnable for &str {
-    type Parameters = ();
-
-    fn println_2(self, _params: Self::Parameters) {
-        unsafe {
-            println_chars(self.as_bytes() as *const [u8] as *const i8);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {}
-}
-impl<const N: usize> Serialprintlnable for crate::heapless::String<N> {
-    type Parameters = ();
-
-    fn println_2(self, _params: Self::Parameters) {
-        unsafe {
-            println_chars(self.as_bytes() as *const [u8] as *const i8);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {}
-}
-
-impl Serialprintlnable for Pstring {
-    type Parameters = ();
-
-    fn println_2(self, _params: Self::Parameters) {
-        unsafe {
-            println_chars_progmem(self.pointer);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {}
-}
-
-extern "C" {
-    #[link_name = "arduino_serial_println_chars"]
-    fn println_chars(cstr: *const c_char);
-    #[doc(hidden)]
-    #[link_name = "arduino_serial_println_chars_progmem"]
-    fn println_chars_progmem(pstring: *const c_char);
-    // #[link_name = "arduino_serial_println_char"]
-    // fn println_char(c: c_char) -> c_size_t;
-    #[doc(hidden)]
-    #[link_name = "arduino_serial_println_int"]
-    fn println_int(n: c_int, base: c_int) -> c_size_t;
-    #[doc(hidden)]
-    #[link_name = "arduino_serial_println_long"]
-    fn println_long(n: c_long, base: c_int) -> c_size_t;
-    #[allow(dead_code)]
-    #[doc(hidden)]
-    #[link_name = "arduino_serial_println_unsigned_char"]
-    fn println_unsigned_char(n: c_uchar, base: c_int) -> c_size_t;
-    #[doc(hidden)]
-    #[link_name = "arduino_serial_println_unsigned_int"]
-    fn println_unsigned_int(n: c_uint, base: c_int) -> c_size_t;
-    #[doc(hidden)]
-    #[link_name = "arduino_serial_println_unsigned_long"]
-    fn println_unsigned_long(n: c_ulong, base: c_int) -> c_size_t;
-}
-
-pub trait Serialprintable
-where
-    Self: Sized,
-{
-    type Parameters;
-
-    fn print_2(self, params: Self::Parameters);
-    fn default_parameters() -> Self::Parameters;
-
-    fn print(self) {
-        self.print_2(Self::default_parameters());
-    }
-}
-
-impl Serialprintable for i16 {
-    type Parameters = Base;
-
-    fn print_2(self, params: Self::Parameters) {
-        unsafe {
-            print_int(self, params as c_int);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {
-        Base::Dec
-    }
-}
-
-impl Serialprintable for u16 {
-    type Parameters = Base;
-
-    fn print_2(self, params: Self::Parameters) {
-        unsafe {
-            print_unsigned_int(self, params as c_int);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {
-        Base::Dec
-    }
-}
-
-impl Serialprintable for i32 {
-    type Parameters = Base;
-
-    fn print_2(self, params: Self::Parameters) {
-        unsafe {
-            print_long(self, params as c_int);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {
-        Base::Dec
-    }
-}
-
-impl Serialprintable for u32 {
-    type Parameters = Base;
-
-    fn print_2(self, params: Self::Parameters) {
-        unsafe {
-            print_unsigned_long(self, params as c_int);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {
-        Base::Dec
-    }
-}
-
-impl Serialprintable for &[u8] {
-    type Parameters = ();
-
-    fn print_2(self, _params: Self::Parameters) {
-        unsafe {
-            print_chars(self as *const [u8] as *const i8);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {}
-}
-
-impl Serialprintable for &str {
-    type Parameters = ();
-
-    fn print_2(self, _params: Self::Parameters) {
-        unsafe {
-            print_chars(self.as_bytes() as *const [u8] as *const i8);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {}
-}
-impl<const N: usize> Serialprintable for crate::heapless::String<N> {
-    type Parameters = ();
-
-    fn print_2(self, _params: Self::Parameters) {
-        unsafe {
-            print_chars(self.as_bytes() as *const [u8] as *const i8);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {}
-}
-
-impl Serialprintable for Pstring {
-    type Parameters = ();
-
-    fn print_2(self, _params: Self::Parameters) {
-        unsafe {
-            print_chars_progmem(self.pointer);
-        }
-    }
-
-    fn default_parameters() -> Self::Parameters {}
-}
-
-extern "C" {
-    #[link_name = "arduino_serial_print_chars"]
-    fn print_chars(cstr: *const c_char);
-    #[doc(hidden)]
-    #[link_name = "arduino_serial_print_chars_progmem"]
-    fn print_chars_progmem(pstring: *const c_char);
-    // #[link_name = "arduino_serial_print_char"]
-    // fn print_char(c: c_char) -> c_size_t;
-    #[doc(hidden)]
-    #[link_name = "arduino_serial_print_int"]
-    fn print_int(n: c_int, base: c_int) -> c_size_t;
-    #[doc(hidden)]
-    #[link_name = "arduino_serial_print_long"]
-    fn print_long(n: c_long, base: c_int) -> c_size_t;
-    #[allow(dead_code)]
-    #[doc(hidden)]
-    #[link_name = "arduino_serial_print_unsigned_char"]
-    fn print_unsigned_char(n: c_uchar, base: c_int) -> c_size_t;
-    #[doc(hidden)]
-    #[link_name = "arduino_serial_print_unsigned_int"]
-    fn print_unsigned_int(n: c_uint, base: c_int) -> c_size_t;
-    #[doc(hidden)]
-    #[link_name = "arduino_serial_print_unsigned_long"]
-    fn print_unsigned_long(n: c_ulong, base: c_int) -> c_size_t;
-}
-
\ No newline at end of file diff --git a/docs/doc/src/atomic_polyfill/lib.rs.html b/docs/doc/src/atomic_polyfill/lib.rs.html deleted file mode 100644 index 7a7847b..0000000 --- a/docs/doc/src/atomic_polyfill/lib.rs.html +++ /dev/null @@ -1,19 +0,0 @@ -lib.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-
#![no_std]
-
-#[cfg(reexport_core)]
-pub use core::sync::atomic::*;
-
-#[cfg(not(reexport_core))]
-mod polyfill;
-#[cfg(not(reexport_core))]
-pub use polyfill::*;
-
\ No newline at end of file diff --git a/docs/doc/src/byteorder/lib.rs.html b/docs/doc/src/byteorder/lib.rs.html deleted file mode 100644 index 8fb622d..0000000 --- a/docs/doc/src/byteorder/lib.rs.html +++ /dev/null @@ -1,8105 +0,0 @@ -lib.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-867
-868
-869
-870
-871
-872
-873
-874
-875
-876
-877
-878
-879
-880
-881
-882
-883
-884
-885
-886
-887
-888
-889
-890
-891
-892
-893
-894
-895
-896
-897
-898
-899
-900
-901
-902
-903
-904
-905
-906
-907
-908
-909
-910
-911
-912
-913
-914
-915
-916
-917
-918
-919
-920
-921
-922
-923
-924
-925
-926
-927
-928
-929
-930
-931
-932
-933
-934
-935
-936
-937
-938
-939
-940
-941
-942
-943
-944
-945
-946
-947
-948
-949
-950
-951
-952
-953
-954
-955
-956
-957
-958
-959
-960
-961
-962
-963
-964
-965
-966
-967
-968
-969
-970
-971
-972
-973
-974
-975
-976
-977
-978
-979
-980
-981
-982
-983
-984
-985
-986
-987
-988
-989
-990
-991
-992
-993
-994
-995
-996
-997
-998
-999
-1000
-1001
-1002
-1003
-1004
-1005
-1006
-1007
-1008
-1009
-1010
-1011
-1012
-1013
-1014
-1015
-1016
-1017
-1018
-1019
-1020
-1021
-1022
-1023
-1024
-1025
-1026
-1027
-1028
-1029
-1030
-1031
-1032
-1033
-1034
-1035
-1036
-1037
-1038
-1039
-1040
-1041
-1042
-1043
-1044
-1045
-1046
-1047
-1048
-1049
-1050
-1051
-1052
-1053
-1054
-1055
-1056
-1057
-1058
-1059
-1060
-1061
-1062
-1063
-1064
-1065
-1066
-1067
-1068
-1069
-1070
-1071
-1072
-1073
-1074
-1075
-1076
-1077
-1078
-1079
-1080
-1081
-1082
-1083
-1084
-1085
-1086
-1087
-1088
-1089
-1090
-1091
-1092
-1093
-1094
-1095
-1096
-1097
-1098
-1099
-1100
-1101
-1102
-1103
-1104
-1105
-1106
-1107
-1108
-1109
-1110
-1111
-1112
-1113
-1114
-1115
-1116
-1117
-1118
-1119
-1120
-1121
-1122
-1123
-1124
-1125
-1126
-1127
-1128
-1129
-1130
-1131
-1132
-1133
-1134
-1135
-1136
-1137
-1138
-1139
-1140
-1141
-1142
-1143
-1144
-1145
-1146
-1147
-1148
-1149
-1150
-1151
-1152
-1153
-1154
-1155
-1156
-1157
-1158
-1159
-1160
-1161
-1162
-1163
-1164
-1165
-1166
-1167
-1168
-1169
-1170
-1171
-1172
-1173
-1174
-1175
-1176
-1177
-1178
-1179
-1180
-1181
-1182
-1183
-1184
-1185
-1186
-1187
-1188
-1189
-1190
-1191
-1192
-1193
-1194
-1195
-1196
-1197
-1198
-1199
-1200
-1201
-1202
-1203
-1204
-1205
-1206
-1207
-1208
-1209
-1210
-1211
-1212
-1213
-1214
-1215
-1216
-1217
-1218
-1219
-1220
-1221
-1222
-1223
-1224
-1225
-1226
-1227
-1228
-1229
-1230
-1231
-1232
-1233
-1234
-1235
-1236
-1237
-1238
-1239
-1240
-1241
-1242
-1243
-1244
-1245
-1246
-1247
-1248
-1249
-1250
-1251
-1252
-1253
-1254
-1255
-1256
-1257
-1258
-1259
-1260
-1261
-1262
-1263
-1264
-1265
-1266
-1267
-1268
-1269
-1270
-1271
-1272
-1273
-1274
-1275
-1276
-1277
-1278
-1279
-1280
-1281
-1282
-1283
-1284
-1285
-1286
-1287
-1288
-1289
-1290
-1291
-1292
-1293
-1294
-1295
-1296
-1297
-1298
-1299
-1300
-1301
-1302
-1303
-1304
-1305
-1306
-1307
-1308
-1309
-1310
-1311
-1312
-1313
-1314
-1315
-1316
-1317
-1318
-1319
-1320
-1321
-1322
-1323
-1324
-1325
-1326
-1327
-1328
-1329
-1330
-1331
-1332
-1333
-1334
-1335
-1336
-1337
-1338
-1339
-1340
-1341
-1342
-1343
-1344
-1345
-1346
-1347
-1348
-1349
-1350
-1351
-1352
-1353
-1354
-1355
-1356
-1357
-1358
-1359
-1360
-1361
-1362
-1363
-1364
-1365
-1366
-1367
-1368
-1369
-1370
-1371
-1372
-1373
-1374
-1375
-1376
-1377
-1378
-1379
-1380
-1381
-1382
-1383
-1384
-1385
-1386
-1387
-1388
-1389
-1390
-1391
-1392
-1393
-1394
-1395
-1396
-1397
-1398
-1399
-1400
-1401
-1402
-1403
-1404
-1405
-1406
-1407
-1408
-1409
-1410
-1411
-1412
-1413
-1414
-1415
-1416
-1417
-1418
-1419
-1420
-1421
-1422
-1423
-1424
-1425
-1426
-1427
-1428
-1429
-1430
-1431
-1432
-1433
-1434
-1435
-1436
-1437
-1438
-1439
-1440
-1441
-1442
-1443
-1444
-1445
-1446
-1447
-1448
-1449
-1450
-1451
-1452
-1453
-1454
-1455
-1456
-1457
-1458
-1459
-1460
-1461
-1462
-1463
-1464
-1465
-1466
-1467
-1468
-1469
-1470
-1471
-1472
-1473
-1474
-1475
-1476
-1477
-1478
-1479
-1480
-1481
-1482
-1483
-1484
-1485
-1486
-1487
-1488
-1489
-1490
-1491
-1492
-1493
-1494
-1495
-1496
-1497
-1498
-1499
-1500
-1501
-1502
-1503
-1504
-1505
-1506
-1507
-1508
-1509
-1510
-1511
-1512
-1513
-1514
-1515
-1516
-1517
-1518
-1519
-1520
-1521
-1522
-1523
-1524
-1525
-1526
-1527
-1528
-1529
-1530
-1531
-1532
-1533
-1534
-1535
-1536
-1537
-1538
-1539
-1540
-1541
-1542
-1543
-1544
-1545
-1546
-1547
-1548
-1549
-1550
-1551
-1552
-1553
-1554
-1555
-1556
-1557
-1558
-1559
-1560
-1561
-1562
-1563
-1564
-1565
-1566
-1567
-1568
-1569
-1570
-1571
-1572
-1573
-1574
-1575
-1576
-1577
-1578
-1579
-1580
-1581
-1582
-1583
-1584
-1585
-1586
-1587
-1588
-1589
-1590
-1591
-1592
-1593
-1594
-1595
-1596
-1597
-1598
-1599
-1600
-1601
-1602
-1603
-1604
-1605
-1606
-1607
-1608
-1609
-1610
-1611
-1612
-1613
-1614
-1615
-1616
-1617
-1618
-1619
-1620
-1621
-1622
-1623
-1624
-1625
-1626
-1627
-1628
-1629
-1630
-1631
-1632
-1633
-1634
-1635
-1636
-1637
-1638
-1639
-1640
-1641
-1642
-1643
-1644
-1645
-1646
-1647
-1648
-1649
-1650
-1651
-1652
-1653
-1654
-1655
-1656
-1657
-1658
-1659
-1660
-1661
-1662
-1663
-1664
-1665
-1666
-1667
-1668
-1669
-1670
-1671
-1672
-1673
-1674
-1675
-1676
-1677
-1678
-1679
-1680
-1681
-1682
-1683
-1684
-1685
-1686
-1687
-1688
-1689
-1690
-1691
-1692
-1693
-1694
-1695
-1696
-1697
-1698
-1699
-1700
-1701
-1702
-1703
-1704
-1705
-1706
-1707
-1708
-1709
-1710
-1711
-1712
-1713
-1714
-1715
-1716
-1717
-1718
-1719
-1720
-1721
-1722
-1723
-1724
-1725
-1726
-1727
-1728
-1729
-1730
-1731
-1732
-1733
-1734
-1735
-1736
-1737
-1738
-1739
-1740
-1741
-1742
-1743
-1744
-1745
-1746
-1747
-1748
-1749
-1750
-1751
-1752
-1753
-1754
-1755
-1756
-1757
-1758
-1759
-1760
-1761
-1762
-1763
-1764
-1765
-1766
-1767
-1768
-1769
-1770
-1771
-1772
-1773
-1774
-1775
-1776
-1777
-1778
-1779
-1780
-1781
-1782
-1783
-1784
-1785
-1786
-1787
-1788
-1789
-1790
-1791
-1792
-1793
-1794
-1795
-1796
-1797
-1798
-1799
-1800
-1801
-1802
-1803
-1804
-1805
-1806
-1807
-1808
-1809
-1810
-1811
-1812
-1813
-1814
-1815
-1816
-1817
-1818
-1819
-1820
-1821
-1822
-1823
-1824
-1825
-1826
-1827
-1828
-1829
-1830
-1831
-1832
-1833
-1834
-1835
-1836
-1837
-1838
-1839
-1840
-1841
-1842
-1843
-1844
-1845
-1846
-1847
-1848
-1849
-1850
-1851
-1852
-1853
-1854
-1855
-1856
-1857
-1858
-1859
-1860
-1861
-1862
-1863
-1864
-1865
-1866
-1867
-1868
-1869
-1870
-1871
-1872
-1873
-1874
-1875
-1876
-1877
-1878
-1879
-1880
-1881
-1882
-1883
-1884
-1885
-1886
-1887
-1888
-1889
-1890
-1891
-1892
-1893
-1894
-1895
-1896
-1897
-1898
-1899
-1900
-1901
-1902
-1903
-1904
-1905
-1906
-1907
-1908
-1909
-1910
-1911
-1912
-1913
-1914
-1915
-1916
-1917
-1918
-1919
-1920
-1921
-1922
-1923
-1924
-1925
-1926
-1927
-1928
-1929
-1930
-1931
-1932
-1933
-1934
-1935
-1936
-1937
-1938
-1939
-1940
-1941
-1942
-1943
-1944
-1945
-1946
-1947
-1948
-1949
-1950
-1951
-1952
-1953
-1954
-1955
-1956
-1957
-1958
-1959
-1960
-1961
-1962
-1963
-1964
-1965
-1966
-1967
-1968
-1969
-1970
-1971
-1972
-1973
-1974
-1975
-1976
-1977
-1978
-1979
-1980
-1981
-1982
-1983
-1984
-1985
-1986
-1987
-1988
-1989
-1990
-1991
-1992
-1993
-1994
-1995
-1996
-1997
-1998
-1999
-2000
-2001
-2002
-2003
-2004
-2005
-2006
-2007
-2008
-2009
-2010
-2011
-2012
-2013
-2014
-2015
-2016
-2017
-2018
-2019
-2020
-2021
-2022
-2023
-2024
-2025
-2026
-2027
-2028
-2029
-2030
-2031
-2032
-2033
-2034
-2035
-2036
-2037
-2038
-2039
-2040
-2041
-2042
-2043
-2044
-2045
-2046
-2047
-2048
-2049
-2050
-2051
-2052
-2053
-2054
-2055
-2056
-2057
-2058
-2059
-2060
-2061
-2062
-2063
-2064
-2065
-2066
-2067
-2068
-2069
-2070
-2071
-2072
-2073
-2074
-2075
-2076
-2077
-2078
-2079
-2080
-2081
-2082
-2083
-2084
-2085
-2086
-2087
-2088
-2089
-2090
-2091
-2092
-2093
-2094
-2095
-2096
-2097
-2098
-2099
-2100
-2101
-2102
-2103
-2104
-2105
-2106
-2107
-2108
-2109
-2110
-2111
-2112
-2113
-2114
-2115
-2116
-2117
-2118
-2119
-2120
-2121
-2122
-2123
-2124
-2125
-2126
-2127
-2128
-2129
-2130
-2131
-2132
-2133
-2134
-2135
-2136
-2137
-2138
-2139
-2140
-2141
-2142
-2143
-2144
-2145
-2146
-2147
-2148
-2149
-2150
-2151
-2152
-2153
-2154
-2155
-2156
-2157
-2158
-2159
-2160
-2161
-2162
-2163
-2164
-2165
-2166
-2167
-2168
-2169
-2170
-2171
-2172
-2173
-2174
-2175
-2176
-2177
-2178
-2179
-2180
-2181
-2182
-2183
-2184
-2185
-2186
-2187
-2188
-2189
-2190
-2191
-2192
-2193
-2194
-2195
-2196
-2197
-2198
-2199
-2200
-2201
-2202
-2203
-2204
-2205
-2206
-2207
-2208
-2209
-2210
-2211
-2212
-2213
-2214
-2215
-2216
-2217
-2218
-2219
-2220
-2221
-2222
-2223
-2224
-2225
-2226
-2227
-2228
-2229
-2230
-2231
-2232
-2233
-2234
-2235
-2236
-2237
-2238
-2239
-2240
-2241
-2242
-2243
-2244
-2245
-2246
-2247
-2248
-2249
-2250
-2251
-2252
-2253
-2254
-2255
-2256
-2257
-2258
-2259
-2260
-2261
-2262
-2263
-2264
-2265
-2266
-2267
-2268
-2269
-2270
-2271
-2272
-2273
-2274
-2275
-2276
-2277
-2278
-2279
-2280
-2281
-2282
-2283
-2284
-2285
-2286
-2287
-2288
-2289
-2290
-2291
-2292
-2293
-2294
-2295
-2296
-2297
-2298
-2299
-2300
-2301
-2302
-2303
-2304
-2305
-2306
-2307
-2308
-2309
-2310
-2311
-2312
-2313
-2314
-2315
-2316
-2317
-2318
-2319
-2320
-2321
-2322
-2323
-2324
-2325
-2326
-2327
-2328
-2329
-2330
-2331
-2332
-2333
-2334
-2335
-2336
-2337
-2338
-2339
-2340
-2341
-2342
-2343
-2344
-2345
-2346
-2347
-2348
-2349
-2350
-2351
-2352
-2353
-2354
-2355
-2356
-2357
-2358
-2359
-2360
-2361
-2362
-2363
-2364
-2365
-2366
-2367
-2368
-2369
-2370
-2371
-2372
-2373
-2374
-2375
-2376
-2377
-2378
-2379
-2380
-2381
-2382
-2383
-2384
-2385
-2386
-2387
-2388
-2389
-2390
-2391
-2392
-2393
-2394
-2395
-2396
-2397
-2398
-2399
-2400
-2401
-2402
-2403
-2404
-2405
-2406
-2407
-2408
-2409
-2410
-2411
-2412
-2413
-2414
-2415
-2416
-2417
-2418
-2419
-2420
-2421
-2422
-2423
-2424
-2425
-2426
-2427
-2428
-2429
-2430
-2431
-2432
-2433
-2434
-2435
-2436
-2437
-2438
-2439
-2440
-2441
-2442
-2443
-2444
-2445
-2446
-2447
-2448
-2449
-2450
-2451
-2452
-2453
-2454
-2455
-2456
-2457
-2458
-2459
-2460
-2461
-2462
-2463
-2464
-2465
-2466
-2467
-2468
-2469
-2470
-2471
-2472
-2473
-2474
-2475
-2476
-2477
-2478
-2479
-2480
-2481
-2482
-2483
-2484
-2485
-2486
-2487
-2488
-2489
-2490
-2491
-2492
-2493
-2494
-2495
-2496
-2497
-2498
-2499
-2500
-2501
-2502
-2503
-2504
-2505
-2506
-2507
-2508
-2509
-2510
-2511
-2512
-2513
-2514
-2515
-2516
-2517
-2518
-2519
-2520
-2521
-2522
-2523
-2524
-2525
-2526
-2527
-2528
-2529
-2530
-2531
-2532
-2533
-2534
-2535
-2536
-2537
-2538
-2539
-2540
-2541
-2542
-2543
-2544
-2545
-2546
-2547
-2548
-2549
-2550
-2551
-2552
-2553
-2554
-2555
-2556
-2557
-2558
-2559
-2560
-2561
-2562
-2563
-2564
-2565
-2566
-2567
-2568
-2569
-2570
-2571
-2572
-2573
-2574
-2575
-2576
-2577
-2578
-2579
-2580
-2581
-2582
-2583
-2584
-2585
-2586
-2587
-2588
-2589
-2590
-2591
-2592
-2593
-2594
-2595
-2596
-2597
-2598
-2599
-2600
-2601
-2602
-2603
-2604
-2605
-2606
-2607
-2608
-2609
-2610
-2611
-2612
-2613
-2614
-2615
-2616
-2617
-2618
-2619
-2620
-2621
-2622
-2623
-2624
-2625
-2626
-2627
-2628
-2629
-2630
-2631
-2632
-2633
-2634
-2635
-2636
-2637
-2638
-2639
-2640
-2641
-2642
-2643
-2644
-2645
-2646
-2647
-2648
-2649
-2650
-2651
-2652
-2653
-2654
-2655
-2656
-2657
-2658
-2659
-2660
-2661
-2662
-2663
-2664
-2665
-2666
-2667
-2668
-2669
-2670
-2671
-2672
-2673
-2674
-2675
-2676
-2677
-2678
-2679
-2680
-2681
-2682
-2683
-2684
-2685
-2686
-2687
-2688
-2689
-2690
-2691
-2692
-2693
-2694
-2695
-2696
-2697
-2698
-2699
-2700
-2701
-2702
-2703
-2704
-2705
-2706
-2707
-2708
-2709
-2710
-2711
-2712
-2713
-2714
-2715
-2716
-2717
-2718
-2719
-2720
-2721
-2722
-2723
-2724
-2725
-2726
-2727
-2728
-2729
-2730
-2731
-2732
-2733
-2734
-2735
-2736
-2737
-2738
-2739
-2740
-2741
-2742
-2743
-2744
-2745
-2746
-2747
-2748
-2749
-2750
-2751
-2752
-2753
-2754
-2755
-2756
-2757
-2758
-2759
-2760
-2761
-2762
-2763
-2764
-2765
-2766
-2767
-2768
-2769
-2770
-2771
-2772
-2773
-2774
-2775
-2776
-2777
-2778
-2779
-2780
-2781
-2782
-2783
-2784
-2785
-2786
-2787
-2788
-2789
-2790
-2791
-2792
-2793
-2794
-2795
-2796
-2797
-2798
-2799
-2800
-2801
-2802
-2803
-2804
-2805
-2806
-2807
-2808
-2809
-2810
-2811
-2812
-2813
-2814
-2815
-2816
-2817
-2818
-2819
-2820
-2821
-2822
-2823
-2824
-2825
-2826
-2827
-2828
-2829
-2830
-2831
-2832
-2833
-2834
-2835
-2836
-2837
-2838
-2839
-2840
-2841
-2842
-2843
-2844
-2845
-2846
-2847
-2848
-2849
-2850
-2851
-2852
-2853
-2854
-2855
-2856
-2857
-2858
-2859
-2860
-2861
-2862
-2863
-2864
-2865
-2866
-2867
-2868
-2869
-2870
-2871
-2872
-2873
-2874
-2875
-2876
-2877
-2878
-2879
-2880
-2881
-2882
-2883
-2884
-2885
-2886
-2887
-2888
-2889
-2890
-2891
-2892
-2893
-2894
-2895
-2896
-2897
-2898
-2899
-2900
-2901
-2902
-2903
-2904
-2905
-2906
-2907
-2908
-2909
-2910
-2911
-2912
-2913
-2914
-2915
-2916
-2917
-2918
-2919
-2920
-2921
-2922
-2923
-2924
-2925
-2926
-2927
-2928
-2929
-2930
-2931
-2932
-2933
-2934
-2935
-2936
-2937
-2938
-2939
-2940
-2941
-2942
-2943
-2944
-2945
-2946
-2947
-2948
-2949
-2950
-2951
-2952
-2953
-2954
-2955
-2956
-2957
-2958
-2959
-2960
-2961
-2962
-2963
-2964
-2965
-2966
-2967
-2968
-2969
-2970
-2971
-2972
-2973
-2974
-2975
-2976
-2977
-2978
-2979
-2980
-2981
-2982
-2983
-2984
-2985
-2986
-2987
-2988
-2989
-2990
-2991
-2992
-2993
-2994
-2995
-2996
-2997
-2998
-2999
-3000
-3001
-3002
-3003
-3004
-3005
-3006
-3007
-3008
-3009
-3010
-3011
-3012
-3013
-3014
-3015
-3016
-3017
-3018
-3019
-3020
-3021
-3022
-3023
-3024
-3025
-3026
-3027
-3028
-3029
-3030
-3031
-3032
-3033
-3034
-3035
-3036
-3037
-3038
-3039
-3040
-3041
-3042
-3043
-3044
-3045
-3046
-3047
-3048
-3049
-3050
-3051
-3052
-3053
-3054
-3055
-3056
-3057
-3058
-3059
-3060
-3061
-3062
-3063
-3064
-3065
-3066
-3067
-3068
-3069
-3070
-3071
-3072
-3073
-3074
-3075
-3076
-3077
-3078
-3079
-3080
-3081
-3082
-3083
-3084
-3085
-3086
-3087
-3088
-3089
-3090
-3091
-3092
-3093
-3094
-3095
-3096
-3097
-3098
-3099
-3100
-3101
-3102
-3103
-3104
-3105
-3106
-3107
-3108
-3109
-3110
-3111
-3112
-3113
-3114
-3115
-3116
-3117
-3118
-3119
-3120
-3121
-3122
-3123
-3124
-3125
-3126
-3127
-3128
-3129
-3130
-3131
-3132
-3133
-3134
-3135
-3136
-3137
-3138
-3139
-3140
-3141
-3142
-3143
-3144
-3145
-3146
-3147
-3148
-3149
-3150
-3151
-3152
-3153
-3154
-3155
-3156
-3157
-3158
-3159
-3160
-3161
-3162
-3163
-3164
-3165
-3166
-3167
-3168
-3169
-3170
-3171
-3172
-3173
-3174
-3175
-3176
-3177
-3178
-3179
-3180
-3181
-3182
-3183
-3184
-3185
-3186
-3187
-3188
-3189
-3190
-3191
-3192
-3193
-3194
-3195
-3196
-3197
-3198
-3199
-3200
-3201
-3202
-3203
-3204
-3205
-3206
-3207
-3208
-3209
-3210
-3211
-3212
-3213
-3214
-3215
-3216
-3217
-3218
-3219
-3220
-3221
-3222
-3223
-3224
-3225
-3226
-3227
-3228
-3229
-3230
-3231
-3232
-3233
-3234
-3235
-3236
-3237
-3238
-3239
-3240
-3241
-3242
-3243
-3244
-3245
-3246
-3247
-3248
-3249
-3250
-3251
-3252
-3253
-3254
-3255
-3256
-3257
-3258
-3259
-3260
-3261
-3262
-3263
-3264
-3265
-3266
-3267
-3268
-3269
-3270
-3271
-3272
-3273
-3274
-3275
-3276
-3277
-3278
-3279
-3280
-3281
-3282
-3283
-3284
-3285
-3286
-3287
-3288
-3289
-3290
-3291
-3292
-3293
-3294
-3295
-3296
-3297
-3298
-3299
-3300
-3301
-3302
-3303
-3304
-3305
-3306
-3307
-3308
-3309
-3310
-3311
-3312
-3313
-3314
-3315
-3316
-3317
-3318
-3319
-3320
-3321
-3322
-3323
-3324
-3325
-3326
-3327
-3328
-3329
-3330
-3331
-3332
-3333
-3334
-3335
-3336
-3337
-3338
-3339
-3340
-3341
-3342
-3343
-3344
-3345
-3346
-3347
-3348
-3349
-3350
-3351
-3352
-3353
-3354
-3355
-3356
-3357
-3358
-3359
-3360
-3361
-3362
-3363
-3364
-3365
-3366
-3367
-3368
-3369
-3370
-3371
-3372
-3373
-3374
-3375
-3376
-3377
-3378
-3379
-3380
-3381
-3382
-3383
-3384
-3385
-3386
-3387
-3388
-3389
-3390
-3391
-3392
-3393
-3394
-3395
-3396
-3397
-3398
-3399
-3400
-3401
-3402
-3403
-3404
-3405
-3406
-3407
-3408
-3409
-3410
-3411
-3412
-3413
-3414
-3415
-3416
-3417
-3418
-3419
-3420
-3421
-3422
-3423
-3424
-3425
-3426
-3427
-3428
-3429
-3430
-3431
-3432
-3433
-3434
-3435
-3436
-3437
-3438
-3439
-3440
-3441
-3442
-3443
-3444
-3445
-3446
-3447
-3448
-3449
-3450
-3451
-3452
-3453
-3454
-3455
-3456
-3457
-3458
-3459
-3460
-3461
-3462
-3463
-3464
-3465
-3466
-3467
-3468
-3469
-3470
-3471
-3472
-3473
-3474
-3475
-3476
-3477
-3478
-3479
-3480
-3481
-3482
-3483
-3484
-3485
-3486
-3487
-3488
-3489
-3490
-3491
-3492
-3493
-3494
-3495
-3496
-3497
-3498
-3499
-3500
-3501
-3502
-3503
-3504
-3505
-3506
-3507
-3508
-3509
-3510
-3511
-3512
-3513
-3514
-3515
-3516
-3517
-3518
-3519
-3520
-3521
-3522
-3523
-3524
-3525
-3526
-3527
-3528
-3529
-3530
-3531
-3532
-3533
-3534
-3535
-3536
-3537
-3538
-3539
-3540
-3541
-3542
-3543
-3544
-3545
-3546
-3547
-3548
-3549
-3550
-3551
-3552
-3553
-3554
-3555
-3556
-3557
-3558
-3559
-3560
-3561
-3562
-3563
-3564
-3565
-3566
-3567
-3568
-3569
-3570
-3571
-3572
-3573
-3574
-3575
-3576
-3577
-3578
-3579
-3580
-3581
-3582
-3583
-3584
-3585
-3586
-3587
-3588
-3589
-3590
-3591
-3592
-3593
-3594
-3595
-3596
-3597
-3598
-3599
-3600
-3601
-3602
-3603
-3604
-3605
-3606
-3607
-3608
-3609
-3610
-3611
-3612
-3613
-3614
-3615
-3616
-3617
-3618
-3619
-3620
-3621
-3622
-3623
-3624
-3625
-3626
-3627
-3628
-3629
-3630
-3631
-3632
-3633
-3634
-3635
-3636
-3637
-3638
-3639
-3640
-3641
-3642
-3643
-3644
-3645
-3646
-3647
-3648
-3649
-3650
-3651
-3652
-3653
-3654
-3655
-3656
-3657
-3658
-3659
-3660
-3661
-3662
-3663
-3664
-3665
-3666
-3667
-3668
-3669
-3670
-3671
-3672
-3673
-3674
-3675
-3676
-3677
-3678
-3679
-3680
-3681
-3682
-3683
-3684
-3685
-3686
-3687
-3688
-3689
-3690
-3691
-3692
-3693
-3694
-3695
-3696
-3697
-3698
-3699
-3700
-3701
-3702
-3703
-3704
-3705
-3706
-3707
-3708
-3709
-3710
-3711
-3712
-3713
-3714
-3715
-3716
-3717
-3718
-3719
-3720
-3721
-3722
-3723
-3724
-3725
-3726
-3727
-3728
-3729
-3730
-3731
-3732
-3733
-3734
-3735
-3736
-3737
-3738
-3739
-3740
-3741
-3742
-3743
-3744
-3745
-3746
-3747
-3748
-3749
-3750
-3751
-3752
-3753
-3754
-3755
-3756
-3757
-3758
-3759
-3760
-3761
-3762
-3763
-3764
-3765
-3766
-3767
-3768
-3769
-3770
-3771
-3772
-3773
-3774
-3775
-3776
-3777
-3778
-3779
-3780
-3781
-3782
-3783
-3784
-3785
-3786
-3787
-3788
-3789
-3790
-3791
-3792
-3793
-3794
-3795
-3796
-3797
-3798
-3799
-3800
-3801
-3802
-3803
-3804
-3805
-3806
-3807
-3808
-3809
-3810
-3811
-3812
-3813
-3814
-3815
-3816
-3817
-3818
-3819
-3820
-3821
-3822
-3823
-3824
-3825
-3826
-3827
-3828
-3829
-3830
-3831
-3832
-3833
-3834
-3835
-3836
-3837
-3838
-3839
-3840
-3841
-3842
-3843
-3844
-3845
-3846
-3847
-3848
-3849
-3850
-3851
-3852
-3853
-3854
-3855
-3856
-3857
-3858
-3859
-3860
-3861
-3862
-3863
-3864
-3865
-3866
-3867
-3868
-3869
-3870
-3871
-3872
-3873
-3874
-3875
-3876
-3877
-3878
-3879
-3880
-3881
-3882
-3883
-3884
-3885
-3886
-3887
-3888
-3889
-3890
-3891
-3892
-3893
-3894
-3895
-3896
-3897
-3898
-3899
-3900
-3901
-3902
-3903
-3904
-3905
-3906
-3907
-3908
-3909
-3910
-3911
-3912
-3913
-3914
-3915
-3916
-3917
-3918
-3919
-3920
-3921
-3922
-3923
-3924
-3925
-3926
-3927
-3928
-3929
-3930
-3931
-3932
-3933
-3934
-3935
-3936
-3937
-3938
-3939
-3940
-3941
-3942
-3943
-3944
-3945
-3946
-3947
-3948
-3949
-3950
-3951
-3952
-3953
-3954
-3955
-3956
-3957
-3958
-3959
-3960
-3961
-3962
-3963
-3964
-3965
-3966
-3967
-3968
-3969
-3970
-3971
-3972
-3973
-3974
-3975
-3976
-3977
-3978
-3979
-3980
-3981
-3982
-3983
-3984
-3985
-3986
-3987
-3988
-3989
-3990
-3991
-3992
-3993
-3994
-3995
-3996
-3997
-3998
-3999
-4000
-4001
-4002
-4003
-4004
-4005
-4006
-4007
-4008
-4009
-4010
-4011
-4012
-4013
-4014
-4015
-4016
-4017
-4018
-4019
-4020
-4021
-4022
-4023
-4024
-4025
-4026
-4027
-4028
-4029
-4030
-4031
-4032
-4033
-4034
-4035
-4036
-4037
-4038
-4039
-4040
-4041
-4042
-4043
-4044
-4045
-4046
-4047
-4048
-4049
-4050
-4051
-4052
-
/*!
-This crate provides convenience methods for encoding and decoding numbers in
-either [big-endian or little-endian order].
-
-The organization of the crate is pretty simple. A trait, [`ByteOrder`], specifies
-byte conversion methods for each type of number in Rust (sans numbers that have
-a platform dependent size like `usize` and `isize`). Two types, [`BigEndian`]
-and [`LittleEndian`] implement these methods. Finally, [`ReadBytesExt`] and
-[`WriteBytesExt`] provide convenience methods available to all types that
-implement [`Read`] and [`Write`].
-
-An alias, [`NetworkEndian`], for [`BigEndian`] is provided to help improve
-code clarity.
-
-An additional alias, [`NativeEndian`], is provided for the endianness of the
-local platform. This is convenient when serializing data for use and
-conversions are not desired.
-
-# Examples
-
-Read unsigned 16 bit big-endian integers from a [`Read`] type:
-
-```rust
-use std::io::Cursor;
-use byteorder::{BigEndian, ReadBytesExt};
-
-let mut rdr = Cursor::new(vec![2, 5, 3, 0]);
-// Note that we use type parameters to indicate which kind of byte order
-// we want!
-assert_eq!(517, rdr.read_u16::<BigEndian>().unwrap());
-assert_eq!(768, rdr.read_u16::<BigEndian>().unwrap());
-```
-
-Write unsigned 16 bit little-endian integers to a [`Write`] type:
-
-```rust
-use byteorder::{LittleEndian, WriteBytesExt};
-
-let mut wtr = vec![];
-wtr.write_u16::<LittleEndian>(517).unwrap();
-wtr.write_u16::<LittleEndian>(768).unwrap();
-assert_eq!(wtr, vec![5, 2, 0, 3]);
-```
-
-# Optional Features
-
-This crate optionally provides support for 128 bit values (`i128` and `u128`)
-when built with the `i128` feature enabled.
-
-This crate can also be used without the standard library.
-
-# Alternatives
-
-Note that as of Rust 1.32, the standard numeric types provide built-in methods
-like `to_le_bytes` and `from_le_bytes`, which support some of the same use
-cases.
-
-[big-endian or little-endian order]: https://en.wikipedia.org/wiki/Endianness
-[`ByteOrder`]: trait.ByteOrder.html
-[`BigEndian`]: enum.BigEndian.html
-[`LittleEndian`]: enum.LittleEndian.html
-[`ReadBytesExt`]: trait.ReadBytesExt.html
-[`WriteBytesExt`]: trait.WriteBytesExt.html
-[`NetworkEndian`]: type.NetworkEndian.html
-[`NativeEndian`]: type.NativeEndian.html
-[`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
-[`Write`]: https://doc.rust-lang.org/std/io/trait.Write.html
-*/
-
-#![deny(missing_docs)]
-#![cfg_attr(not(feature = "std"), no_std)]
-
-use core::{
-    convert::TryInto, fmt::Debug, hash::Hash, ptr::copy_nonoverlapping, slice,
-};
-
-#[cfg(feature = "std")]
-pub use crate::io::{ReadBytesExt, WriteBytesExt};
-
-#[cfg(feature = "std")]
-mod io;
-
-#[inline]
-fn extend_sign(val: u64, nbytes: usize) -> i64 {
-    let shift = (8 - nbytes) * 8;
-    (val << shift) as i64 >> shift
-}
-
-#[inline]
-fn extend_sign128(val: u128, nbytes: usize) -> i128 {
-    let shift = (16 - nbytes) * 8;
-    (val << shift) as i128 >> shift
-}
-
-#[inline]
-fn unextend_sign(val: i64, nbytes: usize) -> u64 {
-    let shift = (8 - nbytes) * 8;
-    (val << shift) as u64 >> shift
-}
-
-#[inline]
-fn unextend_sign128(val: i128, nbytes: usize) -> u128 {
-    let shift = (16 - nbytes) * 8;
-    (val << shift) as u128 >> shift
-}
-
-#[inline]
-fn pack_size(n: u64) -> usize {
-    if n < 1 << 8 {
-        1
-    } else if n < 1 << 16 {
-        2
-    } else if n < 1 << 24 {
-        3
-    } else if n < 1 << 32 {
-        4
-    } else if n < 1 << 40 {
-        5
-    } else if n < 1 << 48 {
-        6
-    } else if n < 1 << 56 {
-        7
-    } else {
-        8
-    }
-}
-
-#[inline]
-fn pack_size128(n: u128) -> usize {
-    if n < 1 << 8 {
-        1
-    } else if n < 1 << 16 {
-        2
-    } else if n < 1 << 24 {
-        3
-    } else if n < 1 << 32 {
-        4
-    } else if n < 1 << 40 {
-        5
-    } else if n < 1 << 48 {
-        6
-    } else if n < 1 << 56 {
-        7
-    } else if n < 1 << 64 {
-        8
-    } else if n < 1 << 72 {
-        9
-    } else if n < 1 << 80 {
-        10
-    } else if n < 1 << 88 {
-        11
-    } else if n < 1 << 96 {
-        12
-    } else if n < 1 << 104 {
-        13
-    } else if n < 1 << 112 {
-        14
-    } else if n < 1 << 120 {
-        15
-    } else {
-        16
-    }
-}
-
-mod private {
-    /// Sealed stops crates other than byteorder from implementing any traits
-    /// that use it.
-    pub trait Sealed {}
-    impl Sealed for super::LittleEndian {}
-    impl Sealed for super::BigEndian {}
-}
-
-/// `ByteOrder` describes types that can serialize integers as bytes.
-///
-/// Note that `Self` does not appear anywhere in this trait's definition!
-/// Therefore, in order to use it, you'll need to use syntax like
-/// `T::read_u16(&[0, 1])` where `T` implements `ByteOrder`.
-///
-/// This crate provides two types that implement `ByteOrder`: [`BigEndian`]
-/// and [`LittleEndian`].
-/// This trait is sealed and cannot be implemented for callers to avoid
-/// breaking backwards compatibility when adding new derived traits.
-///
-/// # Examples
-///
-/// Write and read `u32` numbers in little endian order:
-///
-/// ```rust
-/// use byteorder::{ByteOrder, LittleEndian};
-///
-/// let mut buf = [0; 4];
-/// LittleEndian::write_u32(&mut buf, 1_000_000);
-/// assert_eq!(1_000_000, LittleEndian::read_u32(&buf));
-/// ```
-///
-/// Write and read `i16` numbers in big endian order:
-///
-/// ```rust
-/// use byteorder::{ByteOrder, BigEndian};
-///
-/// let mut buf = [0; 2];
-/// BigEndian::write_i16(&mut buf, -5_000);
-/// assert_eq!(-5_000, BigEndian::read_i16(&buf));
-/// ```
-///
-/// [`BigEndian`]: enum.BigEndian.html
-/// [`LittleEndian`]: enum.LittleEndian.html
-pub trait ByteOrder:
-    Clone
-    + Copy
-    + Debug
-    + Default
-    + Eq
-    + Hash
-    + Ord
-    + PartialEq
-    + PartialOrd
-    + private::Sealed
-{
-    /// Reads an unsigned 16 bit integer from `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 2`.
-    fn read_u16(buf: &[u8]) -> u16;
-
-    /// Reads an unsigned 24 bit integer from `buf`, stored in u32.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 3`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read 24 bit `u32` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 3];
-    /// LittleEndian::write_u24(&mut buf, 1_000_000);
-    /// assert_eq!(1_000_000, LittleEndian::read_u24(&buf));
-    /// ```
-    fn read_u24(buf: &[u8]) -> u32 {
-        Self::read_uint(buf, 3) as u32
-    }
-
-    /// Reads an unsigned 32 bit integer from `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 4`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `u32` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 4];
-    /// LittleEndian::write_u32(&mut buf, 1_000_000);
-    /// assert_eq!(1_000_000, LittleEndian::read_u32(&buf));
-    /// ```
-    fn read_u32(buf: &[u8]) -> u32;
-
-    /// Reads an unsigned 48 bit integer from `buf`, stored in u64.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 6`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read 48 bit `u64` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 6];
-    /// LittleEndian::write_u48(&mut buf, 1_000_000_000_000);
-    /// assert_eq!(1_000_000_000_000, LittleEndian::read_u48(&buf));
-    /// ```
-    fn read_u48(buf: &[u8]) -> u64 {
-        Self::read_uint(buf, 6) as u64
-    }
-
-    /// Reads an unsigned 64 bit integer from `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 8`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `u64` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 8];
-    /// LittleEndian::write_u64(&mut buf, 1_000_000);
-    /// assert_eq!(1_000_000, LittleEndian::read_u64(&buf));
-    /// ```
-    fn read_u64(buf: &[u8]) -> u64;
-
-    /// Reads an unsigned 128 bit integer from `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 16`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `u128` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 16];
-    /// LittleEndian::write_u128(&mut buf, 1_000_000);
-    /// assert_eq!(1_000_000, LittleEndian::read_u128(&buf));
-    /// ```
-    fn read_u128(buf: &[u8]) -> u128;
-
-    /// Reads an unsigned n-bytes integer from `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `nbytes < 1` or `nbytes > 8` or
-    /// `buf.len() < nbytes`
-    ///
-    /// # Examples
-    ///
-    /// Write and read an n-byte number in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 3];
-    /// LittleEndian::write_uint(&mut buf, 1_000_000, 3);
-    /// assert_eq!(1_000_000, LittleEndian::read_uint(&buf, 3));
-    /// ```
-    fn read_uint(buf: &[u8], nbytes: usize) -> u64;
-
-    /// Reads an unsigned n-bytes integer from `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `nbytes < 1` or `nbytes > 16` or
-    /// `buf.len() < nbytes`
-    ///
-    /// # Examples
-    ///
-    /// Write and read an n-byte number in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 3];
-    /// LittleEndian::write_uint128(&mut buf, 1_000_000, 3);
-    /// assert_eq!(1_000_000, LittleEndian::read_uint128(&buf, 3));
-    /// ```
-    fn read_uint128(buf: &[u8], nbytes: usize) -> u128;
-
-    /// Writes an unsigned 16 bit integer `n` to `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 2`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `u16` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 2];
-    /// LittleEndian::write_u16(&mut buf, 1_000);
-    /// assert_eq!(1_000, LittleEndian::read_u16(&buf));
-    /// ```
-    fn write_u16(buf: &mut [u8], n: u16);
-
-    /// Writes an unsigned 24 bit integer `n` to `buf`, stored in u32.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 3`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read 24 bit `u32` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 3];
-    /// LittleEndian::write_u24(&mut buf, 1_000_000);
-    /// assert_eq!(1_000_000, LittleEndian::read_u24(&buf));
-    /// ```
-    fn write_u24(buf: &mut [u8], n: u32) {
-        Self::write_uint(buf, n as u64, 3)
-    }
-
-    /// Writes an unsigned 32 bit integer `n` to `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 4`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `u32` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 4];
-    /// LittleEndian::write_u32(&mut buf, 1_000_000);
-    /// assert_eq!(1_000_000, LittleEndian::read_u32(&buf));
-    /// ```
-    fn write_u32(buf: &mut [u8], n: u32);
-
-    /// Writes an unsigned 48 bit integer `n` to `buf`, stored in u64.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 6`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read 48 bit `u64` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 6];
-    /// LittleEndian::write_u48(&mut buf, 1_000_000_000_000);
-    /// assert_eq!(1_000_000_000_000, LittleEndian::read_u48(&buf));
-    /// ```
-    fn write_u48(buf: &mut [u8], n: u64) {
-        Self::write_uint(buf, n as u64, 6)
-    }
-
-    /// Writes an unsigned 64 bit integer `n` to `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 8`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `u64` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 8];
-    /// LittleEndian::write_u64(&mut buf, 1_000_000);
-    /// assert_eq!(1_000_000, LittleEndian::read_u64(&buf));
-    /// ```
-    fn write_u64(buf: &mut [u8], n: u64);
-
-    /// Writes an unsigned 128 bit integer `n` to `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 16`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `u128` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 16];
-    /// LittleEndian::write_u128(&mut buf, 1_000_000);
-    /// assert_eq!(1_000_000, LittleEndian::read_u128(&buf));
-    /// ```
-    fn write_u128(buf: &mut [u8], n: u128);
-
-    /// Writes an unsigned integer `n` to `buf` using only `nbytes`.
-    ///
-    /// # Panics
-    ///
-    /// If `n` is not representable in `nbytes`, or if `nbytes` is `> 8`, then
-    /// this method panics.
-    ///
-    /// # Examples
-    ///
-    /// Write and read an n-byte number in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 3];
-    /// LittleEndian::write_uint(&mut buf, 1_000_000, 3);
-    /// assert_eq!(1_000_000, LittleEndian::read_uint(&buf, 3));
-    /// ```
-    fn write_uint(buf: &mut [u8], n: u64, nbytes: usize);
-
-    /// Writes an unsigned integer `n` to `buf` using only `nbytes`.
-    ///
-    /// # Panics
-    ///
-    /// If `n` is not representable in `nbytes`, or if `nbytes` is `> 16`, then
-    /// this method panics.
-    ///
-    /// # Examples
-    ///
-    /// Write and read an n-byte number in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 3];
-    /// LittleEndian::write_uint128(&mut buf, 1_000_000, 3);
-    /// assert_eq!(1_000_000, LittleEndian::read_uint128(&buf, 3));
-    /// ```
-    fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize);
-
-    /// Reads a signed 16 bit integer from `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 2`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `i16` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 2];
-    /// LittleEndian::write_i16(&mut buf, -1_000);
-    /// assert_eq!(-1_000, LittleEndian::read_i16(&buf));
-    /// ```
-    #[inline]
-    fn read_i16(buf: &[u8]) -> i16 {
-        Self::read_u16(buf) as i16
-    }
-
-    /// Reads a signed 24 bit integer from `buf`, stored in i32.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 3`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read 24 bit `i32` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 3];
-    /// LittleEndian::write_i24(&mut buf, -1_000_000);
-    /// assert_eq!(-1_000_000, LittleEndian::read_i24(&buf));
-    /// ```
-    #[inline]
-    fn read_i24(buf: &[u8]) -> i32 {
-        Self::read_int(buf, 3) as i32
-    }
-
-    /// Reads a signed 32 bit integer from `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 4`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `i32` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 4];
-    /// LittleEndian::write_i32(&mut buf, -1_000_000);
-    /// assert_eq!(-1_000_000, LittleEndian::read_i32(&buf));
-    /// ```
-    #[inline]
-    fn read_i32(buf: &[u8]) -> i32 {
-        Self::read_u32(buf) as i32
-    }
-
-    /// Reads a signed 48 bit integer from `buf`, stored in i64.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 6`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read 48 bit `i64` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 6];
-    /// LittleEndian::write_i48(&mut buf, -1_000_000_000_000);
-    /// assert_eq!(-1_000_000_000_000, LittleEndian::read_i48(&buf));
-    /// ```
-    #[inline]
-    fn read_i48(buf: &[u8]) -> i64 {
-        Self::read_int(buf, 6) as i64
-    }
-
-    /// Reads a signed 64 bit integer from `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 8`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `i64` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 8];
-    /// LittleEndian::write_i64(&mut buf, -1_000_000_000);
-    /// assert_eq!(-1_000_000_000, LittleEndian::read_i64(&buf));
-    /// ```
-    #[inline]
-    fn read_i64(buf: &[u8]) -> i64 {
-        Self::read_u64(buf) as i64
-    }
-
-    /// Reads a signed 128 bit integer from `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 16`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `i128` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 16];
-    /// LittleEndian::write_i128(&mut buf, -1_000_000_000);
-    /// assert_eq!(-1_000_000_000, LittleEndian::read_i128(&buf));
-    /// ```
-    #[inline]
-    fn read_i128(buf: &[u8]) -> i128 {
-        Self::read_u128(buf) as i128
-    }
-
-    /// Reads a signed n-bytes integer from `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `nbytes < 1` or `nbytes > 8` or
-    /// `buf.len() < nbytes`
-    ///
-    /// # Examples
-    ///
-    /// Write and read n-length signed numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 3];
-    /// LittleEndian::write_int(&mut buf, -1_000, 3);
-    /// assert_eq!(-1_000, LittleEndian::read_int(&buf, 3));
-    /// ```
-    #[inline]
-    fn read_int(buf: &[u8], nbytes: usize) -> i64 {
-        extend_sign(Self::read_uint(buf, nbytes), nbytes)
-    }
-
-    /// Reads a signed n-bytes integer from `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `nbytes < 1` or `nbytes > 16` or
-    /// `buf.len() < nbytes`
-    ///
-    /// # Examples
-    ///
-    /// Write and read n-length signed numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 3];
-    /// LittleEndian::write_int128(&mut buf, -1_000, 3);
-    /// assert_eq!(-1_000, LittleEndian::read_int128(&buf, 3));
-    /// ```
-    #[inline]
-    fn read_int128(buf: &[u8], nbytes: usize) -> i128 {
-        extend_sign128(Self::read_uint128(buf, nbytes), nbytes)
-    }
-
-    /// Reads a IEEE754 single-precision (4 bytes) floating point number.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 4`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `f32` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let e = 2.71828;
-    /// let mut buf = [0; 4];
-    /// LittleEndian::write_f32(&mut buf, e);
-    /// assert_eq!(e, LittleEndian::read_f32(&buf));
-    /// ```
-    #[inline]
-    fn read_f32(buf: &[u8]) -> f32 {
-        f32::from_bits(Self::read_u32(buf))
-    }
-
-    /// Reads a IEEE754 double-precision (8 bytes) floating point number.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 8`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `f64` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let phi = 1.6180339887;
-    /// let mut buf = [0; 8];
-    /// LittleEndian::write_f64(&mut buf, phi);
-    /// assert_eq!(phi, LittleEndian::read_f64(&buf));
-    /// ```
-    #[inline]
-    fn read_f64(buf: &[u8]) -> f64 {
-        f64::from_bits(Self::read_u64(buf))
-    }
-
-    /// Writes a signed 16 bit integer `n` to `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 2`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `i16` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 2];
-    /// LittleEndian::write_i16(&mut buf, -1_000);
-    /// assert_eq!(-1_000, LittleEndian::read_i16(&buf));
-    /// ```
-    #[inline]
-    fn write_i16(buf: &mut [u8], n: i16) {
-        Self::write_u16(buf, n as u16)
-    }
-
-    /// Writes a signed 24 bit integer `n` to `buf`, stored in i32.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 3`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read 24 bit `i32` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 3];
-    /// LittleEndian::write_i24(&mut buf, -1_000_000);
-    /// assert_eq!(-1_000_000, LittleEndian::read_i24(&buf));
-    /// ```
-    #[inline]
-    fn write_i24(buf: &mut [u8], n: i32) {
-        Self::write_int(buf, n as i64, 3)
-    }
-
-    /// Writes a signed 32 bit integer `n` to `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 4`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `i32` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 4];
-    /// LittleEndian::write_i32(&mut buf, -1_000_000);
-    /// assert_eq!(-1_000_000, LittleEndian::read_i32(&buf));
-    /// ```
-    #[inline]
-    fn write_i32(buf: &mut [u8], n: i32) {
-        Self::write_u32(buf, n as u32)
-    }
-
-    /// Writes a signed 48 bit integer `n` to `buf`, stored in i64.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 6`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read 48 bit `i64` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 6];
-    /// LittleEndian::write_i48(&mut buf, -1_000_000_000_000);
-    /// assert_eq!(-1_000_000_000_000, LittleEndian::read_i48(&buf));
-    /// ```
-    #[inline]
-    fn write_i48(buf: &mut [u8], n: i64) {
-        Self::write_int(buf, n as i64, 6)
-    }
-
-    /// Writes a signed 64 bit integer `n` to `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 8`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `i64` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 8];
-    /// LittleEndian::write_i64(&mut buf, -1_000_000_000);
-    /// assert_eq!(-1_000_000_000, LittleEndian::read_i64(&buf));
-    /// ```
-    #[inline]
-    fn write_i64(buf: &mut [u8], n: i64) {
-        Self::write_u64(buf, n as u64)
-    }
-
-    /// Writes a signed 128 bit integer `n` to `buf`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 16`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read n-byte `i128` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 16];
-    /// LittleEndian::write_i128(&mut buf, -1_000_000_000);
-    /// assert_eq!(-1_000_000_000, LittleEndian::read_i128(&buf));
-    /// ```
-    #[inline]
-    fn write_i128(buf: &mut [u8], n: i128) {
-        Self::write_u128(buf, n as u128)
-    }
-
-    /// Writes a signed integer `n` to `buf` using only `nbytes`.
-    ///
-    /// # Panics
-    ///
-    /// If `n` is not representable in `nbytes`, or if `nbytes` is `> 8`, then
-    /// this method panics.
-    ///
-    /// # Examples
-    ///
-    /// Write and read an n-byte number in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 3];
-    /// LittleEndian::write_int(&mut buf, -1_000, 3);
-    /// assert_eq!(-1_000, LittleEndian::read_int(&buf, 3));
-    /// ```
-    #[inline]
-    fn write_int(buf: &mut [u8], n: i64, nbytes: usize) {
-        Self::write_uint(buf, unextend_sign(n, nbytes), nbytes)
-    }
-
-    /// Writes a signed integer `n` to `buf` using only `nbytes`.
-    ///
-    /// # Panics
-    ///
-    /// If `n` is not representable in `nbytes`, or if `nbytes` is `> 16`, then
-    /// this method panics.
-    ///
-    /// # Examples
-    ///
-    /// Write and read n-length signed numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut buf = [0; 3];
-    /// LittleEndian::write_int128(&mut buf, -1_000, 3);
-    /// assert_eq!(-1_000, LittleEndian::read_int128(&buf, 3));
-    /// ```
-    #[inline]
-    fn write_int128(buf: &mut [u8], n: i128, nbytes: usize) {
-        Self::write_uint128(buf, unextend_sign128(n, nbytes), nbytes)
-    }
-
-    /// Writes a IEEE754 single-precision (4 bytes) floating point number.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 4`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `f32` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let e = 2.71828;
-    /// let mut buf = [0; 4];
-    /// LittleEndian::write_f32(&mut buf, e);
-    /// assert_eq!(e, LittleEndian::read_f32(&buf));
-    /// ```
-    #[inline]
-    fn write_f32(buf: &mut [u8], n: f32) {
-        Self::write_u32(buf, n.to_bits())
-    }
-
-    /// Writes a IEEE754 double-precision (8 bytes) floating point number.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() < 8`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `f64` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let phi = 1.6180339887;
-    /// let mut buf = [0; 8];
-    /// LittleEndian::write_f64(&mut buf, phi);
-    /// assert_eq!(phi, LittleEndian::read_f64(&buf));
-    /// ```
-    #[inline]
-    fn write_f64(buf: &mut [u8], n: f64) {
-        Self::write_u64(buf, n.to_bits())
-    }
-
-    /// Reads unsigned 16 bit integers from `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `src.len() != 2*dst.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `u16` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 8];
-    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
-    /// LittleEndian::write_u16_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0; 4];
-    /// LittleEndian::read_u16_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    fn read_u16_into(src: &[u8], dst: &mut [u16]);
-
-    /// Reads unsigned 32 bit integers from `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `src.len() != 4*dst.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `u32` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 16];
-    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
-    /// LittleEndian::write_u32_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0; 4];
-    /// LittleEndian::read_u32_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    fn read_u32_into(src: &[u8], dst: &mut [u32]);
-
-    /// Reads unsigned 64 bit integers from `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `src.len() != 8*dst.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `u64` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 32];
-    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
-    /// LittleEndian::write_u64_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0; 4];
-    /// LittleEndian::read_u64_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    fn read_u64_into(src: &[u8], dst: &mut [u64]);
-
-    /// Reads unsigned 128 bit integers from `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `src.len() != 16*dst.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `u128` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 64];
-    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
-    /// LittleEndian::write_u128_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0; 4];
-    /// LittleEndian::read_u128_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    fn read_u128_into(src: &[u8], dst: &mut [u128]);
-
-    /// Reads signed 16 bit integers from `src` to `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() != 2*dst.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `i16` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 8];
-    /// let numbers_given = [1, 2, 0x0f, 0xee];
-    /// LittleEndian::write_i16_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0; 4];
-    /// LittleEndian::read_i16_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    #[inline]
-    fn read_i16_into(src: &[u8], dst: &mut [i16]) {
-        let dst = unsafe {
-            slice::from_raw_parts_mut(dst.as_mut_ptr() as *mut u16, dst.len())
-        };
-        Self::read_u16_into(src, dst)
-    }
-
-    /// Reads signed 32 bit integers from `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `src.len() != 4*dst.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `i32` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 16];
-    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
-    /// LittleEndian::write_i32_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0; 4];
-    /// LittleEndian::read_i32_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    #[inline]
-    fn read_i32_into(src: &[u8], dst: &mut [i32]) {
-        let dst = unsafe {
-            slice::from_raw_parts_mut(dst.as_mut_ptr() as *mut u32, dst.len())
-        };
-        Self::read_u32_into(src, dst);
-    }
-
-    /// Reads signed 64 bit integers from `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `src.len() != 8*dst.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `i64` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 32];
-    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
-    /// LittleEndian::write_i64_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0; 4];
-    /// LittleEndian::read_i64_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    #[inline]
-    fn read_i64_into(src: &[u8], dst: &mut [i64]) {
-        let dst = unsafe {
-            slice::from_raw_parts_mut(dst.as_mut_ptr() as *mut u64, dst.len())
-        };
-        Self::read_u64_into(src, dst);
-    }
-
-    /// Reads signed 128 bit integers from `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `src.len() != 16*dst.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `i128` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 64];
-    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
-    /// LittleEndian::write_i128_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0; 4];
-    /// LittleEndian::read_i128_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    #[inline]
-    fn read_i128_into(src: &[u8], dst: &mut [i128]) {
-        let dst = unsafe {
-            slice::from_raw_parts_mut(dst.as_mut_ptr() as *mut u128, dst.len())
-        };
-        Self::read_u128_into(src, dst);
-    }
-
-    /// Reads IEEE754 single-precision (4 bytes) floating point numbers from
-    /// `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `src.len() != 4*dst.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `f32` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 16];
-    /// let numbers_given = [1.0, 2.0, 31.312e31, -11.32e19];
-    /// LittleEndian::write_f32_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0.0; 4];
-    /// LittleEndian::read_f32_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    #[inline]
-    fn read_f32_into(src: &[u8], dst: &mut [f32]) {
-        let dst = unsafe {
-            slice::from_raw_parts_mut(dst.as_mut_ptr() as *mut u32, dst.len())
-        };
-        Self::read_u32_into(src, dst);
-    }
-
-    /// **DEPRECATED**.
-    ///
-    /// This method is deprecated. Use `read_f32_into` instead.
-    /// Reads IEEE754 single-precision (4 bytes) floating point numbers from
-    /// `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `src.len() != 4*dst.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `f32` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 16];
-    /// let numbers_given = [1.0, 2.0, 31.312e31, -11.32e19];
-    /// LittleEndian::write_f32_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0.0; 4];
-    /// LittleEndian::read_f32_into_unchecked(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    #[inline]
-    #[deprecated(since = "1.3.0", note = "please use `read_f32_into` instead")]
-    fn read_f32_into_unchecked(src: &[u8], dst: &mut [f32]) {
-        Self::read_f32_into(src, dst);
-    }
-
-    /// Reads IEEE754 single-precision (4 bytes) floating point numbers from
-    /// `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `src.len() != 8*dst.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `f64` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 32];
-    /// let numbers_given = [1.0, 2.0, 31.312e211, -11.32e91];
-    /// LittleEndian::write_f64_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0.0; 4];
-    /// LittleEndian::read_f64_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    #[inline]
-    fn read_f64_into(src: &[u8], dst: &mut [f64]) {
-        let dst = unsafe {
-            slice::from_raw_parts_mut(dst.as_mut_ptr() as *mut u64, dst.len())
-        };
-        Self::read_u64_into(src, dst);
-    }
-
-    /// **DEPRECATED**.
-    ///
-    /// This method is deprecated. Use `read_f64_into` instead.
-    ///
-    /// Reads IEEE754 single-precision (4 bytes) floating point numbers from
-    /// `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `src.len() != 8*dst.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `f64` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 32];
-    /// let numbers_given = [1.0, 2.0, 31.312e211, -11.32e91];
-    /// LittleEndian::write_f64_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0.0; 4];
-    /// LittleEndian::read_f64_into_unchecked(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    #[inline]
-    #[deprecated(since = "1.3.0", note = "please use `read_f64_into` instead")]
-    fn read_f64_into_unchecked(src: &[u8], dst: &mut [f64]) {
-        Self::read_f64_into(src, dst);
-    }
-
-    /// Writes unsigned 16 bit integers from `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `dst.len() != 2*src.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `u16` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 8];
-    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
-    /// LittleEndian::write_u16_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0; 4];
-    /// LittleEndian::read_u16_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    fn write_u16_into(src: &[u16], dst: &mut [u8]);
-
-    /// Writes unsigned 32 bit integers from `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `dst.len() != 4*src.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `u32` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 16];
-    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
-    /// LittleEndian::write_u32_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0; 4];
-    /// LittleEndian::read_u32_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    fn write_u32_into(src: &[u32], dst: &mut [u8]);
-
-    /// Writes unsigned 64 bit integers from `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `dst.len() != 8*src.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `u64` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 32];
-    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
-    /// LittleEndian::write_u64_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0; 4];
-    /// LittleEndian::read_u64_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    fn write_u64_into(src: &[u64], dst: &mut [u8]);
-
-    /// Writes unsigned 128 bit integers from `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `dst.len() != 16*src.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `u128` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 64];
-    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
-    /// LittleEndian::write_u128_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0; 4];
-    /// LittleEndian::read_u128_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    fn write_u128_into(src: &[u128], dst: &mut [u8]);
-
-    /// Writes signed 8 bit integers from `src` into `dst`.
-    ///
-    /// Note that since each `i8` is a single byte, no byte order conversions
-    /// are used. This method is included because it provides a safe, simple
-    /// way for the caller to write from a `&[i8]` buffer. (Without this
-    /// method, the caller would have to either use `unsafe` code or convert
-    /// each byte to `u8` individually.)
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() != src.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `i8` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian, ReadBytesExt};
-    ///
-    /// let mut bytes = [0; 4];
-    /// let numbers_given = [1, 2, 0xf, 0xe];
-    /// LittleEndian::write_i8_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0; 4];
-    /// bytes.as_ref().read_i8_into(&mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    fn write_i8_into(src: &[i8], dst: &mut [u8]) {
-        let src = unsafe {
-            slice::from_raw_parts(src.as_ptr() as *const u8, src.len())
-        };
-        dst.copy_from_slice(src);
-    }
-
-    /// Writes signed 16 bit integers from `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `buf.len() != 2*src.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `i16` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 8];
-    /// let numbers_given = [1, 2, 0x0f, 0xee];
-    /// LittleEndian::write_i16_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0; 4];
-    /// LittleEndian::read_i16_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    fn write_i16_into(src: &[i16], dst: &mut [u8]) {
-        let src = unsafe {
-            slice::from_raw_parts(src.as_ptr() as *const u16, src.len())
-        };
-        Self::write_u16_into(src, dst);
-    }
-
-    /// Writes signed 32 bit integers from `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `dst.len() != 4*src.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `i32` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 16];
-    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
-    /// LittleEndian::write_i32_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0; 4];
-    /// LittleEndian::read_i32_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    fn write_i32_into(src: &[i32], dst: &mut [u8]) {
-        let src = unsafe {
-            slice::from_raw_parts(src.as_ptr() as *const u32, src.len())
-        };
-        Self::write_u32_into(src, dst);
-    }
-
-    /// Writes signed 64 bit integers from `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `dst.len() != 8*src.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `i64` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 32];
-    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
-    /// LittleEndian::write_i64_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0; 4];
-    /// LittleEndian::read_i64_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    fn write_i64_into(src: &[i64], dst: &mut [u8]) {
-        let src = unsafe {
-            slice::from_raw_parts(src.as_ptr() as *const u64, src.len())
-        };
-        Self::write_u64_into(src, dst);
-    }
-
-    /// Writes signed 128 bit integers from `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `dst.len() != 16*src.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `i128` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 64];
-    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
-    /// LittleEndian::write_i128_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0; 4];
-    /// LittleEndian::read_i128_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    fn write_i128_into(src: &[i128], dst: &mut [u8]) {
-        let src = unsafe {
-            slice::from_raw_parts(src.as_ptr() as *const u128, src.len())
-        };
-        Self::write_u128_into(src, dst);
-    }
-
-    /// Writes IEEE754 single-precision (4 bytes) floating point numbers from
-    /// `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `src.len() != 4*dst.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `f32` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 16];
-    /// let numbers_given = [1.0, 2.0, 31.312e31, -11.32e19];
-    /// LittleEndian::write_f32_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0.0; 4];
-    /// LittleEndian::read_f32_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    fn write_f32_into(src: &[f32], dst: &mut [u8]) {
-        let src = unsafe {
-            slice::from_raw_parts(src.as_ptr() as *const u32, src.len())
-        };
-        Self::write_u32_into(src, dst);
-    }
-
-    /// Writes IEEE754 double-precision (8 bytes) floating point numbers from
-    /// `src` into `dst`.
-    ///
-    /// # Panics
-    ///
-    /// Panics when `src.len() != 8*dst.len()`.
-    ///
-    /// # Examples
-    ///
-    /// Write and read `f64` numbers in little endian order:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, LittleEndian};
-    ///
-    /// let mut bytes = [0; 32];
-    /// let numbers_given = [1.0, 2.0, 31.312e211, -11.32e91];
-    /// LittleEndian::write_f64_into(&numbers_given, &mut bytes);
-    ///
-    /// let mut numbers_got = [0.0; 4];
-    /// LittleEndian::read_f64_into(&bytes, &mut numbers_got);
-    /// assert_eq!(numbers_given, numbers_got);
-    /// ```
-    fn write_f64_into(src: &[f64], dst: &mut [u8]) {
-        let src = unsafe {
-            slice::from_raw_parts(src.as_ptr() as *const u64, src.len())
-        };
-        Self::write_u64_into(src, dst);
-    }
-
-    /// Converts the given slice of unsigned 16 bit integers to a particular
-    /// endianness.
-    ///
-    /// If the endianness matches the endianness of the host platform, then
-    /// this is a no-op.
-    ///
-    /// # Examples
-    ///
-    /// Convert the host platform's endianness to big-endian:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, BigEndian};
-    ///
-    /// let mut numbers = [5, 65000];
-    /// BigEndian::from_slice_u16(&mut numbers);
-    /// assert_eq!(numbers, [5u16.to_be(), 65000u16.to_be()]);
-    /// ```
-    fn from_slice_u16(numbers: &mut [u16]);
-
-    /// Converts the given slice of unsigned 32 bit integers to a particular
-    /// endianness.
-    ///
-    /// If the endianness matches the endianness of the host platform, then
-    /// this is a no-op.
-    ///
-    /// # Examples
-    ///
-    /// Convert the host platform's endianness to big-endian:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, BigEndian};
-    ///
-    /// let mut numbers = [5, 65000];
-    /// BigEndian::from_slice_u32(&mut numbers);
-    /// assert_eq!(numbers, [5u32.to_be(), 65000u32.to_be()]);
-    /// ```
-    fn from_slice_u32(numbers: &mut [u32]);
-
-    /// Converts the given slice of unsigned 64 bit integers to a particular
-    /// endianness.
-    ///
-    /// If the endianness matches the endianness of the host platform, then
-    /// this is a no-op.
-    ///
-    /// # Examples
-    ///
-    /// Convert the host platform's endianness to big-endian:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, BigEndian};
-    ///
-    /// let mut numbers = [5, 65000];
-    /// BigEndian::from_slice_u64(&mut numbers);
-    /// assert_eq!(numbers, [5u64.to_be(), 65000u64.to_be()]);
-    /// ```
-    fn from_slice_u64(numbers: &mut [u64]);
-
-    /// Converts the given slice of unsigned 128 bit integers to a particular
-    /// endianness.
-    ///
-    /// If the endianness matches the endianness of the host platform, then
-    /// this is a no-op.
-    ///
-    /// # Examples
-    ///
-    /// Convert the host platform's endianness to big-endian:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, BigEndian};
-    ///
-    /// let mut numbers = [5, 65000];
-    /// BigEndian::from_slice_u128(&mut numbers);
-    /// assert_eq!(numbers, [5u128.to_be(), 65000u128.to_be()]);
-    /// ```
-    fn from_slice_u128(numbers: &mut [u128]);
-
-    /// Converts the given slice of signed 16 bit integers to a particular
-    /// endianness.
-    ///
-    /// If the endianness matches the endianness of the host platform, then
-    /// this is a no-op.
-    ///
-    /// # Examples
-    ///
-    /// Convert the host platform's endianness to big-endian:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, BigEndian};
-    ///
-    /// let mut numbers = [5, 6500];
-    /// BigEndian::from_slice_i16(&mut numbers);
-    /// assert_eq!(numbers, [5i16.to_be(), 6500i16.to_be()]);
-    /// ```
-    #[inline]
-    fn from_slice_i16(src: &mut [i16]) {
-        let src = unsafe {
-            slice::from_raw_parts_mut(src.as_mut_ptr() as *mut u16, src.len())
-        };
-        Self::from_slice_u16(src);
-    }
-
-    /// Converts the given slice of signed 32 bit integers to a particular
-    /// endianness.
-    ///
-    /// If the endianness matches the endianness of the host platform, then
-    /// this is a no-op.
-    ///
-    /// # Examples
-    ///
-    /// Convert the host platform's endianness to big-endian:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, BigEndian};
-    ///
-    /// let mut numbers = [5, 65000];
-    /// BigEndian::from_slice_i32(&mut numbers);
-    /// assert_eq!(numbers, [5i32.to_be(), 65000i32.to_be()]);
-    /// ```
-    #[inline]
-    fn from_slice_i32(src: &mut [i32]) {
-        let src = unsafe {
-            slice::from_raw_parts_mut(src.as_mut_ptr() as *mut u32, src.len())
-        };
-        Self::from_slice_u32(src);
-    }
-
-    /// Converts the given slice of signed 64 bit integers to a particular
-    /// endianness.
-    ///
-    /// If the endianness matches the endianness of the host platform, then
-    /// this is a no-op.
-    ///
-    /// # Examples
-    ///
-    /// Convert the host platform's endianness to big-endian:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, BigEndian};
-    ///
-    /// let mut numbers = [5, 65000];
-    /// BigEndian::from_slice_i64(&mut numbers);
-    /// assert_eq!(numbers, [5i64.to_be(), 65000i64.to_be()]);
-    /// ```
-    #[inline]
-    fn from_slice_i64(src: &mut [i64]) {
-        let src = unsafe {
-            slice::from_raw_parts_mut(src.as_mut_ptr() as *mut u64, src.len())
-        };
-        Self::from_slice_u64(src);
-    }
-
-    /// Converts the given slice of signed 128 bit integers to a particular
-    /// endianness.
-    ///
-    /// If the endianness matches the endianness of the host platform, then
-    /// this is a no-op.
-    ///
-    /// # Examples
-    ///
-    /// Convert the host platform's endianness to big-endian:
-    ///
-    /// ```rust
-    /// use byteorder::{ByteOrder, BigEndian};
-    ///
-    /// let mut numbers = [5, 65000];
-    /// BigEndian::from_slice_i128(&mut numbers);
-    /// assert_eq!(numbers, [5i128.to_be(), 65000i128.to_be()]);
-    /// ```
-    #[inline]
-    fn from_slice_i128(src: &mut [i128]) {
-        let src = unsafe {
-            slice::from_raw_parts_mut(src.as_mut_ptr() as *mut u128, src.len())
-        };
-        Self::from_slice_u128(src);
-    }
-
-    /// Converts the given slice of IEEE754 single-precision (4 bytes) floating
-    /// point numbers to a particular endianness.
-    ///
-    /// If the endianness matches the endianness of the host platform, then
-    /// this is a no-op.
-    fn from_slice_f32(numbers: &mut [f32]);
-
-    /// Converts the given slice of IEEE754 double-precision (8 bytes) floating
-    /// point numbers to a particular endianness.
-    ///
-    /// If the endianness matches the endianness of the host platform, then
-    /// this is a no-op.
-    fn from_slice_f64(numbers: &mut [f64]);
-}
-
-/// Defines big-endian serialization.
-///
-/// Note that this type has no value constructor. It is used purely at the
-/// type level.
-///
-/// # Examples
-///
-/// Write and read `u32` numbers in big endian order:
-///
-/// ```rust
-/// use byteorder::{ByteOrder, BigEndian};
-///
-/// let mut buf = [0; 4];
-/// BigEndian::write_u32(&mut buf, 1_000_000);
-/// assert_eq!(1_000_000, BigEndian::read_u32(&buf));
-/// ```
-#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
-pub enum BigEndian {}
-
-impl Default for BigEndian {
-    fn default() -> BigEndian {
-        panic!("BigEndian default")
-    }
-}
-
-/// A type alias for [`BigEndian`].
-///
-/// [`BigEndian`]: enum.BigEndian.html
-pub type BE = BigEndian;
-
-/// Defines little-endian serialization.
-///
-/// Note that this type has no value constructor. It is used purely at the
-/// type level.
-///
-/// # Examples
-///
-/// Write and read `u32` numbers in little endian order:
-///
-/// ```rust
-/// use byteorder::{ByteOrder, LittleEndian};
-///
-/// let mut buf = [0; 4];
-/// LittleEndian::write_u32(&mut buf, 1_000_000);
-/// assert_eq!(1_000_000, LittleEndian::read_u32(&buf));
-/// ```
-#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
-pub enum LittleEndian {}
-
-impl Default for LittleEndian {
-    fn default() -> LittleEndian {
-        panic!("LittleEndian default")
-    }
-}
-
-/// A type alias for [`LittleEndian`].
-///
-/// [`LittleEndian`]: enum.LittleEndian.html
-pub type LE = LittleEndian;
-
-/// Defines network byte order serialization.
-///
-/// Network byte order is defined by [RFC 1700][1] to be big-endian, and is
-/// referred to in several protocol specifications.  This type is an alias of
-/// [`BigEndian`].
-///
-/// [1]: https://tools.ietf.org/html/rfc1700
-///
-/// Note that this type has no value constructor. It is used purely at the
-/// type level.
-///
-/// # Examples
-///
-/// Write and read `i16` numbers in big endian order:
-///
-/// ```rust
-/// use byteorder::{ByteOrder, NetworkEndian, BigEndian};
-///
-/// let mut buf = [0; 2];
-/// BigEndian::write_i16(&mut buf, -5_000);
-/// assert_eq!(-5_000, NetworkEndian::read_i16(&buf));
-/// ```
-///
-/// [`BigEndian`]: enum.BigEndian.html
-pub type NetworkEndian = BigEndian;
-
-/// Defines system native-endian serialization.
-///
-/// Note that this type has no value constructor. It is used purely at the
-/// type level.
-///
-/// On this platform, this is an alias for [`LittleEndian`].
-///
-/// [`LittleEndian`]: enum.LittleEndian.html
-#[cfg(target_endian = "little")]
-pub type NativeEndian = LittleEndian;
-
-/// Defines system native-endian serialization.
-///
-/// Note that this type has no value constructor. It is used purely at the
-/// type level.
-///
-/// On this platform, this is an alias for [`BigEndian`].
-///
-/// [`BigEndian`]: enum.BigEndian.html
-#[cfg(target_endian = "big")]
-pub type NativeEndian = BigEndian;
-
-/// Copies $size bytes from a number $n to a &mut [u8] $dst. $ty represents the
-/// numeric type of $n and $which must be either to_be or to_le, depending on
-/// which endianness one wants to use when writing to $dst.
-///
-/// This macro is only safe to call when $ty is a numeric type and $size ==
-/// size_of::<$ty>() and where $dst is a &mut [u8].
-macro_rules! unsafe_write_num_bytes {
-    ($ty:ty, $size:expr, $n:expr, $dst:expr, $which:ident) => {{
-        assert!($size <= $dst.len());
-        unsafe {
-            // N.B. https://github.com/rust-lang/rust/issues/22776
-            let bytes = *(&$n.$which() as *const _ as *const [u8; $size]);
-            copy_nonoverlapping((&bytes).as_ptr(), $dst.as_mut_ptr(), $size);
-        }
-    }};
-}
-
-/// Copies a &[u8] $src into a &mut [<numeric>] $dst for the endianness given
-/// by $which (must be either to_be or to_le).
-///
-/// This macro is only safe to call when $src and $dst are &[u8] and &mut [u8],
-/// respectively. The macro will panic if $src.len() != $size * $dst.len(),
-/// where $size represents the size of the integers encoded in $src.
-macro_rules! unsafe_read_slice {
-    ($src:expr, $dst:expr, $size:expr, $which:ident) => {{
-        assert_eq!($src.len(), $size * $dst.len());
-
-        unsafe {
-            copy_nonoverlapping(
-                $src.as_ptr(),
-                $dst.as_mut_ptr() as *mut u8,
-                $src.len(),
-            );
-        }
-        for v in $dst.iter_mut() {
-            *v = v.$which();
-        }
-    }};
-}
-
-/// Copies a &[$ty] $src into a &mut [u8] $dst, where $ty must be a numeric
-/// type. This panics if size_of::<$ty>() * $src.len() != $dst.len().
-///
-/// This macro is only safe to call when $src is a slice of numeric types and
-/// $dst is a &mut [u8] and where $ty represents the type of the integers in
-/// $src.
-macro_rules! unsafe_write_slice_native {
-    ($src:expr, $dst:expr, $ty:ty) => {{
-        let size = core::mem::size_of::<$ty>();
-        assert_eq!(size * $src.len(), $dst.len());
-
-        unsafe {
-            copy_nonoverlapping(
-                $src.as_ptr() as *const u8,
-                $dst.as_mut_ptr(),
-                $dst.len(),
-            );
-        }
-    }};
-}
-
-macro_rules! write_slice {
-    ($src:expr, $dst:expr, $ty:ty, $size:expr, $write:expr) => {{
-        assert!($size == ::core::mem::size_of::<$ty>());
-        assert_eq!($size * $src.len(), $dst.len());
-
-        for (&n, chunk) in $src.iter().zip($dst.chunks_mut($size)) {
-            $write(chunk, n);
-        }
-    }};
-}
-
-impl ByteOrder for BigEndian {
-    #[inline]
-    fn read_u16(buf: &[u8]) -> u16 {
-        u16::from_be_bytes(buf[..2].try_into().unwrap())
-    }
-
-    #[inline]
-    fn read_u32(buf: &[u8]) -> u32 {
-        u32::from_be_bytes(buf[..4].try_into().unwrap())
-    }
-
-    #[inline]
-    fn read_u64(buf: &[u8]) -> u64 {
-        u64::from_be_bytes(buf[..8].try_into().unwrap())
-    }
-
-    #[inline]
-    fn read_u128(buf: &[u8]) -> u128 {
-        u128::from_be_bytes(buf[..16].try_into().unwrap())
-    }
-
-    #[inline]
-    fn read_uint(buf: &[u8], nbytes: usize) -> u64 {
-        assert!(1 <= nbytes && nbytes <= 8 && nbytes <= buf.len());
-        let mut out = 0u64;
-        let ptr_out = &mut out as *mut u64 as *mut u8;
-        unsafe {
-            copy_nonoverlapping(
-                buf.as_ptr(),
-                ptr_out.offset((8 - nbytes) as isize),
-                nbytes,
-            );
-        }
-        out.to_be()
-    }
-
-    #[inline]
-    fn read_uint128(buf: &[u8], nbytes: usize) -> u128 {
-        assert!(1 <= nbytes && nbytes <= 16 && nbytes <= buf.len());
-        let mut out: u128 = 0;
-        let ptr_out = &mut out as *mut u128 as *mut u8;
-        unsafe {
-            copy_nonoverlapping(
-                buf.as_ptr(),
-                ptr_out.offset((16 - nbytes) as isize),
-                nbytes,
-            );
-        }
-        out.to_be()
-    }
-
-    #[inline]
-    fn write_u16(buf: &mut [u8], n: u16) {
-        unsafe_write_num_bytes!(u16, 2, n, buf, to_be);
-    }
-
-    #[inline]
-    fn write_u32(buf: &mut [u8], n: u32) {
-        unsafe_write_num_bytes!(u32, 4, n, buf, to_be);
-    }
-
-    #[inline]
-    fn write_u64(buf: &mut [u8], n: u64) {
-        unsafe_write_num_bytes!(u64, 8, n, buf, to_be);
-    }
-
-    #[inline]
-    fn write_u128(buf: &mut [u8], n: u128) {
-        unsafe_write_num_bytes!(u128, 16, n, buf, to_be);
-    }
-
-    #[inline]
-    fn write_uint(buf: &mut [u8], n: u64, nbytes: usize) {
-        assert!(pack_size(n) <= nbytes && nbytes <= 8);
-        assert!(nbytes <= buf.len());
-        unsafe {
-            let bytes = *(&n.to_be() as *const u64 as *const [u8; 8]);
-            copy_nonoverlapping(
-                bytes.as_ptr().offset((8 - nbytes) as isize),
-                buf.as_mut_ptr(),
-                nbytes,
-            );
-        }
-    }
-
-    #[inline]
-    fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize) {
-        assert!(pack_size128(n) <= nbytes && nbytes <= 16);
-        assert!(nbytes <= buf.len());
-        unsafe {
-            let bytes = *(&n.to_be() as *const u128 as *const [u8; 16]);
-            copy_nonoverlapping(
-                bytes.as_ptr().offset((16 - nbytes) as isize),
-                buf.as_mut_ptr(),
-                nbytes,
-            );
-        }
-    }
-
-    #[inline]
-    fn read_u16_into(src: &[u8], dst: &mut [u16]) {
-        unsafe_read_slice!(src, dst, 2, to_be);
-    }
-
-    #[inline]
-    fn read_u32_into(src: &[u8], dst: &mut [u32]) {
-        unsafe_read_slice!(src, dst, 4, to_be);
-    }
-
-    #[inline]
-    fn read_u64_into(src: &[u8], dst: &mut [u64]) {
-        unsafe_read_slice!(src, dst, 8, to_be);
-    }
-
-    #[inline]
-    fn read_u128_into(src: &[u8], dst: &mut [u128]) {
-        unsafe_read_slice!(src, dst, 16, to_be);
-    }
-
-    #[inline]
-    fn write_u16_into(src: &[u16], dst: &mut [u8]) {
-        if cfg!(target_endian = "big") {
-            unsafe_write_slice_native!(src, dst, u16);
-        } else {
-            write_slice!(src, dst, u16, 2, Self::write_u16);
-        }
-    }
-
-    #[inline]
-    fn write_u32_into(src: &[u32], dst: &mut [u8]) {
-        if cfg!(target_endian = "big") {
-            unsafe_write_slice_native!(src, dst, u32);
-        } else {
-            write_slice!(src, dst, u32, 4, Self::write_u32);
-        }
-    }
-
-    #[inline]
-    fn write_u64_into(src: &[u64], dst: &mut [u8]) {
-        if cfg!(target_endian = "big") {
-            unsafe_write_slice_native!(src, dst, u64);
-        } else {
-            write_slice!(src, dst, u64, 8, Self::write_u64);
-        }
-    }
-
-    #[inline]
-    fn write_u128_into(src: &[u128], dst: &mut [u8]) {
-        if cfg!(target_endian = "big") {
-            unsafe_write_slice_native!(src, dst, u128);
-        } else {
-            write_slice!(src, dst, u128, 16, Self::write_u128);
-        }
-    }
-
-    #[inline]
-    fn from_slice_u16(numbers: &mut [u16]) {
-        if cfg!(target_endian = "little") {
-            for n in numbers {
-                *n = n.to_be();
-            }
-        }
-    }
-
-    #[inline]
-    fn from_slice_u32(numbers: &mut [u32]) {
-        if cfg!(target_endian = "little") {
-            for n in numbers {
-                *n = n.to_be();
-            }
-        }
-    }
-
-    #[inline]
-    fn from_slice_u64(numbers: &mut [u64]) {
-        if cfg!(target_endian = "little") {
-            for n in numbers {
-                *n = n.to_be();
-            }
-        }
-    }
-
-    #[inline]
-    fn from_slice_u128(numbers: &mut [u128]) {
-        if cfg!(target_endian = "little") {
-            for n in numbers {
-                *n = n.to_be();
-            }
-        }
-    }
-
-    #[inline]
-    fn from_slice_f32(numbers: &mut [f32]) {
-        if cfg!(target_endian = "little") {
-            for n in numbers {
-                unsafe {
-                    let int = *(n as *const f32 as *const u32);
-                    *n = *(&int.to_be() as *const u32 as *const f32);
-                }
-            }
-        }
-    }
-
-    #[inline]
-    fn from_slice_f64(numbers: &mut [f64]) {
-        if cfg!(target_endian = "little") {
-            for n in numbers {
-                unsafe {
-                    let int = *(n as *const f64 as *const u64);
-                    *n = *(&int.to_be() as *const u64 as *const f64);
-                }
-            }
-        }
-    }
-}
-
-impl ByteOrder for LittleEndian {
-    #[inline]
-    fn read_u16(buf: &[u8]) -> u16 {
-        u16::from_le_bytes(buf[..2].try_into().unwrap())
-    }
-
-    #[inline]
-    fn read_u32(buf: &[u8]) -> u32 {
-        u32::from_le_bytes(buf[..4].try_into().unwrap())
-    }
-
-    #[inline]
-    fn read_u64(buf: &[u8]) -> u64 {
-        u64::from_le_bytes(buf[..8].try_into().unwrap())
-    }
-
-    #[inline]
-    fn read_u128(buf: &[u8]) -> u128 {
-        u128::from_le_bytes(buf[..16].try_into().unwrap())
-    }
-
-    #[inline]
-    fn read_uint(buf: &[u8], nbytes: usize) -> u64 {
-        assert!(1 <= nbytes && nbytes <= 8 && nbytes <= buf.len());
-        let mut out = 0u64;
-        let ptr_out = &mut out as *mut u64 as *mut u8;
-        unsafe {
-            copy_nonoverlapping(buf.as_ptr(), ptr_out, nbytes);
-        }
-        out.to_le()
-    }
-
-    #[inline]
-    fn read_uint128(buf: &[u8], nbytes: usize) -> u128 {
-        assert!(1 <= nbytes && nbytes <= 16 && nbytes <= buf.len());
-        let mut out: u128 = 0;
-        let ptr_out = &mut out as *mut u128 as *mut u8;
-        unsafe {
-            copy_nonoverlapping(buf.as_ptr(), ptr_out, nbytes);
-        }
-        out.to_le()
-    }
-
-    #[inline]
-    fn write_u16(buf: &mut [u8], n: u16) {
-        unsafe_write_num_bytes!(u16, 2, n, buf, to_le);
-    }
-
-    #[inline]
-    fn write_u32(buf: &mut [u8], n: u32) {
-        unsafe_write_num_bytes!(u32, 4, n, buf, to_le);
-    }
-
-    #[inline]
-    fn write_u64(buf: &mut [u8], n: u64) {
-        unsafe_write_num_bytes!(u64, 8, n, buf, to_le);
-    }
-
-    #[inline]
-    fn write_u128(buf: &mut [u8], n: u128) {
-        unsafe_write_num_bytes!(u128, 16, n, buf, to_le);
-    }
-
-    #[inline]
-    fn write_uint(buf: &mut [u8], n: u64, nbytes: usize) {
-        assert!(pack_size(n as u64) <= nbytes && nbytes <= 8);
-        assert!(nbytes <= buf.len());
-        unsafe {
-            let bytes = *(&n.to_le() as *const u64 as *const [u8; 8]);
-            copy_nonoverlapping(bytes.as_ptr(), buf.as_mut_ptr(), nbytes);
-        }
-    }
-
-    #[inline]
-    fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize) {
-        assert!(pack_size128(n as u128) <= nbytes && nbytes <= 16);
-        assert!(nbytes <= buf.len());
-        unsafe {
-            let bytes = *(&n.to_le() as *const u128 as *const [u8; 16]);
-            copy_nonoverlapping(bytes.as_ptr(), buf.as_mut_ptr(), nbytes);
-        }
-    }
-
-    #[inline]
-    fn read_u16_into(src: &[u8], dst: &mut [u16]) {
-        unsafe_read_slice!(src, dst, 2, to_le);
-    }
-
-    #[inline]
-    fn read_u32_into(src: &[u8], dst: &mut [u32]) {
-        unsafe_read_slice!(src, dst, 4, to_le);
-    }
-
-    #[inline]
-    fn read_u64_into(src: &[u8], dst: &mut [u64]) {
-        unsafe_read_slice!(src, dst, 8, to_le);
-    }
-
-    #[inline]
-    fn read_u128_into(src: &[u8], dst: &mut [u128]) {
-        unsafe_read_slice!(src, dst, 16, to_le);
-    }
-
-    #[inline]
-    fn write_u16_into(src: &[u16], dst: &mut [u8]) {
-        if cfg!(target_endian = "little") {
-            unsafe_write_slice_native!(src, dst, u16);
-        } else {
-            write_slice!(src, dst, u16, 2, Self::write_u16);
-        }
-    }
-
-    #[inline]
-    fn write_u32_into(src: &[u32], dst: &mut [u8]) {
-        if cfg!(target_endian = "little") {
-            unsafe_write_slice_native!(src, dst, u32);
-        } else {
-            write_slice!(src, dst, u32, 4, Self::write_u32);
-        }
-    }
-
-    #[inline]
-    fn write_u64_into(src: &[u64], dst: &mut [u8]) {
-        if cfg!(target_endian = "little") {
-            unsafe_write_slice_native!(src, dst, u64);
-        } else {
-            write_slice!(src, dst, u64, 8, Self::write_u64);
-        }
-    }
-
-    #[inline]
-    fn write_u128_into(src: &[u128], dst: &mut [u8]) {
-        if cfg!(target_endian = "little") {
-            unsafe_write_slice_native!(src, dst, u128);
-        } else {
-            write_slice!(src, dst, u128, 16, Self::write_u128);
-        }
-    }
-
-    #[inline]
-    fn from_slice_u16(numbers: &mut [u16]) {
-        if cfg!(target_endian = "big") {
-            for n in numbers {
-                *n = n.to_le();
-            }
-        }
-    }
-
-    #[inline]
-    fn from_slice_u32(numbers: &mut [u32]) {
-        if cfg!(target_endian = "big") {
-            for n in numbers {
-                *n = n.to_le();
-            }
-        }
-    }
-
-    #[inline]
-    fn from_slice_u64(numbers: &mut [u64]) {
-        if cfg!(target_endian = "big") {
-            for n in numbers {
-                *n = n.to_le();
-            }
-        }
-    }
-
-    #[inline]
-    fn from_slice_u128(numbers: &mut [u128]) {
-        if cfg!(target_endian = "big") {
-            for n in numbers {
-                *n = n.to_le();
-            }
-        }
-    }
-
-    #[inline]
-    fn from_slice_f32(numbers: &mut [f32]) {
-        if cfg!(target_endian = "big") {
-            for n in numbers {
-                unsafe {
-                    let int = *(n as *const f32 as *const u32);
-                    *n = *(&int.to_le() as *const u32 as *const f32);
-                }
-            }
-        }
-    }
-
-    #[inline]
-    fn from_slice_f64(numbers: &mut [f64]) {
-        if cfg!(target_endian = "big") {
-            for n in numbers {
-                unsafe {
-                    let int = *(n as *const f64 as *const u64);
-                    *n = *(&int.to_le() as *const u64 as *const f64);
-                }
-            }
-        }
-    }
-}
-
-#[cfg(test)]
-mod test {
-    use quickcheck::{Arbitrary, Gen, QuickCheck, StdGen, Testable};
-    use rand::{thread_rng, Rng};
-
-    pub const U24_MAX: u32 = 16_777_215;
-    pub const I24_MAX: i32 = 8_388_607;
-    pub const U48_MAX: u64 = 281_474_976_710_655;
-    pub const I48_MAX: i64 = 140_737_488_355_327;
-
-    pub const U64_MAX: u64 = ::core::u64::MAX;
-    pub const I64_MAX: u64 = ::core::i64::MAX as u64;
-
-    macro_rules! calc_max {
-        ($max:expr, $bytes:expr) => {
-            calc_max!($max, $bytes, 8)
-        };
-        ($max:expr, $bytes:expr, $maxbytes:expr) => {
-            ($max - 1) >> (8 * ($maxbytes - $bytes))
-        };
-    }
-
-    #[derive(Clone, Debug)]
-    pub struct Wi128<T>(pub T);
-
-    impl<T: Clone> Wi128<T> {
-        pub fn clone(&self) -> T {
-            self.0.clone()
-        }
-    }
-
-    impl<T: PartialEq> PartialEq<T> for Wi128<T> {
-        fn eq(&self, other: &T) -> bool {
-            self.0.eq(other)
-        }
-    }
-
-    impl Arbitrary for Wi128<u128> {
-        fn arbitrary<G: Gen>(gen: &mut G) -> Wi128<u128> {
-            let max = calc_max!(::core::u128::MAX, gen.size(), 16);
-            let output = (gen.gen::<u64>() as u128)
-                | ((gen.gen::<u64>() as u128) << 64);
-            Wi128(output & (max - 1))
-        }
-    }
-
-    impl Arbitrary for Wi128<i128> {
-        fn arbitrary<G: Gen>(gen: &mut G) -> Wi128<i128> {
-            let max = calc_max!(::core::i128::MAX, gen.size(), 16);
-            let output = (gen.gen::<i64>() as i128)
-                | ((gen.gen::<i64>() as i128) << 64);
-            Wi128(output & (max - 1))
-        }
-    }
-
-    pub fn qc_sized<A: Testable>(f: A, size: u64) {
-        QuickCheck::new()
-            .gen(StdGen::new(thread_rng(), size as usize))
-            .tests(1_00)
-            .max_tests(10_000)
-            .quickcheck(f);
-    }
-
-    macro_rules! qc_byte_order {
-        ($name:ident, $ty_int:ty, $max:expr,
-         $bytes:expr, $read:ident, $write:ident) => {
-            mod $name {
-                #[allow(unused_imports)]
-                use super::{qc_sized, Wi128};
-                use crate::{
-                    BigEndian, ByteOrder, LittleEndian, NativeEndian,
-                };
-
-                #[test]
-                fn big_endian() {
-                    fn prop(n: $ty_int) -> bool {
-                        let mut buf = [0; 16];
-                        BigEndian::$write(&mut buf, n.clone(), $bytes);
-                        n == BigEndian::$read(&buf[..$bytes], $bytes)
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, $max);
-                }
-
-                #[test]
-                fn little_endian() {
-                    fn prop(n: $ty_int) -> bool {
-                        let mut buf = [0; 16];
-                        LittleEndian::$write(&mut buf, n.clone(), $bytes);
-                        n == LittleEndian::$read(&buf[..$bytes], $bytes)
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, $max);
-                }
-
-                #[test]
-                fn native_endian() {
-                    fn prop(n: $ty_int) -> bool {
-                        let mut buf = [0; 16];
-                        NativeEndian::$write(&mut buf, n.clone(), $bytes);
-                        n == NativeEndian::$read(&buf[..$bytes], $bytes)
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, $max);
-                }
-            }
-        };
-        ($name:ident, $ty_int:ty, $max:expr,
-         $read:ident, $write:ident) => {
-            mod $name {
-                #[allow(unused_imports)]
-                use super::{qc_sized, Wi128};
-                use crate::{
-                    BigEndian, ByteOrder, LittleEndian, NativeEndian,
-                };
-                use core::mem::size_of;
-
-                #[test]
-                fn big_endian() {
-                    fn prop(n: $ty_int) -> bool {
-                        let bytes = size_of::<$ty_int>();
-                        let mut buf = [0; 16];
-                        BigEndian::$write(&mut buf[16 - bytes..], n.clone());
-                        n == BigEndian::$read(&buf[16 - bytes..])
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
-                }
-
-                #[test]
-                fn little_endian() {
-                    fn prop(n: $ty_int) -> bool {
-                        let bytes = size_of::<$ty_int>();
-                        let mut buf = [0; 16];
-                        LittleEndian::$write(&mut buf[..bytes], n.clone());
-                        n == LittleEndian::$read(&buf[..bytes])
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
-                }
-
-                #[test]
-                fn native_endian() {
-                    fn prop(n: $ty_int) -> bool {
-                        let bytes = size_of::<$ty_int>();
-                        let mut buf = [0; 16];
-                        NativeEndian::$write(&mut buf[..bytes], n.clone());
-                        n == NativeEndian::$read(&buf[..bytes])
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
-                }
-            }
-        };
-    }
-
-    qc_byte_order!(
-        prop_u16,
-        u16,
-        ::core::u16::MAX as u64,
-        read_u16,
-        write_u16
-    );
-    qc_byte_order!(
-        prop_i16,
-        i16,
-        ::core::i16::MAX as u64,
-        read_i16,
-        write_i16
-    );
-    qc_byte_order!(
-        prop_u24,
-        u32,
-        crate::test::U24_MAX as u64,
-        read_u24,
-        write_u24
-    );
-    qc_byte_order!(
-        prop_i24,
-        i32,
-        crate::test::I24_MAX as u64,
-        read_i24,
-        write_i24
-    );
-    qc_byte_order!(
-        prop_u32,
-        u32,
-        ::core::u32::MAX as u64,
-        read_u32,
-        write_u32
-    );
-    qc_byte_order!(
-        prop_i32,
-        i32,
-        ::core::i32::MAX as u64,
-        read_i32,
-        write_i32
-    );
-    qc_byte_order!(
-        prop_u48,
-        u64,
-        crate::test::U48_MAX as u64,
-        read_u48,
-        write_u48
-    );
-    qc_byte_order!(
-        prop_i48,
-        i64,
-        crate::test::I48_MAX as u64,
-        read_i48,
-        write_i48
-    );
-    qc_byte_order!(
-        prop_u64,
-        u64,
-        ::core::u64::MAX as u64,
-        read_u64,
-        write_u64
-    );
-    qc_byte_order!(
-        prop_i64,
-        i64,
-        ::core::i64::MAX as u64,
-        read_i64,
-        write_i64
-    );
-    qc_byte_order!(
-        prop_f32,
-        f32,
-        ::core::u64::MAX as u64,
-        read_f32,
-        write_f32
-    );
-    qc_byte_order!(
-        prop_f64,
-        f64,
-        ::core::i64::MAX as u64,
-        read_f64,
-        write_f64
-    );
-
-    qc_byte_order!(prop_u128, Wi128<u128>, 16 + 1, read_u128, write_u128);
-    qc_byte_order!(prop_i128, Wi128<i128>, 16 + 1, read_i128, write_i128);
-
-    qc_byte_order!(
-        prop_uint_1,
-        u64,
-        calc_max!(super::U64_MAX, 1),
-        1,
-        read_uint,
-        write_uint
-    );
-    qc_byte_order!(
-        prop_uint_2,
-        u64,
-        calc_max!(super::U64_MAX, 2),
-        2,
-        read_uint,
-        write_uint
-    );
-    qc_byte_order!(
-        prop_uint_3,
-        u64,
-        calc_max!(super::U64_MAX, 3),
-        3,
-        read_uint,
-        write_uint
-    );
-    qc_byte_order!(
-        prop_uint_4,
-        u64,
-        calc_max!(super::U64_MAX, 4),
-        4,
-        read_uint,
-        write_uint
-    );
-    qc_byte_order!(
-        prop_uint_5,
-        u64,
-        calc_max!(super::U64_MAX, 5),
-        5,
-        read_uint,
-        write_uint
-    );
-    qc_byte_order!(
-        prop_uint_6,
-        u64,
-        calc_max!(super::U64_MAX, 6),
-        6,
-        read_uint,
-        write_uint
-    );
-    qc_byte_order!(
-        prop_uint_7,
-        u64,
-        calc_max!(super::U64_MAX, 7),
-        7,
-        read_uint,
-        write_uint
-    );
-    qc_byte_order!(
-        prop_uint_8,
-        u64,
-        calc_max!(super::U64_MAX, 8),
-        8,
-        read_uint,
-        write_uint
-    );
-
-    qc_byte_order!(
-        prop_uint128_1,
-        Wi128<u128>,
-        1,
-        1,
-        read_uint128,
-        write_uint128
-    );
-    qc_byte_order!(
-        prop_uint128_2,
-        Wi128<u128>,
-        2,
-        2,
-        read_uint128,
-        write_uint128
-    );
-    qc_byte_order!(
-        prop_uint128_3,
-        Wi128<u128>,
-        3,
-        3,
-        read_uint128,
-        write_uint128
-    );
-    qc_byte_order!(
-        prop_uint128_4,
-        Wi128<u128>,
-        4,
-        4,
-        read_uint128,
-        write_uint128
-    );
-    qc_byte_order!(
-        prop_uint128_5,
-        Wi128<u128>,
-        5,
-        5,
-        read_uint128,
-        write_uint128
-    );
-    qc_byte_order!(
-        prop_uint128_6,
-        Wi128<u128>,
-        6,
-        6,
-        read_uint128,
-        write_uint128
-    );
-    qc_byte_order!(
-        prop_uint128_7,
-        Wi128<u128>,
-        7,
-        7,
-        read_uint128,
-        write_uint128
-    );
-    qc_byte_order!(
-        prop_uint128_8,
-        Wi128<u128>,
-        8,
-        8,
-        read_uint128,
-        write_uint128
-    );
-    qc_byte_order!(
-        prop_uint128_9,
-        Wi128<u128>,
-        9,
-        9,
-        read_uint128,
-        write_uint128
-    );
-    qc_byte_order!(
-        prop_uint128_10,
-        Wi128<u128>,
-        10,
-        10,
-        read_uint128,
-        write_uint128
-    );
-    qc_byte_order!(
-        prop_uint128_11,
-        Wi128<u128>,
-        11,
-        11,
-        read_uint128,
-        write_uint128
-    );
-    qc_byte_order!(
-        prop_uint128_12,
-        Wi128<u128>,
-        12,
-        12,
-        read_uint128,
-        write_uint128
-    );
-    qc_byte_order!(
-        prop_uint128_13,
-        Wi128<u128>,
-        13,
-        13,
-        read_uint128,
-        write_uint128
-    );
-    qc_byte_order!(
-        prop_uint128_14,
-        Wi128<u128>,
-        14,
-        14,
-        read_uint128,
-        write_uint128
-    );
-    qc_byte_order!(
-        prop_uint128_15,
-        Wi128<u128>,
-        15,
-        15,
-        read_uint128,
-        write_uint128
-    );
-    qc_byte_order!(
-        prop_uint128_16,
-        Wi128<u128>,
-        16,
-        16,
-        read_uint128,
-        write_uint128
-    );
-
-    qc_byte_order!(
-        prop_int_1,
-        i64,
-        calc_max!(super::I64_MAX, 1),
-        1,
-        read_int,
-        write_int
-    );
-    qc_byte_order!(
-        prop_int_2,
-        i64,
-        calc_max!(super::I64_MAX, 2),
-        2,
-        read_int,
-        write_int
-    );
-    qc_byte_order!(
-        prop_int_3,
-        i64,
-        calc_max!(super::I64_MAX, 3),
-        3,
-        read_int,
-        write_int
-    );
-    qc_byte_order!(
-        prop_int_4,
-        i64,
-        calc_max!(super::I64_MAX, 4),
-        4,
-        read_int,
-        write_int
-    );
-    qc_byte_order!(
-        prop_int_5,
-        i64,
-        calc_max!(super::I64_MAX, 5),
-        5,
-        read_int,
-        write_int
-    );
-    qc_byte_order!(
-        prop_int_6,
-        i64,
-        calc_max!(super::I64_MAX, 6),
-        6,
-        read_int,
-        write_int
-    );
-    qc_byte_order!(
-        prop_int_7,
-        i64,
-        calc_max!(super::I64_MAX, 7),
-        7,
-        read_int,
-        write_int
-    );
-    qc_byte_order!(
-        prop_int_8,
-        i64,
-        calc_max!(super::I64_MAX, 8),
-        8,
-        read_int,
-        write_int
-    );
-
-    qc_byte_order!(
-        prop_int128_1,
-        Wi128<i128>,
-        1,
-        1,
-        read_int128,
-        write_int128
-    );
-    qc_byte_order!(
-        prop_int128_2,
-        Wi128<i128>,
-        2,
-        2,
-        read_int128,
-        write_int128
-    );
-    qc_byte_order!(
-        prop_int128_3,
-        Wi128<i128>,
-        3,
-        3,
-        read_int128,
-        write_int128
-    );
-    qc_byte_order!(
-        prop_int128_4,
-        Wi128<i128>,
-        4,
-        4,
-        read_int128,
-        write_int128
-    );
-    qc_byte_order!(
-        prop_int128_5,
-        Wi128<i128>,
-        5,
-        5,
-        read_int128,
-        write_int128
-    );
-    qc_byte_order!(
-        prop_int128_6,
-        Wi128<i128>,
-        6,
-        6,
-        read_int128,
-        write_int128
-    );
-    qc_byte_order!(
-        prop_int128_7,
-        Wi128<i128>,
-        7,
-        7,
-        read_int128,
-        write_int128
-    );
-    qc_byte_order!(
-        prop_int128_8,
-        Wi128<i128>,
-        8,
-        8,
-        read_int128,
-        write_int128
-    );
-    qc_byte_order!(
-        prop_int128_9,
-        Wi128<i128>,
-        9,
-        9,
-        read_int128,
-        write_int128
-    );
-    qc_byte_order!(
-        prop_int128_10,
-        Wi128<i128>,
-        10,
-        10,
-        read_int128,
-        write_int128
-    );
-    qc_byte_order!(
-        prop_int128_11,
-        Wi128<i128>,
-        11,
-        11,
-        read_int128,
-        write_int128
-    );
-    qc_byte_order!(
-        prop_int128_12,
-        Wi128<i128>,
-        12,
-        12,
-        read_int128,
-        write_int128
-    );
-    qc_byte_order!(
-        prop_int128_13,
-        Wi128<i128>,
-        13,
-        13,
-        read_int128,
-        write_int128
-    );
-    qc_byte_order!(
-        prop_int128_14,
-        Wi128<i128>,
-        14,
-        14,
-        read_int128,
-        write_int128
-    );
-    qc_byte_order!(
-        prop_int128_15,
-        Wi128<i128>,
-        15,
-        15,
-        read_int128,
-        write_int128
-    );
-    qc_byte_order!(
-        prop_int128_16,
-        Wi128<i128>,
-        16,
-        16,
-        read_int128,
-        write_int128
-    );
-
-    // Test that all of the byte conversion functions panic when given a
-    // buffer that is too small.
-    //
-    // These tests are critical to ensure safety, otherwise we might end up
-    // with a buffer overflow.
-    macro_rules! too_small {
-        ($name:ident, $maximally_small:expr, $zero:expr,
-         $read:ident, $write:ident) => {
-            mod $name {
-                use crate::{
-                    BigEndian, ByteOrder, LittleEndian, NativeEndian,
-                };
-
-                #[test]
-                #[should_panic]
-                fn read_big_endian() {
-                    let buf = [0; $maximally_small];
-                    BigEndian::$read(&buf);
-                }
-
-                #[test]
-                #[should_panic]
-                fn read_little_endian() {
-                    let buf = [0; $maximally_small];
-                    LittleEndian::$read(&buf);
-                }
-
-                #[test]
-                #[should_panic]
-                fn read_native_endian() {
-                    let buf = [0; $maximally_small];
-                    NativeEndian::$read(&buf);
-                }
-
-                #[test]
-                #[should_panic]
-                fn write_big_endian() {
-                    let mut buf = [0; $maximally_small];
-                    BigEndian::$write(&mut buf, $zero);
-                }
-
-                #[test]
-                #[should_panic]
-                fn write_little_endian() {
-                    let mut buf = [0; $maximally_small];
-                    LittleEndian::$write(&mut buf, $zero);
-                }
-
-                #[test]
-                #[should_panic]
-                fn write_native_endian() {
-                    let mut buf = [0; $maximally_small];
-                    NativeEndian::$write(&mut buf, $zero);
-                }
-            }
-        };
-        ($name:ident, $maximally_small:expr, $read:ident) => {
-            mod $name {
-                use crate::{
-                    BigEndian, ByteOrder, LittleEndian, NativeEndian,
-                };
-
-                #[test]
-                #[should_panic]
-                fn read_big_endian() {
-                    let buf = [0; $maximally_small];
-                    BigEndian::$read(&buf, $maximally_small + 1);
-                }
-
-                #[test]
-                #[should_panic]
-                fn read_little_endian() {
-                    let buf = [0; $maximally_small];
-                    LittleEndian::$read(&buf, $maximally_small + 1);
-                }
-
-                #[test]
-                #[should_panic]
-                fn read_native_endian() {
-                    let buf = [0; $maximally_small];
-                    NativeEndian::$read(&buf, $maximally_small + 1);
-                }
-            }
-        };
-    }
-
-    too_small!(small_u16, 1, 0, read_u16, write_u16);
-    too_small!(small_i16, 1, 0, read_i16, write_i16);
-    too_small!(small_u32, 3, 0, read_u32, write_u32);
-    too_small!(small_i32, 3, 0, read_i32, write_i32);
-    too_small!(small_u64, 7, 0, read_u64, write_u64);
-    too_small!(small_i64, 7, 0, read_i64, write_i64);
-    too_small!(small_f32, 3, 0.0, read_f32, write_f32);
-    too_small!(small_f64, 7, 0.0, read_f64, write_f64);
-    too_small!(small_u128, 15, 0, read_u128, write_u128);
-    too_small!(small_i128, 15, 0, read_i128, write_i128);
-
-    too_small!(small_uint_1, 1, read_uint);
-    too_small!(small_uint_2, 2, read_uint);
-    too_small!(small_uint_3, 3, read_uint);
-    too_small!(small_uint_4, 4, read_uint);
-    too_small!(small_uint_5, 5, read_uint);
-    too_small!(small_uint_6, 6, read_uint);
-    too_small!(small_uint_7, 7, read_uint);
-
-    too_small!(small_uint128_1, 1, read_uint128);
-    too_small!(small_uint128_2, 2, read_uint128);
-    too_small!(small_uint128_3, 3, read_uint128);
-    too_small!(small_uint128_4, 4, read_uint128);
-    too_small!(small_uint128_5, 5, read_uint128);
-    too_small!(small_uint128_6, 6, read_uint128);
-    too_small!(small_uint128_7, 7, read_uint128);
-    too_small!(small_uint128_8, 8, read_uint128);
-    too_small!(small_uint128_9, 9, read_uint128);
-    too_small!(small_uint128_10, 10, read_uint128);
-    too_small!(small_uint128_11, 11, read_uint128);
-    too_small!(small_uint128_12, 12, read_uint128);
-    too_small!(small_uint128_13, 13, read_uint128);
-    too_small!(small_uint128_14, 14, read_uint128);
-    too_small!(small_uint128_15, 15, read_uint128);
-
-    too_small!(small_int_1, 1, read_int);
-    too_small!(small_int_2, 2, read_int);
-    too_small!(small_int_3, 3, read_int);
-    too_small!(small_int_4, 4, read_int);
-    too_small!(small_int_5, 5, read_int);
-    too_small!(small_int_6, 6, read_int);
-    too_small!(small_int_7, 7, read_int);
-
-    too_small!(small_int128_1, 1, read_int128);
-    too_small!(small_int128_2, 2, read_int128);
-    too_small!(small_int128_3, 3, read_int128);
-    too_small!(small_int128_4, 4, read_int128);
-    too_small!(small_int128_5, 5, read_int128);
-    too_small!(small_int128_6, 6, read_int128);
-    too_small!(small_int128_7, 7, read_int128);
-    too_small!(small_int128_8, 8, read_int128);
-    too_small!(small_int128_9, 9, read_int128);
-    too_small!(small_int128_10, 10, read_int128);
-    too_small!(small_int128_11, 11, read_int128);
-    too_small!(small_int128_12, 12, read_int128);
-    too_small!(small_int128_13, 13, read_int128);
-    too_small!(small_int128_14, 14, read_int128);
-    too_small!(small_int128_15, 15, read_int128);
-
-    // Test that reading/writing slices enforces the correct lengths.
-    macro_rules! slice_lengths {
-        ($name:ident, $read:ident, $write:ident,
-         $num_bytes:expr, $numbers:expr) => {
-            mod $name {
-                use crate::{
-                    BigEndian, ByteOrder, LittleEndian, NativeEndian,
-                };
-
-                #[test]
-                #[should_panic]
-                fn read_big_endian() {
-                    let bytes = [0; $num_bytes];
-                    let mut numbers = $numbers;
-                    BigEndian::$read(&bytes, &mut numbers);
-                }
-
-                #[test]
-                #[should_panic]
-                fn read_little_endian() {
-                    let bytes = [0; $num_bytes];
-                    let mut numbers = $numbers;
-                    LittleEndian::$read(&bytes, &mut numbers);
-                }
-
-                #[test]
-                #[should_panic]
-                fn read_native_endian() {
-                    let bytes = [0; $num_bytes];
-                    let mut numbers = $numbers;
-                    NativeEndian::$read(&bytes, &mut numbers);
-                }
-
-                #[test]
-                #[should_panic]
-                fn write_big_endian() {
-                    let mut bytes = [0; $num_bytes];
-                    let numbers = $numbers;
-                    BigEndian::$write(&numbers, &mut bytes);
-                }
-
-                #[test]
-                #[should_panic]
-                fn write_little_endian() {
-                    let mut bytes = [0; $num_bytes];
-                    let numbers = $numbers;
-                    LittleEndian::$write(&numbers, &mut bytes);
-                }
-
-                #[test]
-                #[should_panic]
-                fn write_native_endian() {
-                    let mut bytes = [0; $num_bytes];
-                    let numbers = $numbers;
-                    NativeEndian::$write(&numbers, &mut bytes);
-                }
-            }
-        };
-    }
-
-    slice_lengths!(
-        slice_len_too_small_u16,
-        read_u16_into,
-        write_u16_into,
-        3,
-        [0, 0]
-    );
-    slice_lengths!(
-        slice_len_too_big_u16,
-        read_u16_into,
-        write_u16_into,
-        5,
-        [0, 0]
-    );
-    slice_lengths!(
-        slice_len_too_small_i16,
-        read_i16_into,
-        write_i16_into,
-        3,
-        [0, 0]
-    );
-    slice_lengths!(
-        slice_len_too_big_i16,
-        read_i16_into,
-        write_i16_into,
-        5,
-        [0, 0]
-    );
-
-    slice_lengths!(
-        slice_len_too_small_u32,
-        read_u32_into,
-        write_u32_into,
-        7,
-        [0, 0]
-    );
-    slice_lengths!(
-        slice_len_too_big_u32,
-        read_u32_into,
-        write_u32_into,
-        9,
-        [0, 0]
-    );
-    slice_lengths!(
-        slice_len_too_small_i32,
-        read_i32_into,
-        write_i32_into,
-        7,
-        [0, 0]
-    );
-    slice_lengths!(
-        slice_len_too_big_i32,
-        read_i32_into,
-        write_i32_into,
-        9,
-        [0, 0]
-    );
-
-    slice_lengths!(
-        slice_len_too_small_u64,
-        read_u64_into,
-        write_u64_into,
-        15,
-        [0, 0]
-    );
-    slice_lengths!(
-        slice_len_too_big_u64,
-        read_u64_into,
-        write_u64_into,
-        17,
-        [0, 0]
-    );
-    slice_lengths!(
-        slice_len_too_small_i64,
-        read_i64_into,
-        write_i64_into,
-        15,
-        [0, 0]
-    );
-    slice_lengths!(
-        slice_len_too_big_i64,
-        read_i64_into,
-        write_i64_into,
-        17,
-        [0, 0]
-    );
-
-    slice_lengths!(
-        slice_len_too_small_u128,
-        read_u128_into,
-        write_u128_into,
-        31,
-        [0, 0]
-    );
-    slice_lengths!(
-        slice_len_too_big_u128,
-        read_u128_into,
-        write_u128_into,
-        33,
-        [0, 0]
-    );
-    slice_lengths!(
-        slice_len_too_small_i128,
-        read_i128_into,
-        write_i128_into,
-        31,
-        [0, 0]
-    );
-    slice_lengths!(
-        slice_len_too_big_i128,
-        read_i128_into,
-        write_i128_into,
-        33,
-        [0, 0]
-    );
-
-    #[test]
-    fn uint_bigger_buffer() {
-        use crate::{ByteOrder, LittleEndian};
-        let n = LittleEndian::read_uint(&[1, 2, 3, 4, 5, 6, 7, 8], 5);
-        assert_eq!(n, 0x05_0403_0201);
-    }
-
-    #[test]
-    fn regression173_array_impl() {
-        use crate::{BigEndian, ByteOrder, LittleEndian};
-
-        let xs = [0; 100];
-
-        let x = BigEndian::read_u16(&xs);
-        assert_eq!(x, 0);
-        let x = BigEndian::read_u32(&xs);
-        assert_eq!(x, 0);
-        let x = BigEndian::read_u64(&xs);
-        assert_eq!(x, 0);
-        let x = BigEndian::read_u128(&xs);
-        assert_eq!(x, 0);
-        let x = BigEndian::read_i16(&xs);
-        assert_eq!(x, 0);
-        let x = BigEndian::read_i32(&xs);
-        assert_eq!(x, 0);
-        let x = BigEndian::read_i64(&xs);
-        assert_eq!(x, 0);
-        let x = BigEndian::read_i128(&xs);
-        assert_eq!(x, 0);
-
-        let x = LittleEndian::read_u16(&xs);
-        assert_eq!(x, 0);
-        let x = LittleEndian::read_u32(&xs);
-        assert_eq!(x, 0);
-        let x = LittleEndian::read_u64(&xs);
-        assert_eq!(x, 0);
-        let x = LittleEndian::read_u128(&xs);
-        assert_eq!(x, 0);
-        let x = LittleEndian::read_i16(&xs);
-        assert_eq!(x, 0);
-        let x = LittleEndian::read_i32(&xs);
-        assert_eq!(x, 0);
-        let x = LittleEndian::read_i64(&xs);
-        assert_eq!(x, 0);
-        let x = LittleEndian::read_i128(&xs);
-        assert_eq!(x, 0);
-    }
-}
-
-#[cfg(test)]
-#[cfg(feature = "std")]
-mod stdtests {
-    extern crate quickcheck;
-    extern crate rand;
-
-    use self::quickcheck::{QuickCheck, StdGen, Testable};
-    use self::rand::thread_rng;
-
-    fn qc_unsized<A: Testable>(f: A) {
-        QuickCheck::new()
-            .gen(StdGen::new(thread_rng(), 16))
-            .tests(1_00)
-            .max_tests(10_000)
-            .quickcheck(f);
-    }
-
-    macro_rules! calc_max {
-        ($max:expr, $bytes:expr) => {
-            ($max - 1) >> (8 * (8 - $bytes))
-        };
-    }
-
-    macro_rules! qc_bytes_ext {
-        ($name:ident, $ty_int:ty, $max:expr,
-         $bytes:expr, $read:ident, $write:ident) => {
-            mod $name {
-                #[allow(unused_imports)]
-                use crate::test::{qc_sized, Wi128};
-                use crate::{
-                    BigEndian, LittleEndian, NativeEndian, ReadBytesExt,
-                    WriteBytesExt,
-                };
-                use std::io::Cursor;
-
-                #[test]
-                fn big_endian() {
-                    fn prop(n: $ty_int) -> bool {
-                        let mut wtr = vec![];
-                        wtr.$write::<BigEndian>(n.clone()).unwrap();
-                        let offset = wtr.len() - $bytes;
-                        let mut rdr = Cursor::new(&mut wtr[offset..]);
-                        n == rdr.$read::<BigEndian>($bytes).unwrap()
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, $max);
-                }
-
-                #[test]
-                fn little_endian() {
-                    fn prop(n: $ty_int) -> bool {
-                        let mut wtr = vec![];
-                        wtr.$write::<LittleEndian>(n.clone()).unwrap();
-                        let mut rdr = Cursor::new(wtr);
-                        n == rdr.$read::<LittleEndian>($bytes).unwrap()
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, $max);
-                }
-
-                #[test]
-                fn native_endian() {
-                    fn prop(n: $ty_int) -> bool {
-                        let mut wtr = vec![];
-                        wtr.$write::<NativeEndian>(n.clone()).unwrap();
-                        let offset = if cfg!(target_endian = "big") {
-                            wtr.len() - $bytes
-                        } else {
-                            0
-                        };
-                        let mut rdr = Cursor::new(&mut wtr[offset..]);
-                        n == rdr.$read::<NativeEndian>($bytes).unwrap()
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, $max);
-                }
-            }
-        };
-        ($name:ident, $ty_int:ty, $max:expr, $read:ident, $write:ident) => {
-            mod $name {
-                #[allow(unused_imports)]
-                use crate::test::{qc_sized, Wi128};
-                use crate::{
-                    BigEndian, LittleEndian, NativeEndian, ReadBytesExt,
-                    WriteBytesExt,
-                };
-                use std::io::Cursor;
-
-                #[test]
-                fn big_endian() {
-                    fn prop(n: $ty_int) -> bool {
-                        let mut wtr = vec![];
-                        wtr.$write::<BigEndian>(n.clone()).unwrap();
-                        let mut rdr = Cursor::new(wtr);
-                        n == rdr.$read::<BigEndian>().unwrap()
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
-                }
-
-                #[test]
-                fn little_endian() {
-                    fn prop(n: $ty_int) -> bool {
-                        let mut wtr = vec![];
-                        wtr.$write::<LittleEndian>(n.clone()).unwrap();
-                        let mut rdr = Cursor::new(wtr);
-                        n == rdr.$read::<LittleEndian>().unwrap()
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
-                }
-
-                #[test]
-                fn native_endian() {
-                    fn prop(n: $ty_int) -> bool {
-                        let mut wtr = vec![];
-                        wtr.$write::<NativeEndian>(n.clone()).unwrap();
-                        let mut rdr = Cursor::new(wtr);
-                        n == rdr.$read::<NativeEndian>().unwrap()
-                    }
-                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
-                }
-            }
-        };
-    }
-
-    qc_bytes_ext!(
-        prop_ext_u16,
-        u16,
-        ::std::u16::MAX as u64,
-        read_u16,
-        write_u16
-    );
-    qc_bytes_ext!(
-        prop_ext_i16,
-        i16,
-        ::std::i16::MAX as u64,
-        read_i16,
-        write_i16
-    );
-    qc_bytes_ext!(
-        prop_ext_u32,
-        u32,
-        ::std::u32::MAX as u64,
-        read_u32,
-        write_u32
-    );
-    qc_bytes_ext!(
-        prop_ext_i32,
-        i32,
-        ::std::i32::MAX as u64,
-        read_i32,
-        write_i32
-    );
-    qc_bytes_ext!(
-        prop_ext_u64,
-        u64,
-        ::std::u64::MAX as u64,
-        read_u64,
-        write_u64
-    );
-    qc_bytes_ext!(
-        prop_ext_i64,
-        i64,
-        ::std::i64::MAX as u64,
-        read_i64,
-        write_i64
-    );
-    qc_bytes_ext!(
-        prop_ext_f32,
-        f32,
-        ::std::u64::MAX as u64,
-        read_f32,
-        write_f32
-    );
-    qc_bytes_ext!(
-        prop_ext_f64,
-        f64,
-        ::std::i64::MAX as u64,
-        read_f64,
-        write_f64
-    );
-
-    qc_bytes_ext!(prop_ext_u128, Wi128<u128>, 16 + 1, read_u128, write_u128);
-    qc_bytes_ext!(prop_ext_i128, Wi128<i128>, 16 + 1, read_i128, write_i128);
-
-    qc_bytes_ext!(
-        prop_ext_uint_1,
-        u64,
-        calc_max!(crate::test::U64_MAX, 1),
-        1,
-        read_uint,
-        write_u64
-    );
-    qc_bytes_ext!(
-        prop_ext_uint_2,
-        u64,
-        calc_max!(crate::test::U64_MAX, 2),
-        2,
-        read_uint,
-        write_u64
-    );
-    qc_bytes_ext!(
-        prop_ext_uint_3,
-        u64,
-        calc_max!(crate::test::U64_MAX, 3),
-        3,
-        read_uint,
-        write_u64
-    );
-    qc_bytes_ext!(
-        prop_ext_uint_4,
-        u64,
-        calc_max!(crate::test::U64_MAX, 4),
-        4,
-        read_uint,
-        write_u64
-    );
-    qc_bytes_ext!(
-        prop_ext_uint_5,
-        u64,
-        calc_max!(crate::test::U64_MAX, 5),
-        5,
-        read_uint,
-        write_u64
-    );
-    qc_bytes_ext!(
-        prop_ext_uint_6,
-        u64,
-        calc_max!(crate::test::U64_MAX, 6),
-        6,
-        read_uint,
-        write_u64
-    );
-    qc_bytes_ext!(
-        prop_ext_uint_7,
-        u64,
-        calc_max!(crate::test::U64_MAX, 7),
-        7,
-        read_uint,
-        write_u64
-    );
-    qc_bytes_ext!(
-        prop_ext_uint_8,
-        u64,
-        calc_max!(crate::test::U64_MAX, 8),
-        8,
-        read_uint,
-        write_u64
-    );
-
-    qc_bytes_ext!(
-        prop_ext_uint128_1,
-        Wi128<u128>,
-        1,
-        1,
-        read_uint128,
-        write_u128
-    );
-    qc_bytes_ext!(
-        prop_ext_uint128_2,
-        Wi128<u128>,
-        2,
-        2,
-        read_uint128,
-        write_u128
-    );
-    qc_bytes_ext!(
-        prop_ext_uint128_3,
-        Wi128<u128>,
-        3,
-        3,
-        read_uint128,
-        write_u128
-    );
-    qc_bytes_ext!(
-        prop_ext_uint128_4,
-        Wi128<u128>,
-        4,
-        4,
-        read_uint128,
-        write_u128
-    );
-    qc_bytes_ext!(
-        prop_ext_uint128_5,
-        Wi128<u128>,
-        5,
-        5,
-        read_uint128,
-        write_u128
-    );
-    qc_bytes_ext!(
-        prop_ext_uint128_6,
-        Wi128<u128>,
-        6,
-        6,
-        read_uint128,
-        write_u128
-    );
-    qc_bytes_ext!(
-        prop_ext_uint128_7,
-        Wi128<u128>,
-        7,
-        7,
-        read_uint128,
-        write_u128
-    );
-    qc_bytes_ext!(
-        prop_ext_uint128_8,
-        Wi128<u128>,
-        8,
-        8,
-        read_uint128,
-        write_u128
-    );
-    qc_bytes_ext!(
-        prop_ext_uint128_9,
-        Wi128<u128>,
-        9,
-        9,
-        read_uint128,
-        write_u128
-    );
-    qc_bytes_ext!(
-        prop_ext_uint128_10,
-        Wi128<u128>,
-        10,
-        10,
-        read_uint128,
-        write_u128
-    );
-    qc_bytes_ext!(
-        prop_ext_uint128_11,
-        Wi128<u128>,
-        11,
-        11,
-        read_uint128,
-        write_u128
-    );
-    qc_bytes_ext!(
-        prop_ext_uint128_12,
-        Wi128<u128>,
-        12,
-        12,
-        read_uint128,
-        write_u128
-    );
-    qc_bytes_ext!(
-        prop_ext_uint128_13,
-        Wi128<u128>,
-        13,
-        13,
-        read_uint128,
-        write_u128
-    );
-    qc_bytes_ext!(
-        prop_ext_uint128_14,
-        Wi128<u128>,
-        14,
-        14,
-        read_uint128,
-        write_u128
-    );
-    qc_bytes_ext!(
-        prop_ext_uint128_15,
-        Wi128<u128>,
-        15,
-        15,
-        read_uint128,
-        write_u128
-    );
-    qc_bytes_ext!(
-        prop_ext_uint128_16,
-        Wi128<u128>,
-        16,
-        16,
-        read_uint128,
-        write_u128
-    );
-
-    qc_bytes_ext!(
-        prop_ext_int_1,
-        i64,
-        calc_max!(crate::test::I64_MAX, 1),
-        1,
-        read_int,
-        write_i64
-    );
-    qc_bytes_ext!(
-        prop_ext_int_2,
-        i64,
-        calc_max!(crate::test::I64_MAX, 2),
-        2,
-        read_int,
-        write_i64
-    );
-    qc_bytes_ext!(
-        prop_ext_int_3,
-        i64,
-        calc_max!(crate::test::I64_MAX, 3),
-        3,
-        read_int,
-        write_i64
-    );
-    qc_bytes_ext!(
-        prop_ext_int_4,
-        i64,
-        calc_max!(crate::test::I64_MAX, 4),
-        4,
-        read_int,
-        write_i64
-    );
-    qc_bytes_ext!(
-        prop_ext_int_5,
-        i64,
-        calc_max!(crate::test::I64_MAX, 5),
-        5,
-        read_int,
-        write_i64
-    );
-    qc_bytes_ext!(
-        prop_ext_int_6,
-        i64,
-        calc_max!(crate::test::I64_MAX, 6),
-        6,
-        read_int,
-        write_i64
-    );
-    qc_bytes_ext!(
-        prop_ext_int_7,
-        i64,
-        calc_max!(crate::test::I64_MAX, 1),
-        7,
-        read_int,
-        write_i64
-    );
-    qc_bytes_ext!(
-        prop_ext_int_8,
-        i64,
-        calc_max!(crate::test::I64_MAX, 8),
-        8,
-        read_int,
-        write_i64
-    );
-
-    qc_bytes_ext!(
-        prop_ext_int128_1,
-        Wi128<i128>,
-        1,
-        1,
-        read_int128,
-        write_i128
-    );
-    qc_bytes_ext!(
-        prop_ext_int128_2,
-        Wi128<i128>,
-        2,
-        2,
-        read_int128,
-        write_i128
-    );
-    qc_bytes_ext!(
-        prop_ext_int128_3,
-        Wi128<i128>,
-        3,
-        3,
-        read_int128,
-        write_i128
-    );
-    qc_bytes_ext!(
-        prop_ext_int128_4,
-        Wi128<i128>,
-        4,
-        4,
-        read_int128,
-        write_i128
-    );
-    qc_bytes_ext!(
-        prop_ext_int128_5,
-        Wi128<i128>,
-        5,
-        5,
-        read_int128,
-        write_i128
-    );
-    qc_bytes_ext!(
-        prop_ext_int128_6,
-        Wi128<i128>,
-        6,
-        6,
-        read_int128,
-        write_i128
-    );
-    qc_bytes_ext!(
-        prop_ext_int128_7,
-        Wi128<i128>,
-        7,
-        7,
-        read_int128,
-        write_i128
-    );
-    qc_bytes_ext!(
-        prop_ext_int128_8,
-        Wi128<i128>,
-        8,
-        8,
-        read_int128,
-        write_i128
-    );
-    qc_bytes_ext!(
-        prop_ext_int128_9,
-        Wi128<i128>,
-        9,
-        9,
-        read_int128,
-        write_i128
-    );
-    qc_bytes_ext!(
-        prop_ext_int128_10,
-        Wi128<i128>,
-        10,
-        10,
-        read_int128,
-        write_i128
-    );
-    qc_bytes_ext!(
-        prop_ext_int128_11,
-        Wi128<i128>,
-        11,
-        11,
-        read_int128,
-        write_i128
-    );
-    qc_bytes_ext!(
-        prop_ext_int128_12,
-        Wi128<i128>,
-        12,
-        12,
-        read_int128,
-        write_i128
-    );
-    qc_bytes_ext!(
-        prop_ext_int128_13,
-        Wi128<i128>,
-        13,
-        13,
-        read_int128,
-        write_i128
-    );
-    qc_bytes_ext!(
-        prop_ext_int128_14,
-        Wi128<i128>,
-        14,
-        14,
-        read_int128,
-        write_i128
-    );
-    qc_bytes_ext!(
-        prop_ext_int128_15,
-        Wi128<i128>,
-        15,
-        15,
-        read_int128,
-        write_i128
-    );
-    qc_bytes_ext!(
-        prop_ext_int128_16,
-        Wi128<i128>,
-        16,
-        16,
-        read_int128,
-        write_i128
-    );
-
-    // Test slice serialization/deserialization.
-    macro_rules! qc_slice {
-        ($name:ident, $ty_int:ty, $read:ident, $write:ident, $zero:expr) => {
-            mod $name {
-                use super::qc_unsized;
-                #[allow(unused_imports)]
-                use crate::test::Wi128;
-                use crate::{
-                    BigEndian, ByteOrder, LittleEndian, NativeEndian,
-                };
-                use core::mem::size_of;
-
-                #[test]
-                fn big_endian() {
-                    #[allow(unused_unsafe)]
-                    fn prop(numbers: Vec<$ty_int>) -> bool {
-                        let numbers: Vec<_> =
-                            numbers.into_iter().map(|x| x.clone()).collect();
-                        let num_bytes = size_of::<$ty_int>() * numbers.len();
-                        let mut bytes = vec![0; num_bytes];
-
-                        BigEndian::$write(&numbers, &mut bytes);
-
-                        let mut got = vec![$zero; numbers.len()];
-                        unsafe {
-                            BigEndian::$read(&bytes, &mut got);
-                        }
-
-                        numbers == got
-                    }
-                    qc_unsized(prop as fn(_) -> bool);
-                }
-
-                #[test]
-                fn little_endian() {
-                    #[allow(unused_unsafe)]
-                    fn prop(numbers: Vec<$ty_int>) -> bool {
-                        let numbers: Vec<_> =
-                            numbers.into_iter().map(|x| x.clone()).collect();
-                        let num_bytes = size_of::<$ty_int>() * numbers.len();
-                        let mut bytes = vec![0; num_bytes];
-
-                        LittleEndian::$write(&numbers, &mut bytes);
-
-                        let mut got = vec![$zero; numbers.len()];
-                        unsafe {
-                            LittleEndian::$read(&bytes, &mut got);
-                        }
-
-                        numbers == got
-                    }
-                    qc_unsized(prop as fn(_) -> bool);
-                }
-
-                #[test]
-                fn native_endian() {
-                    #[allow(unused_unsafe)]
-                    fn prop(numbers: Vec<$ty_int>) -> bool {
-                        let numbers: Vec<_> =
-                            numbers.into_iter().map(|x| x.clone()).collect();
-                        let num_bytes = size_of::<$ty_int>() * numbers.len();
-                        let mut bytes = vec![0; num_bytes];
-
-                        NativeEndian::$write(&numbers, &mut bytes);
-
-                        let mut got = vec![$zero; numbers.len()];
-                        unsafe {
-                            NativeEndian::$read(&bytes, &mut got);
-                        }
-
-                        numbers == got
-                    }
-                    qc_unsized(prop as fn(_) -> bool);
-                }
-            }
-        };
-    }
-
-    qc_slice!(prop_slice_u16, u16, read_u16_into, write_u16_into, 0);
-    qc_slice!(prop_slice_i16, i16, read_i16_into, write_i16_into, 0);
-    qc_slice!(prop_slice_u32, u32, read_u32_into, write_u32_into, 0);
-    qc_slice!(prop_slice_i32, i32, read_i32_into, write_i32_into, 0);
-    qc_slice!(prop_slice_u64, u64, read_u64_into, write_u64_into, 0);
-    qc_slice!(prop_slice_i64, i64, read_i64_into, write_i64_into, 0);
-    qc_slice!(
-        prop_slice_u128,
-        Wi128<u128>,
-        read_u128_into,
-        write_u128_into,
-        0
-    );
-    qc_slice!(
-        prop_slice_i128,
-        Wi128<i128>,
-        read_i128_into,
-        write_i128_into,
-        0
-    );
-
-    qc_slice!(prop_slice_f32, f32, read_f32_into, write_f32_into, 0.0);
-    qc_slice!(prop_slice_f64, f64, read_f64_into, write_f64_into, 0.0);
-}
-
\ No newline at end of file diff --git a/docs/doc/src/critical_section/lib.rs.html b/docs/doc/src/critical_section/lib.rs.html deleted file mode 100644 index 9772eb3..0000000 --- a/docs/doc/src/critical_section/lib.rs.html +++ /dev/null @@ -1,579 +0,0 @@ -lib.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-
#![cfg_attr(not(feature = "std"), no_std)]
-#![doc = include_str!("../README.md")]
-
-mod mutex;
-#[cfg(feature = "std")]
-mod std;
-
-use core::marker::PhantomData;
-
-pub use self::mutex::Mutex;
-
-/// Critical section token.
-///
-/// An instance of this type indicates that the current thread is executing code within a critical
-/// section.
-#[derive(Clone, Copy, Debug)]
-pub struct CriticalSection<'cs> {
-    _private: PhantomData<&'cs ()>,
-}
-
-impl<'cs> CriticalSection<'cs> {
-    /// Creates a critical section token.
-    ///
-    /// This method is meant to be used to create safe abstractions rather than being directly used
-    /// in applications.
-    ///
-    /// # Safety
-    ///
-    /// This must only be called when the current thread is in a critical section. The caller must
-    /// ensure that the returned instance will not live beyond the end of the critical section.
-    ///
-    /// The caller must use adequate fences to prevent the compiler from moving the
-    /// instructions inside the critical section to the outside of it. Sequentially consistent fences are
-    /// suggested immediately after entry and immediately before exit from the critical section.
-    ///
-    /// Note that the lifetime `'cs` of the returned instance is unconstrained. User code must not
-    /// be able to influence the lifetime picked for this type, since that might cause it to be
-    /// inferred to `'static`.
-    #[inline(always)]
-    pub unsafe fn new() -> Self {
-        CriticalSection {
-            _private: PhantomData,
-        }
-    }
-}
-
-#[cfg(any(
-    all(feature = "restore-state-none", feature = "restore-state-bool"),
-    all(feature = "restore-state-none", feature = "restore-state-u8"),
-    all(feature = "restore-state-none", feature = "restore-state-u16"),
-    all(feature = "restore-state-none", feature = "restore-state-u32"),
-    all(feature = "restore-state-none", feature = "restore-state-u64"),
-    all(feature = "restore-state-bool", feature = "restore-state-u8"),
-    all(feature = "restore-state-bool", feature = "restore-state-u16"),
-    all(feature = "restore-state-bool", feature = "restore-state-u32"),
-    all(feature = "restore-state-bool", feature = "restore-state-u64"),
-    all(feature = "restore-state-u8", feature = "restore-state-u16"),
-    all(feature = "restore-state-u8", feature = "restore-state-u32"),
-    all(feature = "restore-state-u8", feature = "restore-state-u64"),
-    all(feature = "restore-state-u16", feature = "restore-state-u32"),
-    all(feature = "restore-state-u16", feature = "restore-state-u64"),
-    all(feature = "restore-state-u32", feature = "restore-state-u64"),
-))]
-compile_error!("You must set at most one of these Cargo features: restore-state-none, restore-state-bool, restore-state-u8, restore-state-u16, restore-state-u32, restore-state-u64");
-
-#[cfg(not(any(
-    feature = "restore-state-bool",
-    feature = "restore-state-u8",
-    feature = "restore-state-u16",
-    feature = "restore-state-u32",
-    feature = "restore-state-u64"
-)))]
-type RawRestoreStateInner = ();
-
-#[cfg(feature = "restore-state-bool")]
-type RawRestoreStateInner = bool;
-
-#[cfg(feature = "restore-state-u8")]
-type RawRestoreStateInner = u8;
-
-#[cfg(feature = "restore-state-u16")]
-type RawRestoreStateInner = u16;
-
-#[cfg(feature = "restore-state-u32")]
-type RawRestoreStateInner = u32;
-
-#[cfg(feature = "restore-state-u64")]
-type RawRestoreStateInner = u64;
-
-// We have RawRestoreStateInner and RawRestoreState so that we don't have to copypaste the docs 5 times.
-// In the docs this shows as `pub type RawRestoreState = u8` or whatever the selected type is, because
-// the "inner" type alias is private.
-
-/// Raw, transparent "restore state".
-///
-/// This type changes based on which Cargo feature is selected, out of
-/// - `restore-state-none` (default, makes the type be `()`)
-/// - `restore-state-bool`
-/// - `restore-state-u8`
-/// - `restore-state-u16`
-/// - `restore-state-u32`
-/// - `restore-state-u64`
-///
-/// See [`RestoreState`].
-///
-/// User code uses [`RestoreState`] opaquely, critical section implementations
-/// use [`RawRestoreState`] so that they can use the inner value.
-pub type RawRestoreState = RawRestoreStateInner;
-
-/// Opaque "restore state".
-///
-/// Implementations use this to "carry over" information between acquiring and releasing
-/// a critical section. For example, when nesting two critical sections of an
-/// implementation that disables interrupts globally, acquiring the inner one won't disable
-/// the interrupts since they're already disabled. The impl would use the restore state to "tell"
-/// the corresponding release that it does *not* have to reenable interrupts yet, only the
-/// outer release should do so.
-///
-/// User code uses [`RestoreState`] opaquely, critical section implementations
-/// use [`RawRestoreState`] so that they can use the inner value.
-#[derive(Clone, Copy, Debug)]
-pub struct RestoreState(RawRestoreState);
-
-impl RestoreState {
-    /// Create an invalid, dummy  `RestoreState`.
-    ///
-    /// This can be useful to avoid `Option` when storing a `RestoreState` in a
-    /// struct field, or a `static`.
-    ///
-    /// Note that due to the safety contract of [`acquire`]/[`release`], you must not pass
-    /// a `RestoreState` obtained from this method to [`release`].
-    pub const fn invalid() -> Self {
-        #[cfg(not(any(
-            feature = "restore-state-bool",
-            feature = "restore-state-u8",
-            feature = "restore-state-u16",
-            feature = "restore-state-u32",
-            feature = "restore-state-u64"
-        )))]
-        return Self(());
-
-        #[cfg(feature = "restore-state-bool")]
-        return Self(false);
-
-        #[cfg(feature = "restore-state-u8")]
-        return Self(0);
-
-        #[cfg(feature = "restore-state-u16")]
-        return Self(0);
-
-        #[cfg(feature = "restore-state-u32")]
-        return Self(0);
-
-        #[cfg(feature = "restore-state-u64")]
-        return Self(0);
-    }
-}
-
-/// Acquire a critical section in the current thread.
-///
-/// This function is extremely low level. Strongly prefer using [`with`] instead.
-///
-/// Nesting critical sections is allowed. The inner critical sections
-/// are mostly no-ops since they're already protected by the outer one.
-///
-/// # Safety
-///
-/// - Each `acquire` call must be paired with exactly one `release` call in the same thread.
-/// - `acquire` returns a "restore state" that you must pass to the corresponding `release` call.
-/// - `acquire`/`release` pairs must be "properly nested", ie it's not OK to do `a=acquire(); b=acquire(); release(a); release(b);`.
-/// - It is UB to call `release` if the critical section is not acquired in the current thread.
-/// - It is UB to call `release` with a "restore state" that does not come from the corresponding `acquire` call.
-/// - It must provide ordering guarantees at least equivalent to a [`core::sync::atomic::Ordering::Acquire`]
-///   on a memory location shared by all critical sections, on which the `release` call will do a
-///   [`core::sync::atomic::Ordering::Release`] operation.
-#[inline(always)]
-pub unsafe fn acquire() -> RestoreState {
-    extern "Rust" {
-        fn _critical_section_1_0_acquire() -> RawRestoreState;
-    }
-
-    #[allow(clippy::unit_arg)]
-    RestoreState(_critical_section_1_0_acquire())
-}
-
-/// Release the critical section.
-///
-/// This function is extremely low level. Strongly prefer using [`with`] instead.
-///
-/// # Safety
-///
-/// See [`acquire`] for the safety contract description.
-#[inline(always)]
-pub unsafe fn release(restore_state: RestoreState) {
-    extern "Rust" {
-        fn _critical_section_1_0_release(restore_state: RawRestoreState);
-    }
-
-    #[allow(clippy::unit_arg)]
-    _critical_section_1_0_release(restore_state.0)
-}
-
-/// Execute closure `f` in a critical section.
-///
-/// Nesting critical sections is allowed. The inner critical sections
-/// are mostly no-ops since they're already protected by the outer one.
-///
-/// # Panics
-///
-/// This function panics if the given closure `f` panics. In this case
-/// the critical section is released before unwinding.
-#[inline]
-pub fn with<R>(f: impl FnOnce(CriticalSection) -> R) -> R {
-    // Helper for making sure `release` is called even if `f` panics.
-    struct Guard {
-        state: RestoreState,
-    }
-
-    impl Drop for Guard {
-        #[inline(always)]
-        fn drop(&mut self) {
-            unsafe { release(self.state) }
-        }
-    }
-
-    let state = unsafe { acquire() };
-    let _guard = Guard { state };
-
-    unsafe { f(CriticalSection::new()) }
-}
-
-/// Methods required for a critical section implementation.
-///
-/// This trait is not intended to be used except when implementing a critical section.
-///
-/// # Safety
-///
-/// Implementations must uphold the contract specified in [`crate::acquire`] and [`crate::release`].
-pub unsafe trait Impl {
-    /// Acquire the critical section.
-    ///
-    /// # Safety
-    ///
-    /// Callers must uphold the contract specified in [`crate::acquire`] and [`crate::release`].
-    unsafe fn acquire() -> RawRestoreState;
-
-    /// Release the critical section.
-    ///
-    /// # Safety
-    ///
-    /// Callers must uphold the contract specified in [`crate::acquire`] and [`crate::release`].
-    unsafe fn release(restore_state: RawRestoreState);
-}
-
-/// Set the critical section implementation.
-///
-/// # Example
-///
-/// ```
-/// # #[cfg(not(feature = "std"))] // needed for `cargo test --features std`
-/// # mod no_std {
-/// use critical_section::RawRestoreState;
-///
-/// struct MyCriticalSection;
-/// critical_section::set_impl!(MyCriticalSection);
-///
-/// unsafe impl critical_section::Impl for MyCriticalSection {
-///     unsafe fn acquire() -> RawRestoreState {
-///         // ...
-///     }
-///
-///     unsafe fn release(restore_state: RawRestoreState) {
-///         // ...
-///     }
-/// }
-/// # }
-#[macro_export]
-macro_rules! set_impl {
-    ($t: ty) => {
-        #[no_mangle]
-        unsafe fn _critical_section_1_0_acquire() -> $crate::RawRestoreState {
-            <$t as $crate::Impl>::acquire()
-        }
-        #[no_mangle]
-        unsafe fn _critical_section_1_0_release(restore_state: $crate::RawRestoreState) {
-            <$t as $crate::Impl>::release(restore_state)
-        }
-    };
-}
-
\ No newline at end of file diff --git a/docs/doc/src/critical_section/mutex.rs.html b/docs/doc/src/critical_section/mutex.rs.html deleted file mode 100644 index 020024a..0000000 --- a/docs/doc/src/critical_section/mutex.rs.html +++ /dev/null @@ -1,401 +0,0 @@ -mutex.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-
use super::CriticalSection;
-use core::cell::{Ref, RefCell, RefMut, UnsafeCell};
-
-/// A mutex based on critical sections.
-///
-/// # Example
-///
-/// ```no_run
-/// # use critical_section::Mutex;
-/// # use std::cell::Cell;
-///
-/// static FOO: Mutex<Cell<i32>> = Mutex::new(Cell::new(42));
-///
-/// fn main() {
-///     critical_section::with(|cs| {
-///         FOO.borrow(cs).set(43);
-///     });
-/// }
-///
-/// fn interrupt_handler() {
-///     let _x = critical_section::with(|cs| FOO.borrow(cs).get());
-/// }
-/// ```
-///
-///
-/// # Design
-///
-/// [`std::sync::Mutex`] has two purposes. It converts types that are [`Send`]
-/// but not [`Sync`] into types that are both; and it provides
-/// [interior mutability]. `critical_section::Mutex`, on the other hand, only adds
-/// `Sync`. It does *not* provide interior mutability.
-///
-/// This was a conscious design choice. It is possible to create multiple
-/// [`CriticalSection`] tokens, either by nesting critical sections or `Copy`ing
-/// an existing token. As a result, it would not be sound for [`Mutex::borrow`]
-/// to return `&mut T`, because there would be nothing to prevent calling
-/// `borrow` multiple times to create aliased `&mut T` references.
-///
-/// The solution is to include a runtime check to ensure that each resource is
-/// borrowed only once. This is what `std::sync::Mutex` does. However, this is
-/// a runtime cost that may not be required in all circumstances. For instance,
-/// `Mutex<Cell<T>>` never needs to create `&mut T` or equivalent.
-///
-/// If `&mut T` is needed, the simplest solution is to use `Mutex<RefCell<T>>`,
-/// which is the closest analogy to `std::sync::Mutex`. [`RefCell`] inserts the
-/// exact runtime check necessary to guarantee that the `&mut T` reference is
-/// unique.
-///
-/// To reduce verbosity when using `Mutex<RefCell<T>>`, we reimplement some of
-/// `RefCell`'s methods on it directly.
-///
-/// ```no_run
-/// # use critical_section::Mutex;
-/// # use std::cell::RefCell;
-///
-/// static FOO: Mutex<RefCell<i32>> = Mutex::new(RefCell::new(42));
-///
-/// fn main() {
-///     critical_section::with(|cs| {
-///         // Instead of calling this
-///         let _ = FOO.borrow(cs).take();
-///         // Call this
-///         let _ = FOO.take(cs);
-///         // `RefCell::borrow` and `RefCell::borrow_mut` are renamed to
-///         // `borrow_ref` and `borrow_ref_mut` to avoid name collisions
-///         let _: &mut i32 = &mut *FOO.borrow_ref_mut(cs);
-///     })
-/// }
-/// ```
-///
-/// [`std::sync::Mutex`]: https://doc.rust-lang.org/std/sync/struct.Mutex.html
-/// [interior mutability]: https://doc.rust-lang.org/reference/interior-mutability.html
-#[derive(Debug)]
-pub struct Mutex<T> {
-    inner: UnsafeCell<T>,
-}
-
-impl<T> Mutex<T> {
-    /// Creates a new mutex.
-    #[inline]
-    pub const fn new(value: T) -> Self {
-        Mutex {
-            inner: UnsafeCell::new(value),
-        }
-    }
-
-    /// Gets a mutable reference to the contained value when the mutex is already uniquely borrowed.
-    ///
-    /// This does not require locking or a critical section since it takes `&mut self`, which
-    /// guarantees unique ownership already. Care must be taken when using this method to
-    /// **unsafely** access `static mut` variables, appropriate fences must be used to prevent
-    /// unwanted optimizations.
-    #[inline]
-    pub fn get_mut(&mut self) -> &mut T {
-        unsafe { &mut *self.inner.get() }
-    }
-
-    /// Unwraps the contained value, consuming the mutex.
-    #[inline]
-    pub fn into_inner(self) -> T {
-        self.inner.into_inner()
-    }
-
-    /// Borrows the data for the duration of the critical section.
-    #[inline]
-    pub fn borrow<'cs>(&'cs self, _cs: CriticalSection<'cs>) -> &'cs T {
-        unsafe { &*self.inner.get() }
-    }
-}
-
-impl<T> Mutex<RefCell<T>> {
-    /// Borrow the data and call [`RefCell::replace`]
-    ///
-    /// This is equivalent to `self.borrow(cs).replace(t)`
-    ///
-    /// # Panics
-    ///
-    /// This call could panic. See the documentation for [`RefCell::replace`]
-    /// for more details.
-    #[inline]
-    #[track_caller]
-    pub fn replace<'cs>(&'cs self, cs: CriticalSection<'cs>, t: T) -> T {
-        self.borrow(cs).replace(t)
-    }
-
-    /// Borrow the data and call [`RefCell::replace_with`]
-    ///
-    /// This is equivalent to `self.borrow(cs).replace_with(f)`
-    ///
-    /// # Panics
-    ///
-    /// This call could panic. See the documentation for
-    /// [`RefCell::replace_with`] for more details.
-    #[inline]
-    #[track_caller]
-    pub fn replace_with<'cs, F>(&'cs self, cs: CriticalSection<'cs>, f: F) -> T
-    where
-        F: FnOnce(&mut T) -> T,
-    {
-        self.borrow(cs).replace_with(f)
-    }
-
-    /// Borrow the data and call [`RefCell::borrow`]
-    ///
-    /// This is equivalent to `self.borrow(cs).borrow()`
-    ///
-    /// # Panics
-    ///
-    /// This call could panic. See the documentation for [`RefCell::borrow`]
-    /// for more details.
-    #[inline]
-    #[track_caller]
-    pub fn borrow_ref<'cs>(&'cs self, cs: CriticalSection<'cs>) -> Ref<'cs, T> {
-        self.borrow(cs).borrow()
-    }
-
-    /// Borrow the data and call [`RefCell::borrow_mut`]
-    ///
-    /// This is equivalent to `self.borrow(cs).borrow_mut()`
-    ///
-    /// # Panics
-    ///
-    /// This call could panic. See the documentation for [`RefCell::borrow_mut`]
-    /// for more details.
-    #[inline]
-    #[track_caller]
-    pub fn borrow_ref_mut<'cs>(&'cs self, cs: CriticalSection<'cs>) -> RefMut<'cs, T> {
-        self.borrow(cs).borrow_mut()
-    }
-}
-
-impl<T: Default> Mutex<RefCell<T>> {
-    /// Borrow the data and call [`RefCell::take`]
-    ///
-    /// This is equivalent to `self.borrow(cs).take()`
-    ///
-    /// # Panics
-    ///
-    /// This call could panic. See the documentation for [`RefCell::take`]
-    /// for more details.
-    #[inline]
-    #[track_caller]
-    pub fn take<'cs>(&'cs self, cs: CriticalSection<'cs>) -> T {
-        self.borrow(cs).take()
-    }
-}
-
-// NOTE A `Mutex` can be used as a channel so the protected data must be `Send`
-// to prevent sending non-Sendable stuff (e.g. access tokens) across different
-// threads.
-unsafe impl<T> Sync for Mutex<T> where T: Send {}
-
-/// ``` compile_fail
-/// fn bad(cs: critical_section::CriticalSection) -> &u32 {
-///     let x = critical_section::Mutex::new(42u32);
-///     x.borrow(cs)
-/// }
-/// ```
-#[cfg(doctest)]
-const BorrowMustNotOutliveMutexTest: () = ();
-
\ No newline at end of file diff --git a/docs/doc/src/hash32/fnv.rs.html b/docs/doc/src/hash32/fnv.rs.html deleted file mode 100644 index d2e0b00..0000000 --- a/docs/doc/src/hash32/fnv.rs.html +++ /dev/null @@ -1,57 +0,0 @@ -fnv.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-
const BASIS: u32 = 0x811c9dc5;
-const PRIME: u32 = 0x1000193;
-
-/// 32-bit Fowler-Noll-Vo hasher
-pub struct Hasher {
-    state: u32,
-}
-
-impl Default for Hasher {
-    fn default() -> Self {
-        Hasher { state: BASIS }
-    }
-}
-
-impl ::Hasher for Hasher {
-    #[inline]
-    fn finish(&self) -> u32 {
-        self.state
-    }
-
-    #[inline]
-    fn write(&mut self, bytes: &[u8]) {
-        for byte in bytes {
-            self.state ^= u32::from(*byte);
-            self.state = self.state.wrapping_mul(PRIME);
-        }
-    }
-}
-
\ No newline at end of file diff --git a/docs/doc/src/hash32/lib.rs.html b/docs/doc/src/hash32/lib.rs.html deleted file mode 100644 index 9bc4569..0000000 --- a/docs/doc/src/hash32/lib.rs.html +++ /dev/null @@ -1,727 +0,0 @@ -lib.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-
//! 32-bit hashing machinery
-//!
-//! # Why?
-//!
-//! Because 32-bit architectures are a thing (e.g. ARM Cortex-M) and you don't want your hashing
-//! function to pull in a bunch of slow 64-bit compiler intrinsics (software implementations of
-//! 64-bit operations).
-//!
-//! # Relationship to `core::hash`
-//!
-//! This crate exposes the same interfaces you'll find in [`core::hash`]: `Hash`, `Hasher`,
-//! `BuildHasher` and `BuildHasherDefault`. The main difference is that `hash32::Hasher::finish`
-//! returns a `u32` instead of `u64`, and the contract of `hash32::Hasher` forbids the implementer
-//! from performing 64-bit (or 128-bit) operations while computing the hash.
-//!
-//! [`core::hash`]: https://doc.rust-lang.org/std/hash/index.html
-//!
-//! # `#[derive(Hash32)]`
-//!
-//! The easiest way to implement `hash32::Hash` for a `struct` is to use the `#[derive(Hash32)]`.
-//!
-//! Note that you need to *explicitly* depend on both `hash32` *and* `hash32_derive`; both crates
-//! must appear in your `Cargo.toml`.
-//!
-//! ``` ignore
-//! use hash32_derive::Hash32;
-//!
-//! #[derive(Hash32)]
-//! struct Ipv4Addr([u8; 4]);
-//!
-//! # fn main() {}
-//!
-//! ```
-//! # Hashers
-//!
-//! This crate provides implementations of the following 32-bit hashing algorithms:
-//!
-//! - [Fowler-Noll-Vo](struct.FnvHasher.html)
-//! - [MurmurHash3](struct.Murmur3Hasher.html)
-//!
-//! # MSRV
-//!
-//! This crate is guaranteed to compile on latest stable Rust. It *might* compile on older
-//! versions but that may change in any new patch release.
-//!
-//! # Future
-//!
-//! In the future we'd like to deprecate this crate in favor of making `core::hash::Hasher` generic
-//! over the size of the computed hash. Below is shown the planned change (but it doesn't work due
-//! to limitations in the `associated_type_defaults` feature):
-//!
-//! ``` ignore
-//! #![feature(associated_type_defaults)]
-//!
-//! trait Hasher {
-//!     type Hash = u64; // default type for backwards compatibility
-//!
-//!     fn finish(&self) -> Self::Hash; // changed
-//!     fn write(&mut self, bytes: &[u8]);
-//! }
-//! ```
-//!
-//! With this change a single `#[derive(Hash)]` would enough to make a type hashable with 32-bit and
-//! 64-bit hashers.
-
-#![deny(missing_docs)]
-#![deny(warnings)]
-#![no_std]
-
-extern crate byteorder;
-
-use core::marker::PhantomData;
-use core::{mem, slice, fmt};
-
-pub use fnv::Hasher as FnvHasher;
-pub use murmur3::Hasher as Murmur3Hasher;
-
-mod fnv;
-mod murmur3;
-
-/// See [`core::hash::BuildHasherDefault`][0] for details
-///
-/// [0]: https://doc.rust-lang.org/core/hash/struct.BuildHasherDefault.html
-pub struct BuildHasherDefault<H>
-{
-    _marker: PhantomData<H>,
-}
-
-impl<H> Default for BuildHasherDefault<H>
-where
-    H: Default + Hasher,
-{
-    fn default() -> Self {
-        BuildHasherDefault {
-            _marker: PhantomData,
-        }
-    }
-}
-
-impl<H> Clone for BuildHasherDefault<H>
-where
-    H: Default + Hasher,
-{
-    fn clone(&self) -> Self {
-        BuildHasherDefault::default()
-    }
-}
-
-impl<H> PartialEq for BuildHasherDefault<H>
-where
-    H: Default + Hasher,
-{
-    fn eq(&self, _other: &BuildHasherDefault<H>) -> bool {
-        true
-    }
-}
-
-impl<H: Default + Hasher> Eq for BuildHasherDefault<H> {}
-
-impl<H: Default + Hasher> fmt::Debug for BuildHasherDefault<H> {
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        f.pad("BuildHasherDefault")
-    }
-}
-
-impl<H> BuildHasherDefault<H>
-{
-    /// `const` constructor
-    pub const fn new() -> Self {
-        BuildHasherDefault {
-            _marker: PhantomData,
-        }
-    }
-}
-
-impl<H> BuildHasher for BuildHasherDefault<H>
-where
-    H: Default + Hasher,
-{
-    type Hasher = H;
-
-    fn build_hasher(&self) -> Self::Hasher {
-        H::default()
-    }
-}
-
-/// See [`core::hash::BuildHasher`][0] for details
-///
-/// [0]: https://doc.rust-lang.org/core/hash/trait.BuildHasher.html
-pub trait BuildHasher {
-    /// See [`core::hash::BuildHasher::Hasher`][0]
-    ///
-    /// [0]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html#associatedtype.Hasher
-    type Hasher: Hasher;
-
-    /// See [`core::hash::BuildHasher.build_hasher`][0]
-    ///
-    /// [0]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html#tymethod.build_hasher
-    fn build_hasher(&self) -> Self::Hasher;
-}
-
-/// See [`core::hash::Hasher`][0] for details
-///
-/// [0]: https://doc.rust-lang.org/core/hash/trait.Hasher.html
-///
-/// # Contract
-///
-/// Implementers of this trait must *not* perform any 64-bit (or 128-bit) operation while computing
-/// the hash.
-pub trait Hasher {
-    /// See [`core::hash::Hasher.finish`][0]
-    ///
-    /// [0]: https://doc.rust-lang.org/std/hash/trait.Hasher.html#tymethod.finish
-    fn finish(&self) -> u32;
-
-    /// See [`core::hash::Hasher.write`][0]
-    ///
-    /// [0]: https://doc.rust-lang.org/std/hash/trait.Hasher.html#tymethod.write
-    fn write(&mut self, bytes: &[u8]);
-}
-
-/// See [`core::hash::Hash`][0] for details
-///
-/// [0]: https://doc.rust-lang.org/core/hash/trait.Hash.html
-pub trait Hash {
-    /// Feeds this value into the given `Hasher`.
-    fn hash<H>(&self, state: &mut H)
-    where
-        H: Hasher;
-
-    /// Feeds a slice of this type into the given `Hasher`.
-    fn hash_slice<H>(data: &[Self], state: &mut H)
-    where
-        H: Hasher,
-        Self: Sized,
-    {
-        for piece in data {
-            piece.hash(state);
-        }
-    }
-}
-
-macro_rules! int {
-    ($ty:ident) => {
-        impl Hash for $ty {
-            fn hash<H>(&self, state: &mut H)
-            where
-                H: Hasher,
-            {
-                unsafe { state.write(&mem::transmute::<$ty, [u8; mem::size_of::<$ty>()]>(*self)) }
-            }
-
-            fn hash_slice<H>(data: &[Self], state: &mut H)
-            where
-                H: Hasher,
-            {
-                let newlen = data.len() * mem::size_of::<$ty>();
-                let ptr = data.as_ptr() as *const u8;
-                unsafe { state.write(slice::from_raw_parts(ptr, newlen)) }
-            }
-        }
-    };
-}
-
-int!(i16);
-int!(i32);
-int!(i64);
-int!(i8);
-int!(isize);
-int!(u16);
-int!(u32);
-int!(u64);
-int!(u8);
-int!(usize);
-
-impl Hash for bool {
-    fn hash<H>(&self, state: &mut H)
-    where
-        H: Hasher,
-    {
-        (*self as u8).hash(state)
-    }
-}
-
-impl Hash for char {
-    fn hash<H>(&self, state: &mut H)
-    where
-        H: Hasher,
-    {
-        (*self as u32).hash(state)
-    }
-}
-
-impl Hash for str {
-    fn hash<H>(&self, state: &mut H)
-    where
-        H: Hasher,
-    {
-        state.write(self.as_bytes());
-        state.write(&[0xff]);
-    }
-}
-
-impl<T> Hash for [T]
-where
-    T: Hash,
-{
-    fn hash<H>(&self, state: &mut H)
-    where
-        H: Hasher,
-    {
-        self.len().hash(state);
-        T::hash_slice(self, state);
-    }
-}
-
-macro_rules! array {
-    ($($n:expr),+) => {
-        $(
-            impl<T> Hash for [T; $n]
-                where
-                T: Hash,
-            {
-                fn hash<H>(&self, state: &mut H)
-                    where
-                    H: Hasher,
-                {
-                    Hash::hash(&self[..], state)
-                }
-            }
-        )+
-    };
-}
-
-array!(
-    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
-    26, 27, 28, 29, 30, 31, 32
-);
-
-impl<'a, T: ?Sized + Hash> Hash for &'a T {
-    fn hash<H: Hasher>(&self, state: &mut H) {
-        (**self).hash(state);
-    }
-}
-
-impl<'a, T: ?Sized + Hash> Hash for &'a mut T {
-    fn hash<H: Hasher>(&self, state: &mut H) {
-        (**self).hash(state);
-    }
-}
-
-impl Hash for () {
-    fn hash<H: Hasher>(&self, _state: &mut H) {}
-}
-
-macro_rules! tuple {
-    ( $($name:ident)+) => (
-        impl<$($name: Hash),*> Hash for ($($name,)*)
-            where
-            last_type!($($name,)+): ?Sized
-        {
-            #[allow(non_snake_case)]
-            fn hash<S: Hasher>(&self, state: &mut S) {
-                let ($(ref $name,)*) = *self;
-                $($name.hash(state);)*
-            }
-        }
-    );
-}
-
-macro_rules! last_type {
-    ($a:ident,) => { $a };
-    ($a:ident, $($rest_a:ident,)+) => { last_type!($($rest_a,)+) };
-}
-
-tuple! { A }
-tuple! { A B }
-tuple! { A B C }
-tuple! { A B C D }
-tuple! { A B C D E }
-tuple! { A B C D E F }
-tuple! { A B C D E F G }
-tuple! { A B C D E F G H }
-tuple! { A B C D E F G H I }
-tuple! { A B C D E F G H I J }
-tuple! { A B C D E F G H I J K }
-tuple! { A B C D E F G H I J K L }
-
-#[cfg(test)]
-mod test {
-    use super::{FnvHasher, Hash, Hasher};
-    #[test]
-    fn hashes_tuples() {
-        let mut h = FnvHasher::default();
-        ().hash(&mut h);
-        (1_usize,).hash(&mut h);
-        (1_u8, 2_i8).hash(&mut h);
-        (1_u16, 2_i16, 3_u32).hash(&mut h);
-        (1_i32, 2_u64, 3_i64, true).hash(&mut h);
-        (1_isize, 'a', "abc", [1u32, 2, 3, 4], false).hash(&mut h);
-        h.finish();
-    }
-}
-
\ No newline at end of file diff --git a/docs/doc/src/hash32/murmur3.rs.html b/docs/doc/src/hash32/murmur3.rs.html deleted file mode 100644 index 4ffd2d1..0000000 --- a/docs/doc/src/hash32/murmur3.rs.html +++ /dev/null @@ -1,381 +0,0 @@ -murmur3.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-
use core::{mem, slice};
-
-use byteorder::{ByteOrder, LE};
-
-/// 32-bit MurmurHash3 hasher
-pub struct Hasher {
-    buf: Buffer,
-    index: Index,
-    processed: u32,
-    state: State,
-}
-
-struct State(u32);
-
-#[derive(Clone, Copy)]
-#[repr(align(4))]
-struct Buffer {
-    bytes: [u8; 4],
-}
-
-#[derive(Clone, Copy, PartialEq)]
-enum Index {
-    _0,
-    _1,
-    _2,
-    _3,
-}
-
-impl Index {
-    fn usize(&self) -> usize {
-        match *self {
-            Index::_0 => 0,
-            Index::_1 => 1,
-            Index::_2 => 2,
-            Index::_3 => 3,
-        }
-    }
-}
-
-impl From<usize> for Index {
-    fn from(x: usize) -> Self {
-        match x % 4 {
-            0 => Index::_0,
-            1 => Index::_1,
-            2 => Index::_2,
-            3 => Index::_3,
-            _ => unreachable!(),
-        }
-    }
-}
-
-impl Hasher {
-    fn push(&mut self, buf: &[u8]) {
-        let start = self.index.usize();
-        let len = buf.len();
-        // NOTE(unsafe) avoid calling `memcpy` on a 0-3 byte copy
-        // self.buf.bytes[start..start+len].copy_from(buf);
-        for i in 0..len {
-            unsafe {
-                *self.buf.bytes.get_unchecked_mut(start + i) = *buf.get_unchecked(i);
-            }
-        }
-        self.index = Index::from(start + len);
-    }
-}
-
-impl Default for Hasher {
-    #[allow(deprecated)]
-    fn default() -> Self {
-        Hasher {
-            buf: unsafe { mem::uninitialized() },
-            index: Index::_0,
-            processed: 0,
-            state: State(0),
-        }
-    }
-}
-
-impl ::Hasher for Hasher {
-    fn finish(&self) -> u32 {
-        // tail
-        let mut state = match self.index {
-            Index::_3 => {
-                let mut block = 0;
-                block ^= u32::from(self.buf.bytes[2]) << 16;
-                block ^= u32::from(self.buf.bytes[1]) << 8;
-                block ^= u32::from(self.buf.bytes[0]);
-                self.state.0 ^ pre_mix(block)
-            }
-            Index::_2 => {
-                let mut block = 0;
-                block ^= u32::from(self.buf.bytes[1]) << 8;
-                block ^= u32::from(self.buf.bytes[0]);
-                self.state.0 ^ pre_mix(block)
-            }
-            Index::_1 => {
-                let mut block = 0;
-                block ^= u32::from(self.buf.bytes[0]);
-                self.state.0 ^ pre_mix(block)
-            }
-            Index::_0 => self.state.0,
-        };
-
-        // finalization mix
-        state ^= self.processed;
-        state ^= state >> 16;
-        state = state.wrapping_mul(0x85ebca6b);
-        state ^= state >> 13;
-        state = state.wrapping_mul(0xc2b2ae35);
-        state ^= state >> 16;
-
-        state
-    }
-
-    #[inline]
-    fn write(&mut self, bytes: &[u8]) {
-        let len = bytes.len();
-        self.processed += len as u32;
-
-        let body = if self.index == Index::_0 {
-            bytes
-        } else {
-            let index = self.index.usize();
-            if len + index >= 4 {
-                // we can complete a block using the data left in the buffer
-                // NOTE(unsafe) avoid panicking branch (`slice_index_len_fail`)
-                // let (head, body) = bytes.split_at(4 - index);
-                let mid = 4 - index;
-                let head = unsafe { slice::from_raw_parts(bytes.as_ptr(), mid) };
-                let body = unsafe {
-                    slice::from_raw_parts(bytes.as_ptr().offset(mid as isize), len - mid)
-                };
-
-                // NOTE(unsafe) avoid calling `memcpy` on a 0-3 byte copy
-                // self.buf.bytes[index..].copy_from_slice(head);
-                for i in 0..4 - index {
-                    unsafe {
-                        *self.buf.bytes.get_unchecked_mut(index + i) = *head.get_unchecked(i);
-                    }
-                }
-
-                self.index = Index::_0;
-
-                self.state.process_block(&self.buf.bytes);
-
-                body
-            } else {
-                bytes
-            }
-        };
-
-        for block in body.chunks(4) {
-            if block.len() == 4 {
-                self.state
-                    .process_block(unsafe { &*(block.as_ptr() as *const _) });
-            } else {
-                self.push(block);
-            }
-        }
-
-        // XXX is this faster?
-        // for block in body.exact_chunks(4) {
-        //     self.state
-        //         .process_block(unsafe { &*(block.as_ptr() as *const _) });
-        // }
-
-        // let tail = body.split_at(body.len() / 4 * 4).1;
-
-        // self.push(tail);
-    }
-}
-
-const C1: u32 = 0xcc9e2d51;
-const C2: u32 = 0x1b873593;
-const R1: u32 = 15;
-
-impl State {
-    fn process_block(&mut self, block: &[u8; 4]) {
-        self.0 ^= pre_mix(LE::read_u32(block));
-        self.0 = self.0.rotate_left(13);
-        self.0 = 5u32.wrapping_mul(self.0).wrapping_add(0xe6546b64);
-    }
-}
-
-fn pre_mix(mut block: u32) -> u32 {
-    block = block.wrapping_mul(C1);
-    block = block.rotate_left(R1);
-    block = block.wrapping_mul(C2);
-    block
-}
-
\ No newline at end of file diff --git a/docs/doc/src/heapless/binary_heap.rs.html b/docs/doc/src/heapless/binary_heap.rs.html deleted file mode 100644 index 2b0bc89..0000000 --- a/docs/doc/src/heapless/binary_heap.rs.html +++ /dev/null @@ -1,1483 +0,0 @@ -binary_heap.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-
//! A priority queue implemented with a binary heap.
-//!
-//! Insertion and popping the largest element have `O(log n)` time complexity. Checking the largest
-//! / smallest element is `O(1)`.
-
-// TODO not yet implemented
-// Converting a vector to a binary heap can be done in-place, and has `O(n)` complexity. A binary
-// heap can also be converted to a sorted vector in-place, allowing it to be used for an `O(n log
-// n)` in-place heapsort.
-
-use core::{
-    cmp::Ordering,
-    fmt,
-    marker::PhantomData,
-    mem::{self, ManuallyDrop},
-    ops::{Deref, DerefMut},
-    ptr, slice,
-};
-
-use crate::vec::Vec;
-
-/// Min-heap
-pub enum Min {}
-
-/// Max-heap
-pub enum Max {}
-
-/// The binary heap kind: min-heap or max-heap
-pub trait Kind: private::Sealed {
-    #[doc(hidden)]
-    fn ordering() -> Ordering;
-}
-
-impl Kind for Min {
-    fn ordering() -> Ordering {
-        Ordering::Less
-    }
-}
-
-impl Kind for Max {
-    fn ordering() -> Ordering {
-        Ordering::Greater
-    }
-}
-
-/// Sealed traits
-mod private {
-    pub trait Sealed {}
-}
-
-impl private::Sealed for Max {}
-impl private::Sealed for Min {}
-
-/// A priority queue implemented with a binary heap.
-///
-/// This can be either a min-heap or a max-heap.
-///
-/// It is a logic error for an item to be modified in such a way that the item's ordering relative
-/// to any other item, as determined by the `Ord` trait, changes while it is in the heap. This is
-/// normally only possible through `Cell`, `RefCell`, global state, I/O, or unsafe code.
-///
-/// ```
-/// use heapless::binary_heap::{BinaryHeap, Max};
-///
-/// let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-///
-/// // We can use peek to look at the next item in the heap. In this case,
-/// // there's no items in there yet so we get None.
-/// assert_eq!(heap.peek(), None);
-///
-/// // Let's add some scores...
-/// heap.push(1).unwrap();
-/// heap.push(5).unwrap();
-/// heap.push(2).unwrap();
-///
-/// // Now peek shows the most important item in the heap.
-/// assert_eq!(heap.peek(), Some(&5));
-///
-/// // We can check the length of a heap.
-/// assert_eq!(heap.len(), 3);
-///
-/// // We can iterate over the items in the heap, although they are returned in
-/// // a random order.
-/// for x in &heap {
-///     println!("{}", x);
-/// }
-///
-/// // If we instead pop these scores, they should come back in order.
-/// assert_eq!(heap.pop(), Some(5));
-/// assert_eq!(heap.pop(), Some(2));
-/// assert_eq!(heap.pop(), Some(1));
-/// assert_eq!(heap.pop(), None);
-///
-/// // We can clear the heap of any remaining items.
-/// heap.clear();
-///
-/// // The heap should now be empty.
-/// assert!(heap.is_empty())
-/// ```
-
-pub struct BinaryHeap<T, K, const N: usize> {
-    pub(crate) _kind: PhantomData<K>,
-    pub(crate) data: Vec<T, N>,
-}
-
-impl<T, K, const N: usize> BinaryHeap<T, K, N> {
-    /* Constructors */
-    /// Creates an empty BinaryHeap as a $K-heap.
-    ///
-    /// ```
-    /// use heapless::binary_heap::{BinaryHeap, Max};
-    ///
-    /// // allocate the binary heap on the stack
-    /// let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-    /// heap.push(4).unwrap();
-    ///
-    /// // allocate the binary heap in a static variable
-    /// static mut HEAP: BinaryHeap<i32, Max, 8> = BinaryHeap::new();
-    /// ```
-    pub const fn new() -> Self {
-        Self {
-            _kind: PhantomData,
-            data: Vec::new(),
-        }
-    }
-}
-
-impl<T, K, const N: usize> BinaryHeap<T, K, N>
-where
-    T: Ord,
-    K: Kind,
-{
-    /* Public API */
-    /// Returns the capacity of the binary heap.
-    pub fn capacity(&self) -> usize {
-        self.data.capacity()
-    }
-
-    /// Drops all items from the binary heap.
-    ///
-    /// ```
-    /// use heapless::binary_heap::{BinaryHeap, Max};
-    ///
-    /// let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-    /// heap.push(1).unwrap();
-    /// heap.push(3).unwrap();
-    ///
-    /// assert!(!heap.is_empty());
-    ///
-    /// heap.clear();
-    ///
-    /// assert!(heap.is_empty());
-    /// ```
-    pub fn clear(&mut self) {
-        self.data.clear()
-    }
-
-    /// Returns the length of the binary heap.
-    ///
-    /// ```
-    /// use heapless::binary_heap::{BinaryHeap, Max};
-    ///
-    /// let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-    /// heap.push(1).unwrap();
-    /// heap.push(3).unwrap();
-    ///
-    /// assert_eq!(heap.len(), 2);
-    /// ```
-    pub fn len(&self) -> usize {
-        self.data.len()
-    }
-
-    /// Checks if the binary heap is empty.
-    ///
-    /// ```
-    /// use heapless::binary_heap::{BinaryHeap, Max};
-    ///
-    /// let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-    ///
-    /// assert!(heap.is_empty());
-    ///
-    /// heap.push(3).unwrap();
-    /// heap.push(5).unwrap();
-    /// heap.push(1).unwrap();
-    ///
-    /// assert!(!heap.is_empty());
-    /// ```
-    pub fn is_empty(&self) -> bool {
-        self.len() == 0
-    }
-
-    /// Returns an iterator visiting all values in the underlying vector, in arbitrary order.
-    ///
-    /// ```
-    /// use heapless::binary_heap::{BinaryHeap, Max};
-    ///
-    /// let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-    /// heap.push(1).unwrap();
-    /// heap.push(2).unwrap();
-    /// heap.push(3).unwrap();
-    /// heap.push(4).unwrap();
-    ///
-    /// // Print 1, 2, 3, 4 in arbitrary order
-    /// for x in heap.iter() {
-    ///     println!("{}", x);
-    ///
-    /// }
-    /// ```
-    pub fn iter(&self) -> slice::Iter<'_, T> {
-        self.data.as_slice().iter()
-    }
-
-    /// Returns a mutable iterator visiting all values in the underlying vector, in arbitrary order.
-    ///
-    /// **WARNING** Mutating the items in the binary heap can leave the heap in an inconsistent
-    /// state.
-    pub fn iter_mut(&mut self) -> slice::IterMut<'_, T> {
-        self.data.as_mut_slice().iter_mut()
-    }
-
-    /// Returns the *top* (greatest if max-heap, smallest if min-heap) item in the binary heap, or
-    /// None if it is empty.
-    ///
-    /// ```
-    /// use heapless::binary_heap::{BinaryHeap, Max};
-    ///
-    /// let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-    /// assert_eq!(heap.peek(), None);
-    ///
-    /// heap.push(1).unwrap();
-    /// heap.push(5).unwrap();
-    /// heap.push(2).unwrap();
-    /// assert_eq!(heap.peek(), Some(&5));
-    /// ```
-    pub fn peek(&self) -> Option<&T> {
-        self.data.as_slice().get(0)
-    }
-
-    /// Returns a mutable reference to the greatest item in the binary heap, or
-    /// `None` if it is empty.
-    ///
-    /// Note: If the `PeekMut` value is leaked, the heap may be in an
-    /// inconsistent state.
-    ///
-    /// # Examples
-    ///
-    /// Basic usage:
-    ///
-    /// ```
-    /// use heapless::binary_heap::{BinaryHeap, Max};
-    ///
-    /// let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-    /// assert!(heap.peek_mut().is_none());
-    ///
-    /// heap.push(1);
-    /// heap.push(5);
-    /// heap.push(2);
-    /// {
-    ///     let mut val = heap.peek_mut().unwrap();
-    ///     *val = 0;
-    /// }
-    ///
-    /// assert_eq!(heap.peek(), Some(&2));
-    /// ```
-    pub fn peek_mut(&mut self) -> Option<PeekMut<'_, T, K, N>> {
-        if self.is_empty() {
-            None
-        } else {
-            Some(PeekMut {
-                heap: self,
-                sift: true,
-            })
-        }
-    }
-
-    /// Removes the *top* (greatest if max-heap, smallest if min-heap) item from the binary heap and
-    /// returns it, or None if it is empty.
-    ///
-    /// ```
-    /// use heapless::binary_heap::{BinaryHeap, Max};
-    ///
-    /// let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-    /// heap.push(1).unwrap();
-    /// heap.push(3).unwrap();
-    ///
-    /// assert_eq!(heap.pop(), Some(3));
-    /// assert_eq!(heap.pop(), Some(1));
-    /// assert_eq!(heap.pop(), None);
-    /// ```
-    pub fn pop(&mut self) -> Option<T> {
-        if self.is_empty() {
-            None
-        } else {
-            Some(unsafe { self.pop_unchecked() })
-        }
-    }
-
-    /// Removes the *top* (greatest if max-heap, smallest if min-heap) item from the binary heap and
-    /// returns it, without checking if the binary heap is empty.
-    pub unsafe fn pop_unchecked(&mut self) -> T {
-        let mut item = self.data.pop_unchecked();
-
-        if !self.is_empty() {
-            mem::swap(&mut item, self.data.as_mut_slice().get_unchecked_mut(0));
-            self.sift_down_to_bottom(0);
-        }
-        item
-    }
-
-    /// Pushes an item onto the binary heap.
-    ///
-    /// ```
-    /// use heapless::binary_heap::{BinaryHeap, Max};
-    ///
-    /// let mut heap: BinaryHeap<_, Max, 8> = BinaryHeap::new();
-    /// heap.push(3).unwrap();
-    /// heap.push(5).unwrap();
-    /// heap.push(1).unwrap();
-    ///
-    /// assert_eq!(heap.len(), 3);
-    /// assert_eq!(heap.peek(), Some(&5));
-    /// ```
-    pub fn push(&mut self, item: T) -> Result<(), T> {
-        if self.data.is_full() {
-            return Err(item);
-        }
-
-        unsafe { self.push_unchecked(item) }
-        Ok(())
-    }
-
-    /// Pushes an item onto the binary heap without first checking if it's full.
-    pub unsafe fn push_unchecked(&mut self, item: T) {
-        let old_len = self.len();
-        self.data.push_unchecked(item);
-        self.sift_up(0, old_len);
-    }
-
-    /// Returns the underlying ```Vec<T,N>```. Order is arbitrary and time is O(1).
-    pub fn into_vec(self) -> Vec<T, N> {
-        self.data
-    }
-
-    /* Private API */
-    fn sift_down_to_bottom(&mut self, mut pos: usize) {
-        let end = self.len();
-        let start = pos;
-        unsafe {
-            let mut hole = Hole::new(self.data.as_mut_slice(), pos);
-            let mut child = 2 * pos + 1;
-            while child < end {
-                let right = child + 1;
-                // compare with the greater of the two children
-                if right < end && hole.get(child).cmp(hole.get(right)) != K::ordering() {
-                    child = right;
-                }
-                hole.move_to(child);
-                child = 2 * hole.pos() + 1;
-            }
-            pos = hole.pos;
-        }
-        self.sift_up(start, pos);
-    }
-
-    fn sift_up(&mut self, start: usize, pos: usize) -> usize {
-        unsafe {
-            // Take out the value at `pos` and create a hole.
-            let mut hole = Hole::new(self.data.as_mut_slice(), pos);
-
-            while hole.pos() > start {
-                let parent = (hole.pos() - 1) / 2;
-                if hole.element().cmp(hole.get(parent)) != K::ordering() {
-                    break;
-                }
-                hole.move_to(parent);
-            }
-            hole.pos()
-        }
-    }
-}
-
-/// Hole represents a hole in a slice i.e. an index without valid value
-/// (because it was moved from or duplicated).
-/// In drop, `Hole` will restore the slice by filling the hole
-/// position with the value that was originally removed.
-struct Hole<'a, T> {
-    data: &'a mut [T],
-    /// `elt` is always `Some` from new until drop.
-    elt: ManuallyDrop<T>,
-    pos: usize,
-}
-
-impl<'a, T> Hole<'a, T> {
-    /// Create a new Hole at index `pos`.
-    ///
-    /// Unsafe because pos must be within the data slice.
-    #[inline]
-    unsafe fn new(data: &'a mut [T], pos: usize) -> Self {
-        debug_assert!(pos < data.len());
-        let elt = ptr::read(data.get_unchecked(pos));
-        Hole {
-            data,
-            elt: ManuallyDrop::new(elt),
-            pos,
-        }
-    }
-
-    #[inline]
-    fn pos(&self) -> usize {
-        self.pos
-    }
-
-    /// Returns a reference to the element removed.
-    #[inline]
-    fn element(&self) -> &T {
-        &self.elt
-    }
-
-    /// Returns a reference to the element at `index`.
-    ///
-    /// Unsafe because index must be within the data slice and not equal to pos.
-    #[inline]
-    unsafe fn get(&self, index: usize) -> &T {
-        debug_assert!(index != self.pos);
-        debug_assert!(index < self.data.len());
-        self.data.get_unchecked(index)
-    }
-
-    /// Move hole to new location
-    ///
-    /// Unsafe because index must be within the data slice and not equal to pos.
-    #[inline]
-    unsafe fn move_to(&mut self, index: usize) {
-        debug_assert!(index != self.pos);
-        debug_assert!(index < self.data.len());
-        let ptr = self.data.as_mut_ptr();
-        let index_ptr: *const _ = ptr.add(index);
-        let hole_ptr = ptr.add(self.pos);
-        ptr::copy_nonoverlapping(index_ptr, hole_ptr, 1);
-        self.pos = index;
-    }
-}
-
-/// Structure wrapping a mutable reference to the greatest item on a
-/// `BinaryHeap`.
-///
-/// This `struct` is created by the [`peek_mut`] method on [`BinaryHeap`]. See
-/// its documentation for more.
-///
-/// [`peek_mut`]: struct.BinaryHeap.html#method.peek_mut
-/// [`BinaryHeap`]: struct.BinaryHeap.html
-pub struct PeekMut<'a, T, K, const N: usize>
-where
-    T: Ord,
-    K: Kind,
-{
-    heap: &'a mut BinaryHeap<T, K, N>,
-    sift: bool,
-}
-
-impl<T, K, const N: usize> Drop for PeekMut<'_, T, K, N>
-where
-    T: Ord,
-    K: Kind,
-{
-    fn drop(&mut self) {
-        if self.sift {
-            self.heap.sift_down_to_bottom(0);
-        }
-    }
-}
-
-impl<T, K, const N: usize> Deref for PeekMut<'_, T, K, N>
-where
-    T: Ord,
-    K: Kind,
-{
-    type Target = T;
-    fn deref(&self) -> &T {
-        debug_assert!(!self.heap.is_empty());
-        // SAFE: PeekMut is only instantiated for non-empty heaps
-        unsafe { self.heap.data.as_slice().get_unchecked(0) }
-    }
-}
-
-impl<T, K, const N: usize> DerefMut for PeekMut<'_, T, K, N>
-where
-    T: Ord,
-    K: Kind,
-{
-    fn deref_mut(&mut self) -> &mut T {
-        debug_assert!(!self.heap.is_empty());
-        // SAFE: PeekMut is only instantiated for non-empty heaps
-        unsafe { self.heap.data.as_mut_slice().get_unchecked_mut(0) }
-    }
-}
-
-impl<'a, T, K, const N: usize> PeekMut<'a, T, K, N>
-where
-    T: Ord,
-    K: Kind,
-{
-    /// Removes the peeked value from the heap and returns it.
-    pub fn pop(mut this: PeekMut<'a, T, K, N>) -> T {
-        let value = this.heap.pop().unwrap();
-        this.sift = false;
-        value
-    }
-}
-
-impl<'a, T> Drop for Hole<'a, T> {
-    #[inline]
-    fn drop(&mut self) {
-        // fill the hole again
-        unsafe {
-            let pos = self.pos;
-            ptr::write(self.data.get_unchecked_mut(pos), ptr::read(&*self.elt));
-        }
-    }
-}
-
-impl<T, K, const N: usize> Default for BinaryHeap<T, K, N>
-where
-    T: Ord,
-    K: Kind,
-{
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-impl<T, K, const N: usize> Clone for BinaryHeap<T, K, N>
-where
-    K: Kind,
-    T: Ord + Clone,
-{
-    fn clone(&self) -> Self {
-        Self {
-            _kind: self._kind,
-            data: self.data.clone(),
-        }
-    }
-}
-
-impl<T, K, const N: usize> fmt::Debug for BinaryHeap<T, K, N>
-where
-    K: Kind,
-    T: Ord + fmt::Debug,
-{
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        f.debug_list().entries(self.iter()).finish()
-    }
-}
-
-impl<'a, T, K, const N: usize> IntoIterator for &'a BinaryHeap<T, K, N>
-where
-    K: Kind,
-    T: Ord,
-{
-    type Item = &'a T;
-    type IntoIter = slice::Iter<'a, T>;
-
-    fn into_iter(self) -> Self::IntoIter {
-        self.iter()
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use std::vec::Vec;
-
-    use crate::binary_heap::{BinaryHeap, Max, Min};
-
-    #[test]
-    fn static_new() {
-        static mut _B: BinaryHeap<i32, Min, 16> = BinaryHeap::new();
-    }
-
-    #[test]
-    fn drop() {
-        droppable!();
-
-        {
-            let mut v: BinaryHeap<Droppable, Max, 2> = BinaryHeap::new();
-            v.push(Droppable::new()).ok().unwrap();
-            v.push(Droppable::new()).ok().unwrap();
-            v.pop().unwrap();
-        }
-
-        assert_eq!(Droppable::count(), 0);
-
-        {
-            let mut v: BinaryHeap<Droppable, Max, 2> = BinaryHeap::new();
-            v.push(Droppable::new()).ok().unwrap();
-            v.push(Droppable::new()).ok().unwrap();
-        }
-
-        assert_eq!(Droppable::count(), 0);
-
-        {
-            let mut v: BinaryHeap<Droppable, Min, 2> = BinaryHeap::new();
-            v.push(Droppable::new()).ok().unwrap();
-            v.push(Droppable::new()).ok().unwrap();
-            v.pop().unwrap();
-        }
-
-        assert_eq!(Droppable::count(), 0);
-
-        {
-            let mut v: BinaryHeap<Droppable, Min, 2> = BinaryHeap::new();
-            v.push(Droppable::new()).ok().unwrap();
-            v.push(Droppable::new()).ok().unwrap();
-        }
-
-        assert_eq!(Droppable::count(), 0);
-    }
-
-    #[test]
-    fn into_vec() {
-        droppable!();
-
-        let mut h: BinaryHeap<Droppable, Max, 2> = BinaryHeap::new();
-        h.push(Droppable::new()).ok().unwrap();
-        h.push(Droppable::new()).ok().unwrap();
-        h.pop().unwrap();
-
-        assert_eq!(Droppable::count(), 1);
-
-        let v = h.into_vec();
-
-        assert_eq!(Droppable::count(), 1);
-
-        core::mem::drop(v);
-
-        assert_eq!(Droppable::count(), 0);
-    }
-
-    #[test]
-    fn min() {
-        let mut heap = BinaryHeap::<_, Min, 16>::new();
-        heap.push(1).unwrap();
-        heap.push(2).unwrap();
-        heap.push(3).unwrap();
-        heap.push(17).unwrap();
-        heap.push(19).unwrap();
-        heap.push(36).unwrap();
-        heap.push(7).unwrap();
-        heap.push(25).unwrap();
-        heap.push(100).unwrap();
-
-        assert_eq!(
-            heap.iter().cloned().collect::<Vec<_>>(),
-            [1, 2, 3, 17, 19, 36, 7, 25, 100]
-        );
-
-        assert_eq!(heap.pop(), Some(1));
-
-        assert_eq!(
-            heap.iter().cloned().collect::<Vec<_>>(),
-            [2, 17, 3, 25, 19, 36, 7, 100]
-        );
-
-        assert_eq!(heap.pop(), Some(2));
-        assert_eq!(heap.pop(), Some(3));
-        assert_eq!(heap.pop(), Some(7));
-        assert_eq!(heap.pop(), Some(17));
-        assert_eq!(heap.pop(), Some(19));
-        assert_eq!(heap.pop(), Some(25));
-        assert_eq!(heap.pop(), Some(36));
-        assert_eq!(heap.pop(), Some(100));
-        assert_eq!(heap.pop(), None);
-
-        assert!(heap.peek_mut().is_none());
-
-        heap.push(1).unwrap();
-        heap.push(2).unwrap();
-        heap.push(10).unwrap();
-
-        {
-            let mut val = heap.peek_mut().unwrap();
-            *val = 7;
-        }
-
-        assert_eq!(heap.pop(), Some(2));
-        assert_eq!(heap.pop(), Some(7));
-        assert_eq!(heap.pop(), Some(10));
-        assert_eq!(heap.pop(), None);
-    }
-
-    #[test]
-    fn max() {
-        let mut heap = BinaryHeap::<_, Max, 16>::new();
-        heap.push(1).unwrap();
-        heap.push(2).unwrap();
-        heap.push(3).unwrap();
-        heap.push(17).unwrap();
-        heap.push(19).unwrap();
-        heap.push(36).unwrap();
-        heap.push(7).unwrap();
-        heap.push(25).unwrap();
-        heap.push(100).unwrap();
-
-        assert_eq!(
-            heap.iter().cloned().collect::<Vec<_>>(),
-            [100, 36, 19, 25, 3, 2, 7, 1, 17]
-        );
-
-        assert_eq!(heap.pop(), Some(100));
-
-        assert_eq!(
-            heap.iter().cloned().collect::<Vec<_>>(),
-            [36, 25, 19, 17, 3, 2, 7, 1]
-        );
-
-        assert_eq!(heap.pop(), Some(36));
-        assert_eq!(heap.pop(), Some(25));
-        assert_eq!(heap.pop(), Some(19));
-        assert_eq!(heap.pop(), Some(17));
-        assert_eq!(heap.pop(), Some(7));
-        assert_eq!(heap.pop(), Some(3));
-        assert_eq!(heap.pop(), Some(2));
-        assert_eq!(heap.pop(), Some(1));
-        assert_eq!(heap.pop(), None);
-
-        assert!(heap.peek_mut().is_none());
-
-        heap.push(1).unwrap();
-        heap.push(9).unwrap();
-        heap.push(10).unwrap();
-
-        {
-            let mut val = heap.peek_mut().unwrap();
-            *val = 7;
-        }
-
-        assert_eq!(heap.pop(), Some(9));
-        assert_eq!(heap.pop(), Some(7));
-        assert_eq!(heap.pop(), Some(1));
-        assert_eq!(heap.pop(), None);
-    }
-}
-
\ No newline at end of file diff --git a/docs/doc/src/heapless/deque.rs.html b/docs/doc/src/heapless/deque.rs.html deleted file mode 100644 index 25f92e8..0000000 --- a/docs/doc/src/heapless/deque.rs.html +++ /dev/null @@ -1,1663 +0,0 @@ -deque.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-
use core::fmt;
-use core::iter::FusedIterator;
-use core::marker::PhantomData;
-use core::mem::MaybeUninit;
-use core::{ptr, slice};
-
-/// A fixed capacity double-ended queue.
-///
-/// # Examples
-///
-/// ```
-/// use heapless::Deque;
-///
-/// // A deque with a fixed capacity of 8 elements allocated on the stack
-/// let mut deque = Deque::<_, 8>::new();
-///
-/// // You can use it as a good old FIFO queue.
-/// deque.push_back(1);
-/// deque.push_back(2);
-/// assert_eq!(deque.len(), 2);
-///
-/// assert_eq!(deque.pop_front(), Some(1));
-/// assert_eq!(deque.pop_front(), Some(2));
-/// assert_eq!(deque.len(), 0);
-///
-/// // Deque is double-ended, you can push and pop from the front and back.
-/// deque.push_back(1);
-/// deque.push_front(2);
-/// deque.push_back(3);
-/// deque.push_front(4);
-/// assert_eq!(deque.pop_front(), Some(4));
-/// assert_eq!(deque.pop_front(), Some(2));
-/// assert_eq!(deque.pop_front(), Some(1));
-/// assert_eq!(deque.pop_front(), Some(3));
-///
-/// // You can iterate it, yielding all the elements front-to-back.
-/// for x in &deque {
-///     println!("{}", x);
-/// }
-/// ```
-pub struct Deque<T, const N: usize> {
-    buffer: [MaybeUninit<T>; N],
-
-    /// Front index. Always 0..=(N-1)
-    front: usize,
-    /// Back index. Always 0..=(N-1).
-    back: usize,
-
-    /// Used to distinguish "empty" and "full" cases when `front == back`.
-    /// May only be `true` if `front == back`, always `false` otherwise.
-    full: bool,
-}
-
-impl<T, const N: usize> Deque<T, N> {
-    const INIT: MaybeUninit<T> = MaybeUninit::uninit();
-
-    /// Constructs a new, empty deque with a fixed capacity of `N`
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::Deque;
-    ///
-    /// // allocate the deque on the stack
-    /// let mut x: Deque<u8, 16> = Deque::new();
-    ///
-    /// // allocate the deque in a static variable
-    /// static mut X: Deque<u8, 16> = Deque::new();
-    /// ```
-    pub const fn new() -> Self {
-        // Const assert N > 0
-        crate::sealed::greater_than_0::<N>();
-
-        Self {
-            buffer: [Self::INIT; N],
-            front: 0,
-            back: 0,
-            full: false,
-        }
-    }
-
-    fn increment(i: usize) -> usize {
-        if i + 1 == N {
-            0
-        } else {
-            i + 1
-        }
-    }
-
-    fn decrement(i: usize) -> usize {
-        if i == 0 {
-            N - 1
-        } else {
-            i - 1
-        }
-    }
-
-    /// Returns the maximum number of elements the deque can hold.
-    pub const fn capacity(&self) -> usize {
-        N
-    }
-
-    /// Returns the number of elements currently in the deque.
-    pub const fn len(&self) -> usize {
-        if self.full {
-            N
-        } else if self.back < self.front {
-            self.back + N - self.front
-        } else {
-            self.back - self.front
-        }
-    }
-
-    /// Clears the deque, removing all values.
-    pub fn clear(&mut self) {
-        // safety: we're immediately setting a consistent empty state.
-        unsafe { self.drop_contents() }
-        self.front = 0;
-        self.back = 0;
-        self.full = false;
-    }
-
-    /// Drop all items in the `Deque`, leaving the state `back/front/full` unmodified.
-    ///
-    /// safety: leaves the `Deque` in an inconsistent state, so can cause duplicate drops.
-    unsafe fn drop_contents(&mut self) {
-        // We drop each element used in the deque by turning into a &mut[T]
-        let (a, b) = self.as_mut_slices();
-        ptr::drop_in_place(a);
-        ptr::drop_in_place(b);
-    }
-
-    /// Returns whether the deque is empty.
-    pub fn is_empty(&self) -> bool {
-        self.front == self.back && !self.full
-    }
-
-    /// Returns whether the deque is full (i.e. if `len() == capacity()`.
-    pub fn is_full(&self) -> bool {
-        self.full
-    }
-
-    /// Returns a pair of slices which contain, in order, the contents of the `Deque`.
-    pub fn as_slices(&self) -> (&[T], &[T]) {
-        // NOTE(unsafe) avoid bound checks in the slicing operation
-        unsafe {
-            if self.is_empty() {
-                (&[], &[])
-            } else if self.back <= self.front {
-                (
-                    slice::from_raw_parts(
-                        self.buffer.as_ptr().add(self.front) as *const T,
-                        N - self.front,
-                    ),
-                    slice::from_raw_parts(self.buffer.as_ptr() as *const T, self.back),
-                )
-            } else {
-                (
-                    slice::from_raw_parts(
-                        self.buffer.as_ptr().add(self.front) as *const T,
-                        self.back - self.front,
-                    ),
-                    &[],
-                )
-            }
-        }
-    }
-
-    /// Returns a pair of mutable slices which contain, in order, the contents of the `Deque`.
-    pub fn as_mut_slices(&mut self) -> (&mut [T], &mut [T]) {
-        let ptr = self.buffer.as_mut_ptr();
-
-        // NOTE(unsafe) avoid bound checks in the slicing operation
-        unsafe {
-            if self.is_empty() {
-                (&mut [], &mut [])
-            } else if self.back <= self.front {
-                (
-                    slice::from_raw_parts_mut(ptr.add(self.front) as *mut T, N - self.front),
-                    slice::from_raw_parts_mut(ptr as *mut T, self.back),
-                )
-            } else {
-                (
-                    slice::from_raw_parts_mut(
-                        ptr.add(self.front) as *mut T,
-                        self.back - self.front,
-                    ),
-                    &mut [],
-                )
-            }
-        }
-    }
-
-    /// Provides a reference to the front element, or None if the `Deque` is empty.
-    pub fn front(&self) -> Option<&T> {
-        if self.is_empty() {
-            None
-        } else {
-            Some(unsafe { &*self.buffer.get_unchecked(self.front).as_ptr() })
-        }
-    }
-
-    /// Provides a mutable reference to the front element, or None if the `Deque` is empty.
-    pub fn front_mut(&mut self) -> Option<&mut T> {
-        if self.is_empty() {
-            None
-        } else {
-            Some(unsafe { &mut *self.buffer.get_unchecked_mut(self.front).as_mut_ptr() })
-        }
-    }
-
-    /// Provides a reference to the back element, or None if the `Deque` is empty.
-    pub fn back(&self) -> Option<&T> {
-        if self.is_empty() {
-            None
-        } else {
-            let index = Self::decrement(self.back);
-            Some(unsafe { &*self.buffer.get_unchecked(index).as_ptr() })
-        }
-    }
-
-    /// Provides a mutable reference to the back element, or None if the `Deque` is empty.
-    pub fn back_mut(&mut self) -> Option<&mut T> {
-        if self.is_empty() {
-            None
-        } else {
-            let index = Self::decrement(self.back);
-            Some(unsafe { &mut *self.buffer.get_unchecked_mut(index).as_mut_ptr() })
-        }
-    }
-
-    /// Removes the item from the front of the deque and returns it, or `None` if it's empty
-    pub fn pop_front(&mut self) -> Option<T> {
-        if self.is_empty() {
-            None
-        } else {
-            Some(unsafe { self.pop_front_unchecked() })
-        }
-    }
-
-    /// Removes the item from the back of the deque and returns it, or `None` if it's empty
-    pub fn pop_back(&mut self) -> Option<T> {
-        if self.is_empty() {
-            None
-        } else {
-            Some(unsafe { self.pop_back_unchecked() })
-        }
-    }
-
-    /// Appends an `item` to the front of the deque
-    ///
-    /// Returns back the `item` if the deque is full
-    pub fn push_front(&mut self, item: T) -> Result<(), T> {
-        if self.is_full() {
-            Err(item)
-        } else {
-            unsafe { self.push_front_unchecked(item) }
-            Ok(())
-        }
-    }
-
-    /// Appends an `item` to the back of the deque
-    ///
-    /// Returns back the `item` if the deque is full
-    pub fn push_back(&mut self, item: T) -> Result<(), T> {
-        if self.is_full() {
-            Err(item)
-        } else {
-            unsafe { self.push_back_unchecked(item) }
-            Ok(())
-        }
-    }
-
-    /// Removes an item from the front of the deque and returns it, without checking that the deque
-    /// is not empty
-    ///
-    /// # Safety
-    ///
-    /// It's undefined behavior to call this on an empty deque
-    pub unsafe fn pop_front_unchecked(&mut self) -> T {
-        debug_assert!(!self.is_empty());
-
-        let index = self.front;
-        self.full = false;
-        self.front = Self::increment(self.front);
-        (self.buffer.get_unchecked_mut(index).as_ptr() as *const T).read()
-    }
-
-    /// Removes an item from the back of the deque and returns it, without checking that the deque
-    /// is not empty
-    ///
-    /// # Safety
-    ///
-    /// It's undefined behavior to call this on an empty deque
-    pub unsafe fn pop_back_unchecked(&mut self) -> T {
-        debug_assert!(!self.is_empty());
-
-        self.full = false;
-        self.back = Self::decrement(self.back);
-        (self.buffer.get_unchecked_mut(self.back).as_ptr() as *const T).read()
-    }
-
-    /// Appends an `item` to the front of the deque
-    ///
-    /// # Safety
-    ///
-    /// This assumes the deque is not full.
-    pub unsafe fn push_front_unchecked(&mut self, item: T) {
-        debug_assert!(!self.is_full());
-
-        let index = Self::decrement(self.front);
-        // NOTE: the memory slot that we are about to write to is uninitialized. We assign
-        // a `MaybeUninit` to avoid running `T`'s destructor on the uninitialized memory
-        *self.buffer.get_unchecked_mut(index) = MaybeUninit::new(item);
-        self.front = index;
-        if self.front == self.back {
-            self.full = true;
-        }
-    }
-
-    /// Appends an `item` to the back of the deque
-    ///
-    /// # Safety
-    ///
-    /// This assumes the deque is not full.
-    pub unsafe fn push_back_unchecked(&mut self, item: T) {
-        debug_assert!(!self.is_full());
-
-        // NOTE: the memory slot that we are about to write to is uninitialized. We assign
-        // a `MaybeUninit` to avoid running `T`'s destructor on the uninitialized memory
-        *self.buffer.get_unchecked_mut(self.back) = MaybeUninit::new(item);
-        self.back = Self::increment(self.back);
-        if self.front == self.back {
-            self.full = true;
-        }
-    }
-
-    /// Returns an iterator over the deque.
-    pub fn iter(&self) -> Iter<'_, T, N> {
-        let done = self.is_empty();
-        Iter {
-            _phantom: PhantomData,
-            buffer: &self.buffer as *const MaybeUninit<T>,
-            front: self.front,
-            back: self.back,
-            done,
-        }
-    }
-
-    /// Returns an iterator that allows modifying each value.
-    pub fn iter_mut(&mut self) -> IterMut<'_, T, N> {
-        let done = self.is_empty();
-        IterMut {
-            _phantom: PhantomData,
-            buffer: &mut self.buffer as *mut _ as *mut MaybeUninit<T>,
-            front: self.front,
-            back: self.back,
-            done,
-        }
-    }
-}
-
-// Trait implementations
-
-impl<T, const N: usize> Default for Deque<T, N> {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-impl<T, const N: usize> Drop for Deque<T, N> {
-    fn drop(&mut self) {
-        // safety: `self` is left in an inconsistent state but it doesn't matter since
-        // it's getting dropped. Nothing should be able to observe `self` after drop.
-        unsafe { self.drop_contents() }
-    }
-}
-
-impl<T: fmt::Debug, const N: usize> fmt::Debug for Deque<T, N> {
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        f.debug_list().entries(self).finish()
-    }
-}
-
-/// An iterator that moves out of a [`Deque`].
-///
-/// This struct is created by calling the `into_iter` method.
-///
-#[derive(Clone)]
-pub struct IntoIter<T, const N: usize> {
-    deque: Deque<T, N>,
-}
-
-impl<T, const N: usize> Iterator for IntoIter<T, N> {
-    type Item = T;
-    fn next(&mut self) -> Option<Self::Item> {
-        self.deque.pop_front()
-    }
-}
-
-impl<T, const N: usize> IntoIterator for Deque<T, N> {
-    type Item = T;
-    type IntoIter = IntoIter<T, N>;
-
-    fn into_iter(self) -> Self::IntoIter {
-        IntoIter { deque: self }
-    }
-}
-
-/// An iterator over the elements of a [`Deque`].
-///
-/// This struct is created by calling the `iter` method.
-#[derive(Clone)]
-pub struct Iter<'a, T, const N: usize> {
-    buffer: *const MaybeUninit<T>,
-    _phantom: PhantomData<&'a T>,
-    front: usize,
-    back: usize,
-    done: bool,
-}
-
-impl<'a, T, const N: usize> Iterator for Iter<'a, T, N> {
-    type Item = &'a T;
-    fn next(&mut self) -> Option<Self::Item> {
-        if self.done {
-            None
-        } else {
-            let index = self.front;
-            self.front = Deque::<T, N>::increment(self.front);
-            if self.front == self.back {
-                self.done = true;
-            }
-            Some(unsafe { &*(self.buffer.add(index) as *const T) })
-        }
-    }
-
-    fn size_hint(&self) -> (usize, Option<usize>) {
-        let len = if self.done {
-            0
-        } else if self.back <= self.front {
-            self.back + N - self.front
-        } else {
-            self.back - self.front
-        };
-
-        (len, Some(len))
-    }
-}
-
-impl<'a, T, const N: usize> DoubleEndedIterator for Iter<'a, T, N> {
-    fn next_back(&mut self) -> Option<Self::Item> {
-        if self.done {
-            None
-        } else {
-            self.back = Deque::<T, N>::decrement(self.back);
-            if self.front == self.back {
-                self.done = true;
-            }
-            Some(unsafe { &*(self.buffer.add(self.back) as *const T) })
-        }
-    }
-}
-
-impl<'a, T, const N: usize> ExactSizeIterator for Iter<'a, T, N> {}
-impl<'a, T, const N: usize> FusedIterator for Iter<'a, T, N> {}
-
-/// An iterator over the elements of a [`Deque`].
-///
-/// This struct is created by calling the `iter` method.
-pub struct IterMut<'a, T, const N: usize> {
-    buffer: *mut MaybeUninit<T>,
-    _phantom: PhantomData<&'a mut T>,
-    front: usize,
-    back: usize,
-    done: bool,
-}
-
-impl<'a, T, const N: usize> Iterator for IterMut<'a, T, N> {
-    type Item = &'a mut T;
-    fn next(&mut self) -> Option<Self::Item> {
-        if self.done {
-            None
-        } else {
-            let index = self.front;
-            self.front = Deque::<T, N>::increment(self.front);
-            if self.front == self.back {
-                self.done = true;
-            }
-            Some(unsafe { &mut *(self.buffer.add(index) as *mut T) })
-        }
-    }
-
-    fn size_hint(&self) -> (usize, Option<usize>) {
-        let len = if self.done {
-            0
-        } else if self.back <= self.front {
-            self.back + N - self.front
-        } else {
-            self.back - self.front
-        };
-
-        (len, Some(len))
-    }
-}
-
-impl<'a, T, const N: usize> DoubleEndedIterator for IterMut<'a, T, N> {
-    fn next_back(&mut self) -> Option<Self::Item> {
-        if self.done {
-            None
-        } else {
-            self.back = Deque::<T, N>::decrement(self.back);
-            if self.front == self.back {
-                self.done = true;
-            }
-            Some(unsafe { &mut *(self.buffer.add(self.back) as *mut T) })
-        }
-    }
-}
-
-impl<'a, T, const N: usize> ExactSizeIterator for IterMut<'a, T, N> {}
-impl<'a, T, const N: usize> FusedIterator for IterMut<'a, T, N> {}
-
-impl<'a, T, const N: usize> IntoIterator for &'a Deque<T, N> {
-    type Item = &'a T;
-    type IntoIter = Iter<'a, T, N>;
-
-    fn into_iter(self) -> Self::IntoIter {
-        self.iter()
-    }
-}
-
-impl<'a, T, const N: usize> IntoIterator for &'a mut Deque<T, N> {
-    type Item = &'a mut T;
-    type IntoIter = IterMut<'a, T, N>;
-
-    fn into_iter(self) -> Self::IntoIter {
-        self.iter_mut()
-    }
-}
-
-impl<T, const N: usize> Clone for Deque<T, N>
-where
-    T: Clone,
-{
-    fn clone(&self) -> Self {
-        let mut res = Deque::new();
-        for i in self {
-            // safety: the original and new deques have the same capacity, so it can
-            // not become full.
-            unsafe { res.push_back_unchecked(i.clone()) }
-        }
-        res
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use crate::Deque;
-
-    #[test]
-    fn static_new() {
-        static mut _V: Deque<i32, 4> = Deque::new();
-    }
-
-    #[test]
-    fn stack_new() {
-        let mut _v: Deque<i32, 4> = Deque::new();
-    }
-
-    #[test]
-    fn drop() {
-        droppable!();
-
-        {
-            let mut v: Deque<Droppable, 2> = Deque::new();
-            v.push_back(Droppable::new()).ok().unwrap();
-            v.push_back(Droppable::new()).ok().unwrap();
-            v.pop_front().unwrap();
-        }
-
-        assert_eq!(Droppable::count(), 0);
-
-        {
-            let mut v: Deque<Droppable, 2> = Deque::new();
-            v.push_back(Droppable::new()).ok().unwrap();
-            v.push_back(Droppable::new()).ok().unwrap();
-        }
-
-        assert_eq!(Droppable::count(), 0);
-        {
-            let mut v: Deque<Droppable, 2> = Deque::new();
-            v.push_front(Droppable::new()).ok().unwrap();
-            v.push_front(Droppable::new()).ok().unwrap();
-        }
-
-        assert_eq!(Droppable::count(), 0);
-    }
-
-    #[test]
-    fn full() {
-        let mut v: Deque<i32, 4> = Deque::new();
-
-        v.push_back(0).unwrap();
-        v.push_front(1).unwrap();
-        v.push_back(2).unwrap();
-        v.push_back(3).unwrap();
-
-        assert!(v.push_front(4).is_err());
-        assert!(v.push_back(4).is_err());
-        assert!(v.is_full());
-    }
-
-    #[test]
-    fn empty() {
-        let mut v: Deque<i32, 4> = Deque::new();
-        assert!(v.is_empty());
-
-        v.push_back(0).unwrap();
-        assert!(!v.is_empty());
-
-        v.push_front(1).unwrap();
-        assert!(!v.is_empty());
-
-        v.pop_front().unwrap();
-        v.pop_front().unwrap();
-
-        assert!(v.pop_front().is_none());
-        assert!(v.pop_back().is_none());
-        assert!(v.is_empty());
-    }
-
-    #[test]
-    fn front_back() {
-        let mut v: Deque<i32, 4> = Deque::new();
-        assert_eq!(v.front(), None);
-        assert_eq!(v.front_mut(), None);
-        assert_eq!(v.back(), None);
-        assert_eq!(v.back_mut(), None);
-
-        v.push_back(4).unwrap();
-        assert_eq!(v.front(), Some(&4));
-        assert_eq!(v.front_mut(), Some(&mut 4));
-        assert_eq!(v.back(), Some(&4));
-        assert_eq!(v.back_mut(), Some(&mut 4));
-
-        v.push_front(3).unwrap();
-        assert_eq!(v.front(), Some(&3));
-        assert_eq!(v.front_mut(), Some(&mut 3));
-        assert_eq!(v.back(), Some(&4));
-        assert_eq!(v.back_mut(), Some(&mut 4));
-
-        v.pop_back().unwrap();
-        assert_eq!(v.front(), Some(&3));
-        assert_eq!(v.front_mut(), Some(&mut 3));
-        assert_eq!(v.back(), Some(&3));
-        assert_eq!(v.back_mut(), Some(&mut 3));
-
-        v.pop_front().unwrap();
-        assert_eq!(v.front(), None);
-        assert_eq!(v.front_mut(), None);
-        assert_eq!(v.back(), None);
-        assert_eq!(v.back_mut(), None);
-    }
-
-    #[test]
-    fn iter() {
-        let mut v: Deque<i32, 4> = Deque::new();
-
-        v.push_back(0).unwrap();
-        v.push_back(1).unwrap();
-        v.push_front(2).unwrap();
-        v.push_front(3).unwrap();
-        v.pop_back().unwrap();
-        v.push_front(4).unwrap();
-
-        let mut items = v.iter();
-
-        assert_eq!(items.next(), Some(&4));
-        assert_eq!(items.next(), Some(&3));
-        assert_eq!(items.next(), Some(&2));
-        assert_eq!(items.next(), Some(&0));
-        assert_eq!(items.next(), None);
-    }
-
-    #[test]
-    fn iter_mut() {
-        let mut v: Deque<i32, 4> = Deque::new();
-
-        v.push_back(0).unwrap();
-        v.push_back(1).unwrap();
-        v.push_front(2).unwrap();
-        v.push_front(3).unwrap();
-        v.pop_back().unwrap();
-        v.push_front(4).unwrap();
-
-        let mut items = v.iter_mut();
-
-        assert_eq!(items.next(), Some(&mut 4));
-        assert_eq!(items.next(), Some(&mut 3));
-        assert_eq!(items.next(), Some(&mut 2));
-        assert_eq!(items.next(), Some(&mut 0));
-        assert_eq!(items.next(), None);
-    }
-
-    #[test]
-    fn iter_move() {
-        let mut v: Deque<i32, 4> = Deque::new();
-        v.push_back(0).unwrap();
-        v.push_back(1).unwrap();
-        v.push_back(2).unwrap();
-        v.push_back(3).unwrap();
-
-        let mut items = v.into_iter();
-
-        assert_eq!(items.next(), Some(0));
-        assert_eq!(items.next(), Some(1));
-        assert_eq!(items.next(), Some(2));
-        assert_eq!(items.next(), Some(3));
-        assert_eq!(items.next(), None);
-    }
-
-    #[test]
-    fn iter_move_drop() {
-        droppable!();
-
-        {
-            let mut deque: Deque<Droppable, 2> = Deque::new();
-            deque.push_back(Droppable::new()).ok().unwrap();
-            deque.push_back(Droppable::new()).ok().unwrap();
-            let mut items = deque.into_iter();
-            // Move all
-            let _ = items.next();
-            let _ = items.next();
-        }
-
-        assert_eq!(Droppable::count(), 0);
-
-        {
-            let mut deque: Deque<Droppable, 2> = Deque::new();
-            deque.push_back(Droppable::new()).ok().unwrap();
-            deque.push_back(Droppable::new()).ok().unwrap();
-            let _items = deque.into_iter();
-            // Move none
-        }
-
-        assert_eq!(Droppable::count(), 0);
-
-        {
-            let mut deque: Deque<Droppable, 2> = Deque::new();
-            deque.push_back(Droppable::new()).ok().unwrap();
-            deque.push_back(Droppable::new()).ok().unwrap();
-            let mut items = deque.into_iter();
-            let _ = items.next(); // Move partly
-        }
-
-        assert_eq!(Droppable::count(), 0);
-    }
-
-    #[test]
-    fn push_and_pop() {
-        let mut q: Deque<i32, 4> = Deque::new();
-        assert_eq!(q.len(), 0);
-
-        assert_eq!(q.pop_front(), None);
-        assert_eq!(q.pop_back(), None);
-        assert_eq!(q.len(), 0);
-
-        q.push_back(0).unwrap();
-        assert_eq!(q.len(), 1);
-
-        assert_eq!(q.pop_back(), Some(0));
-        assert_eq!(q.len(), 0);
-
-        q.push_back(0).unwrap();
-        q.push_back(1).unwrap();
-        q.push_front(2).unwrap();
-        q.push_front(3).unwrap();
-        assert_eq!(q.len(), 4);
-
-        // deque contains: 3 2 0 1
-        assert_eq!(q.pop_front(), Some(3));
-        assert_eq!(q.len(), 3);
-        assert_eq!(q.pop_front(), Some(2));
-        assert_eq!(q.len(), 2);
-        assert_eq!(q.pop_back(), Some(1));
-        assert_eq!(q.len(), 1);
-        assert_eq!(q.pop_front(), Some(0));
-        assert_eq!(q.len(), 0);
-
-        // deque is now empty
-        assert_eq!(q.pop_front(), None);
-        assert_eq!(q.pop_back(), None);
-        assert_eq!(q.len(), 0);
-    }
-
-    #[test]
-    fn as_slices() {
-        let mut q: Deque<i32, 4> = Deque::new();
-        assert_eq!(q.len(), 0);
-
-        q.push_back(0).unwrap();
-        q.push_back(1).unwrap();
-        q.push_back(2).unwrap();
-        q.push_back(3).unwrap();
-        assert_eq!(q.as_slices(), (&[0, 1, 2, 3][..], &[][..]));
-
-        q.pop_front().unwrap();
-        assert_eq!(q.as_slices(), (&[1, 2, 3][..], &[][..]));
-
-        q.push_back(4).unwrap();
-        assert_eq!(q.as_slices(), (&[1, 2, 3][..], &[4][..]));
-    }
-
-    #[test]
-    fn clear() {
-        let mut q: Deque<i32, 4> = Deque::new();
-        assert_eq!(q.len(), 0);
-
-        q.push_back(0).unwrap();
-        q.push_back(1).unwrap();
-        q.push_back(2).unwrap();
-        q.push_back(3).unwrap();
-        assert_eq!(q.len(), 4);
-
-        q.clear();
-        assert_eq!(q.len(), 0);
-
-        q.push_back(0).unwrap();
-        assert_eq!(q.len(), 1);
-    }
-}
-
\ No newline at end of file diff --git a/docs/doc/src/heapless/histbuf.rs.html b/docs/doc/src/heapless/histbuf.rs.html deleted file mode 100644 index 37000dd..0000000 --- a/docs/doc/src/heapless/histbuf.rs.html +++ /dev/null @@ -1,867 +0,0 @@ -histbuf.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-
use core::fmt;
-use core::mem::MaybeUninit;
-use core::ops::Deref;
-use core::ptr;
-use core::slice;
-
-/// A "history buffer", similar to a write-only ring buffer of fixed length.
-///
-/// This buffer keeps a fixed number of elements.  On write, the oldest element
-/// is overwritten. Thus, the buffer is useful to keep a history of values with
-/// some desired depth, and for example calculate a rolling average.
-///
-/// # Examples
-/// ```
-/// use heapless::HistoryBuffer;
-///
-/// // Initialize a new buffer with 8 elements.
-/// let mut buf = HistoryBuffer::<_, 8>::new();
-///
-/// // Starts with no data
-/// assert_eq!(buf.recent(), None);
-///
-/// buf.write(3);
-/// buf.write(5);
-/// buf.extend(&[4, 4]);
-///
-/// // The most recent written element is a four.
-/// assert_eq!(buf.recent(), Some(&4));
-///
-/// // To access all elements in an unspecified order, use `as_slice()`.
-/// for el in buf.as_slice() { println!("{:?}", el); }
-///
-/// // Now we can prepare an average of all values, which comes out to 4.
-/// let avg = buf.as_slice().iter().sum::<usize>() / buf.len();
-/// assert_eq!(avg, 4);
-/// ```
-pub struct HistoryBuffer<T, const N: usize> {
-    data: [MaybeUninit<T>; N],
-    write_at: usize,
-    filled: bool,
-}
-
-impl<T, const N: usize> HistoryBuffer<T, N> {
-    const INIT: MaybeUninit<T> = MaybeUninit::uninit();
-
-    /// Constructs a new history buffer.
-    ///
-    /// The construction of a `HistoryBuffer` works in `const` contexts.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::HistoryBuffer;
-    ///
-    /// // Allocate a 16-element buffer on the stack
-    /// let x: HistoryBuffer<u8, 16> = HistoryBuffer::new();
-    /// assert_eq!(x.len(), 0);
-    /// ```
-    #[inline]
-    pub const fn new() -> Self {
-        // Const assert
-        crate::sealed::greater_than_0::<N>();
-
-        Self {
-            data: [Self::INIT; N],
-            write_at: 0,
-            filled: false,
-        }
-    }
-
-    /// Clears the buffer, replacing every element with the default value of
-    /// type `T`.
-    pub fn clear(&mut self) {
-        *self = Self::new();
-    }
-}
-
-impl<T, const N: usize> HistoryBuffer<T, N>
-where
-    T: Copy + Clone,
-{
-    /// Constructs a new history buffer, where every element is the given value.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::HistoryBuffer;
-    ///
-    /// // Allocate a 16-element buffer on the stack
-    /// let mut x: HistoryBuffer<u8, 16> = HistoryBuffer::new_with(4);
-    /// // All elements are four
-    /// assert_eq!(x.as_slice(), [4; 16]);
-    /// ```
-    #[inline]
-    pub fn new_with(t: T) -> Self {
-        Self {
-            data: [MaybeUninit::new(t); N],
-            write_at: 0,
-            filled: true,
-        }
-    }
-
-    /// Clears the buffer, replacing every element with the given value.
-    pub fn clear_with(&mut self, t: T) {
-        *self = Self::new_with(t);
-    }
-}
-
-impl<T, const N: usize> HistoryBuffer<T, N> {
-    /// Returns the current fill level of the buffer.
-    #[inline]
-    pub fn len(&self) -> usize {
-        if self.filled {
-            N
-        } else {
-            self.write_at
-        }
-    }
-
-    /// Returns the capacity of the buffer, which is the length of the
-    /// underlying backing array.
-    #[inline]
-    pub fn capacity(&self) -> usize {
-        N
-    }
-
-    /// Writes an element to the buffer, overwriting the oldest value.
-    pub fn write(&mut self, t: T) {
-        if self.filled {
-            // Drop the old before we overwrite it.
-            unsafe { ptr::drop_in_place(self.data[self.write_at].as_mut_ptr()) }
-        }
-        self.data[self.write_at] = MaybeUninit::new(t);
-
-        self.write_at += 1;
-        if self.write_at == self.capacity() {
-            self.write_at = 0;
-            self.filled = true;
-        }
-    }
-
-    /// Clones and writes all elements in a slice to the buffer.
-    ///
-    /// If the slice is longer than the buffer, only the last `self.len()`
-    /// elements will actually be stored.
-    pub fn extend_from_slice(&mut self, other: &[T])
-    where
-        T: Clone,
-    {
-        for item in other {
-            self.write(item.clone());
-        }
-    }
-
-    /// Returns a reference to the most recently written value.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::HistoryBuffer;
-    ///
-    /// let mut x: HistoryBuffer<u8, 16> = HistoryBuffer::new();
-    /// x.write(4);
-    /// x.write(10);
-    /// assert_eq!(x.recent(), Some(&10));
-    /// ```
-    pub fn recent(&self) -> Option<&T> {
-        if self.write_at == 0 {
-            if self.filled {
-                Some(unsafe { &*self.data[self.capacity() - 1].as_ptr() })
-            } else {
-                None
-            }
-        } else {
-            Some(unsafe { &*self.data[self.write_at - 1].as_ptr() })
-        }
-    }
-
-    /// Returns the array slice backing the buffer, without keeping track
-    /// of the write position. Therefore, the element order is unspecified.
-    pub fn as_slice(&self) -> &[T] {
-        unsafe { slice::from_raw_parts(self.data.as_ptr() as *const _, self.len()) }
-    }
-
-    /// Returns an iterator for iterating over the buffer from oldest to newest.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::HistoryBuffer;
-    ///
-    /// let mut buffer: HistoryBuffer<u8, 6> = HistoryBuffer::new();
-    /// buffer.extend([0, 0, 0, 1, 2, 3, 4, 5, 6]);
-    /// let expected = [1, 2, 3, 4, 5, 6];
-    /// for (x, y) in buffer.oldest_ordered().zip(expected.iter()) {
-    ///     assert_eq!(x, y)
-    /// }
-    ///
-    /// ```
-    pub fn oldest_ordered<'a>(&'a self) -> OldestOrdered<'a, T, N> {
-        if self.filled {
-            OldestOrdered {
-                buf: self,
-                cur: self.write_at,
-                wrapped: false,
-            }
-        } else {
-            // special case: act like we wrapped already to handle empty buffer.
-            OldestOrdered {
-                buf: self,
-                cur: 0,
-                wrapped: true,
-            }
-        }
-    }
-}
-
-impl<T, const N: usize> Extend<T> for HistoryBuffer<T, N> {
-    fn extend<I>(&mut self, iter: I)
-    where
-        I: IntoIterator<Item = T>,
-    {
-        for item in iter.into_iter() {
-            self.write(item);
-        }
-    }
-}
-
-impl<'a, T, const N: usize> Extend<&'a T> for HistoryBuffer<T, N>
-where
-    T: 'a + Clone,
-{
-    fn extend<I>(&mut self, iter: I)
-    where
-        I: IntoIterator<Item = &'a T>,
-    {
-        self.extend(iter.into_iter().cloned())
-    }
-}
-
-impl<T, const N: usize> Drop for HistoryBuffer<T, N> {
-    fn drop(&mut self) {
-        unsafe {
-            ptr::drop_in_place(ptr::slice_from_raw_parts_mut(
-                self.data.as_mut_ptr() as *mut T,
-                self.len(),
-            ))
-        }
-    }
-}
-
-impl<T, const N: usize> Deref for HistoryBuffer<T, N> {
-    type Target = [T];
-
-    fn deref(&self) -> &[T] {
-        self.as_slice()
-    }
-}
-
-impl<T, const N: usize> AsRef<[T]> for HistoryBuffer<T, N> {
-    #[inline]
-    fn as_ref(&self) -> &[T] {
-        self
-    }
-}
-
-impl<T, const N: usize> fmt::Debug for HistoryBuffer<T, N>
-where
-    T: fmt::Debug,
-{
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        <[T] as fmt::Debug>::fmt(self, f)
-    }
-}
-
-impl<T, const N: usize> Default for HistoryBuffer<T, N> {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-/// An iterator on the underlying buffer ordered from oldest data to newest
-#[derive(Clone)]
-pub struct OldestOrdered<'a, T, const N: usize> {
-    buf: &'a HistoryBuffer<T, N>,
-    cur: usize,
-    wrapped: bool,
-}
-
-impl<'a, T, const N: usize> Iterator for OldestOrdered<'a, T, N> {
-    type Item = &'a T;
-
-    fn next(&mut self) -> Option<&'a T> {
-        if self.cur == self.buf.len() && self.buf.filled {
-            // roll-over
-            self.cur = 0;
-            self.wrapped = true;
-        }
-
-        if self.cur == self.buf.write_at && self.wrapped {
-            return None;
-        }
-
-        let item = &self.buf[self.cur];
-        self.cur += 1;
-        Some(item)
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use crate::HistoryBuffer;
-    use core::fmt::Debug;
-
-    #[test]
-    fn new() {
-        let x: HistoryBuffer<u8, 4> = HistoryBuffer::new_with(1);
-        assert_eq!(x.len(), 4);
-        assert_eq!(x.as_slice(), [1; 4]);
-        assert_eq!(*x, [1; 4]);
-
-        let x: HistoryBuffer<u8, 4> = HistoryBuffer::new();
-        assert_eq!(x.as_slice(), []);
-    }
-
-    #[test]
-    fn write() {
-        let mut x: HistoryBuffer<u8, 4> = HistoryBuffer::new();
-        x.write(1);
-        x.write(4);
-        assert_eq!(x.as_slice(), [1, 4]);
-
-        x.write(5);
-        x.write(6);
-        x.write(10);
-        assert_eq!(x.as_slice(), [10, 4, 5, 6]);
-
-        x.extend([11, 12].iter());
-        assert_eq!(x.as_slice(), [10, 11, 12, 6]);
-    }
-
-    #[test]
-    fn clear() {
-        let mut x: HistoryBuffer<u8, 4> = HistoryBuffer::new_with(1);
-        x.clear();
-        assert_eq!(x.as_slice(), []);
-
-        let mut x: HistoryBuffer<u8, 4> = HistoryBuffer::new();
-        x.clear_with(1);
-        assert_eq!(x.as_slice(), [1; 4]);
-    }
-
-    #[test]
-    fn recent() {
-        let mut x: HistoryBuffer<u8, 4> = HistoryBuffer::new();
-        assert_eq!(x.recent(), None);
-
-        x.write(1);
-        x.write(4);
-        assert_eq!(x.recent(), Some(&4));
-
-        x.write(5);
-        x.write(6);
-        x.write(10);
-        assert_eq!(x.recent(), Some(&10));
-    }
-
-    #[test]
-    fn as_slice() {
-        let mut x: HistoryBuffer<u8, 4> = HistoryBuffer::new();
-
-        assert_eq!(x.as_slice(), []);
-
-        x.extend([1, 2, 3, 4, 5].iter());
-
-        assert_eq!(x.as_slice(), [5, 2, 3, 4]);
-    }
-
-    #[test]
-    fn ordered() {
-        // test on an empty buffer
-        let buffer: HistoryBuffer<u8, 6> = HistoryBuffer::new();
-        let mut iter = buffer.oldest_ordered();
-        assert_eq!(iter.next(), None);
-        assert_eq!(iter.next(), None);
-
-        // test on a un-filled buffer
-        let mut buffer: HistoryBuffer<u8, 6> = HistoryBuffer::new();
-        buffer.extend([1, 2, 3]);
-        assert_eq!(buffer.len(), 3);
-        assert_eq_iter(buffer.oldest_ordered(), &[1, 2, 3]);
-
-        // test on a filled buffer
-        let mut buffer: HistoryBuffer<u8, 6> = HistoryBuffer::new();
-        buffer.extend([0, 0, 0, 1, 2, 3, 4, 5, 6]);
-        assert_eq!(buffer.len(), 6);
-        assert_eq_iter(buffer.oldest_ordered(), &[1, 2, 3, 4, 5, 6]);
-
-        // comprehensive test all cases
-        for n in 0..50 {
-            const N: usize = 7;
-            let mut buffer: HistoryBuffer<u8, N> = HistoryBuffer::new();
-            buffer.extend(0..n);
-            assert_eq_iter(
-                buffer.oldest_ordered().copied(),
-                n.saturating_sub(N as u8)..n,
-            );
-        }
-    }
-
-    /// Compares two iterators item by item, making sure they stop at the same time.
-    fn assert_eq_iter<I: Eq + Debug>(
-        a: impl IntoIterator<Item = I>,
-        b: impl IntoIterator<Item = I>,
-    ) {
-        let mut a = a.into_iter();
-        let mut b = b.into_iter();
-
-        let mut i = 0;
-        loop {
-            let a_item = a.next();
-            let b_item = b.next();
-
-            assert_eq!(a_item, b_item, "{}", i);
-
-            i += 1;
-
-            if b_item.is_none() {
-                break;
-            }
-        }
-    }
-}
-
\ No newline at end of file diff --git a/docs/doc/src/heapless/indexmap.rs.html b/docs/doc/src/heapless/indexmap.rs.html deleted file mode 100644 index 7dae164..0000000 --- a/docs/doc/src/heapless/indexmap.rs.html +++ /dev/null @@ -1,2763 +0,0 @@ -indexmap.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-867
-868
-869
-870
-871
-872
-873
-874
-875
-876
-877
-878
-879
-880
-881
-882
-883
-884
-885
-886
-887
-888
-889
-890
-891
-892
-893
-894
-895
-896
-897
-898
-899
-900
-901
-902
-903
-904
-905
-906
-907
-908
-909
-910
-911
-912
-913
-914
-915
-916
-917
-918
-919
-920
-921
-922
-923
-924
-925
-926
-927
-928
-929
-930
-931
-932
-933
-934
-935
-936
-937
-938
-939
-940
-941
-942
-943
-944
-945
-946
-947
-948
-949
-950
-951
-952
-953
-954
-955
-956
-957
-958
-959
-960
-961
-962
-963
-964
-965
-966
-967
-968
-969
-970
-971
-972
-973
-974
-975
-976
-977
-978
-979
-980
-981
-982
-983
-984
-985
-986
-987
-988
-989
-990
-991
-992
-993
-994
-995
-996
-997
-998
-999
-1000
-1001
-1002
-1003
-1004
-1005
-1006
-1007
-1008
-1009
-1010
-1011
-1012
-1013
-1014
-1015
-1016
-1017
-1018
-1019
-1020
-1021
-1022
-1023
-1024
-1025
-1026
-1027
-1028
-1029
-1030
-1031
-1032
-1033
-1034
-1035
-1036
-1037
-1038
-1039
-1040
-1041
-1042
-1043
-1044
-1045
-1046
-1047
-1048
-1049
-1050
-1051
-1052
-1053
-1054
-1055
-1056
-1057
-1058
-1059
-1060
-1061
-1062
-1063
-1064
-1065
-1066
-1067
-1068
-1069
-1070
-1071
-1072
-1073
-1074
-1075
-1076
-1077
-1078
-1079
-1080
-1081
-1082
-1083
-1084
-1085
-1086
-1087
-1088
-1089
-1090
-1091
-1092
-1093
-1094
-1095
-1096
-1097
-1098
-1099
-1100
-1101
-1102
-1103
-1104
-1105
-1106
-1107
-1108
-1109
-1110
-1111
-1112
-1113
-1114
-1115
-1116
-1117
-1118
-1119
-1120
-1121
-1122
-1123
-1124
-1125
-1126
-1127
-1128
-1129
-1130
-1131
-1132
-1133
-1134
-1135
-1136
-1137
-1138
-1139
-1140
-1141
-1142
-1143
-1144
-1145
-1146
-1147
-1148
-1149
-1150
-1151
-1152
-1153
-1154
-1155
-1156
-1157
-1158
-1159
-1160
-1161
-1162
-1163
-1164
-1165
-1166
-1167
-1168
-1169
-1170
-1171
-1172
-1173
-1174
-1175
-1176
-1177
-1178
-1179
-1180
-1181
-1182
-1183
-1184
-1185
-1186
-1187
-1188
-1189
-1190
-1191
-1192
-1193
-1194
-1195
-1196
-1197
-1198
-1199
-1200
-1201
-1202
-1203
-1204
-1205
-1206
-1207
-1208
-1209
-1210
-1211
-1212
-1213
-1214
-1215
-1216
-1217
-1218
-1219
-1220
-1221
-1222
-1223
-1224
-1225
-1226
-1227
-1228
-1229
-1230
-1231
-1232
-1233
-1234
-1235
-1236
-1237
-1238
-1239
-1240
-1241
-1242
-1243
-1244
-1245
-1246
-1247
-1248
-1249
-1250
-1251
-1252
-1253
-1254
-1255
-1256
-1257
-1258
-1259
-1260
-1261
-1262
-1263
-1264
-1265
-1266
-1267
-1268
-1269
-1270
-1271
-1272
-1273
-1274
-1275
-1276
-1277
-1278
-1279
-1280
-1281
-1282
-1283
-1284
-1285
-1286
-1287
-1288
-1289
-1290
-1291
-1292
-1293
-1294
-1295
-1296
-1297
-1298
-1299
-1300
-1301
-1302
-1303
-1304
-1305
-1306
-1307
-1308
-1309
-1310
-1311
-1312
-1313
-1314
-1315
-1316
-1317
-1318
-1319
-1320
-1321
-1322
-1323
-1324
-1325
-1326
-1327
-1328
-1329
-1330
-1331
-1332
-1333
-1334
-1335
-1336
-1337
-1338
-1339
-1340
-1341
-1342
-1343
-1344
-1345
-1346
-1347
-1348
-1349
-1350
-1351
-1352
-1353
-1354
-1355
-1356
-1357
-1358
-1359
-1360
-1361
-1362
-1363
-1364
-1365
-1366
-1367
-1368
-1369
-1370
-1371
-1372
-1373
-1374
-1375
-1376
-1377
-1378
-1379
-1380
-1381
-
use core::{borrow::Borrow, fmt, iter::FromIterator, mem, num::NonZeroU32, ops, slice};
-
-use hash32::{BuildHasher, BuildHasherDefault, FnvHasher, Hash, Hasher};
-
-use crate::Vec;
-
-/// A [`heapless::IndexMap`](./struct.IndexMap.html) using the default FNV hasher
-///
-/// A list of all Methods and Traits available for `FnvIndexMap` can be found in
-/// the [`heapless::IndexMap`](./struct.IndexMap.html) documentation.
-///
-/// # Examples
-/// ```
-/// use heapless::FnvIndexMap;
-///
-/// // A hash map with a capacity of 16 key-value pairs allocated on the stack
-/// let mut book_reviews = FnvIndexMap::<_, _, 16>::new();
-///
-/// // review some books.
-/// book_reviews.insert("Adventures of Huckleberry Finn",    "My favorite book.").unwrap();
-/// book_reviews.insert("Grimms' Fairy Tales",               "Masterpiece.").unwrap();
-/// book_reviews.insert("Pride and Prejudice",               "Very enjoyable.").unwrap();
-/// book_reviews.insert("The Adventures of Sherlock Holmes", "Eye lyked it alot.").unwrap();
-///
-/// // check for a specific one.
-/// if !book_reviews.contains_key("Les Misérables") {
-///     println!("We've got {} reviews, but Les Misérables ain't one.",
-///              book_reviews.len());
-/// }
-///
-/// // oops, this review has a lot of spelling mistakes, let's delete it.
-/// book_reviews.remove("The Adventures of Sherlock Holmes");
-///
-/// // look up the values associated with some keys.
-/// let to_find = ["Pride and Prejudice", "Alice's Adventure in Wonderland"];
-/// for book in &to_find {
-///     match book_reviews.get(book) {
-///         Some(review) => println!("{}: {}", book, review),
-///         None => println!("{} is unreviewed.", book)
-///     }
-/// }
-///
-/// // iterate over everything.
-/// for (book, review) in &book_reviews {
-///     println!("{}: \"{}\"", book, review);
-/// }
-/// ```
-pub type FnvIndexMap<K, V, const N: usize> = IndexMap<K, V, BuildHasherDefault<FnvHasher>, N>;
-
-#[derive(Clone, Copy, Eq, PartialEq)]
-struct HashValue(u16);
-
-impl HashValue {
-    fn desired_pos(&self, mask: usize) -> usize {
-        usize::from(self.0) & mask
-    }
-
-    fn probe_distance(&self, mask: usize, current: usize) -> usize {
-        current.wrapping_sub(self.desired_pos(mask) as usize) & mask
-    }
-}
-
-#[doc(hidden)]
-#[derive(Clone)]
-pub struct Bucket<K, V> {
-    hash: HashValue,
-    key: K,
-    value: V,
-}
-
-#[doc(hidden)]
-#[derive(Clone, Copy, PartialEq)]
-pub struct Pos {
-    // compact representation of `{ hash_value: u16, index: u16 }`
-    // To get the most from `NonZero` we store the *value minus 1*. This way `None::Option<Pos>`
-    // is equivalent to the very unlikely value of  `{ hash_value: 0xffff, index: 0xffff }` instead
-    // the more likely of `{ hash_value: 0x00, index: 0x00 }`
-    nz: NonZeroU32,
-}
-
-impl Pos {
-    fn new(index: usize, hash: HashValue) -> Self {
-        Pos {
-            nz: unsafe {
-                NonZeroU32::new_unchecked(
-                    ((u32::from(hash.0) << 16) + index as u32).wrapping_add(1),
-                )
-            },
-        }
-    }
-
-    fn hash(&self) -> HashValue {
-        HashValue((self.nz.get().wrapping_sub(1) >> 16) as u16)
-    }
-
-    fn index(&self) -> usize {
-        self.nz.get().wrapping_sub(1) as u16 as usize
-    }
-}
-
-enum Insert<K, V> {
-    Success(Inserted<V>),
-    Full((K, V)),
-}
-struct Inserted<V> {
-    index: usize,
-    old_value: Option<V>,
-}
-
-macro_rules! probe_loop {
-    ($probe_var: ident < $len: expr, $body: expr) => {
-        loop {
-            if $probe_var < $len {
-                $body
-                    $probe_var += 1;
-            } else {
-                $probe_var = 0;
-            }
-        }
-    }
-}
-
-struct CoreMap<K, V, const N: usize> {
-    entries: Vec<Bucket<K, V>, N>,
-    indices: [Option<Pos>; N],
-}
-
-impl<K, V, const N: usize> CoreMap<K, V, N> {
-    const fn new() -> Self {
-        const INIT: Option<Pos> = None;
-
-        CoreMap {
-            entries: Vec::new(),
-            indices: [INIT; N],
-        }
-    }
-}
-
-impl<K, V, const N: usize> CoreMap<K, V, N>
-where
-    K: Eq + Hash,
-{
-    fn capacity() -> usize {
-        N
-    }
-
-    fn mask() -> usize {
-        Self::capacity() - 1
-    }
-
-    fn find<Q>(&self, hash: HashValue, query: &Q) -> Option<(usize, usize)>
-    where
-        K: Borrow<Q>,
-        Q: ?Sized + Eq,
-    {
-        let mut probe = hash.desired_pos(Self::mask());
-        let mut dist = 0;
-
-        probe_loop!(probe < self.indices.len(), {
-            if let Some(pos) = self.indices[probe] {
-                let entry_hash = pos.hash();
-                // NOTE(i) we use unchecked indexing below
-                let i = pos.index();
-                debug_assert!(i < self.entries.len());
-
-                if dist > entry_hash.probe_distance(Self::mask(), probe) {
-                    // give up when probe distance is too long
-                    return None;
-                } else if entry_hash == hash
-                    && unsafe { self.entries.get_unchecked(i).key.borrow() == query }
-                {
-                    return Some((probe, i));
-                }
-            } else {
-                return None;
-            }
-
-            dist += 1;
-        });
-    }
-
-    fn insert(&mut self, hash: HashValue, key: K, value: V) -> Insert<K, V> {
-        let mut probe = hash.desired_pos(Self::mask());
-        let mut dist = 0;
-
-        probe_loop!(probe < self.indices.len(), {
-            let pos = &mut self.indices[probe];
-
-            if let Some(pos) = *pos {
-                let entry_hash = pos.hash();
-                // NOTE(i) we use unchecked indexing below
-                let i = pos.index();
-                debug_assert!(i < self.entries.len());
-
-                let their_dist = entry_hash.probe_distance(Self::mask(), probe);
-
-                if their_dist < dist {
-                    if self.entries.is_full() {
-                        return Insert::Full((key, value));
-                    }
-                    // robin hood: steal the spot if it's better for us
-                    let index = self.entries.len();
-                    unsafe { self.entries.push_unchecked(Bucket { hash, key, value }) };
-                    return Insert::Success(Inserted {
-                        index: self.insert_phase_2(probe, Pos::new(index, hash)),
-                        old_value: None,
-                    });
-                } else if entry_hash == hash && unsafe { self.entries.get_unchecked(i).key == key }
-                {
-                    return Insert::Success(Inserted {
-                        index: i,
-                        old_value: Some(mem::replace(
-                            unsafe { &mut self.entries.get_unchecked_mut(i).value },
-                            value,
-                        )),
-                    });
-                }
-            } else {
-                if self.entries.is_full() {
-                    return Insert::Full((key, value));
-                }
-                // empty bucket, insert here
-                let index = self.entries.len();
-                *pos = Some(Pos::new(index, hash));
-                unsafe { self.entries.push_unchecked(Bucket { hash, key, value }) };
-                return Insert::Success(Inserted {
-                    index,
-                    old_value: None,
-                });
-            }
-            dist += 1;
-        });
-    }
-
-    // phase 2 is post-insert where we forward-shift `Pos` in the indices.
-    fn insert_phase_2(&mut self, mut probe: usize, mut old_pos: Pos) -> usize {
-        probe_loop!(probe < self.indices.len(), {
-            let pos = unsafe { self.indices.get_unchecked_mut(probe) };
-
-            let mut is_none = true; // work around lack of NLL
-            if let Some(pos) = pos.as_mut() {
-                old_pos = mem::replace(pos, old_pos);
-                is_none = false;
-            }
-
-            if is_none {
-                *pos = Some(old_pos);
-                return probe;
-            }
-        });
-    }
-
-    fn remove_found(&mut self, probe: usize, found: usize) -> (K, V) {
-        // index `probe` and entry `found` is to be removed
-        // use swap_remove, but then we need to update the index that points
-        // to the other entry that has to move
-        self.indices[probe] = None;
-        let entry = unsafe { self.entries.swap_remove_unchecked(found) };
-
-        // correct index that points to the entry that had to swap places
-        if let Some(entry) = self.entries.get(found) {
-            // was not last element
-            // examine new element in `found` and find it in indices
-            let mut probe = entry.hash.desired_pos(Self::mask());
-
-            probe_loop!(probe < self.indices.len(), {
-                if let Some(pos) = self.indices[probe] {
-                    if pos.index() >= self.entries.len() {
-                        // found it
-                        self.indices[probe] = Some(Pos::new(found, entry.hash));
-                        break;
-                    }
-                }
-            });
-        }
-
-        self.backward_shift_after_removal(probe);
-
-        (entry.key, entry.value)
-    }
-
-    fn backward_shift_after_removal(&mut self, probe_at_remove: usize) {
-        // backward shift deletion in self.indices
-        // after probe, shift all non-ideally placed indices backward
-        let mut last_probe = probe_at_remove;
-        let mut probe = probe_at_remove + 1;
-
-        probe_loop!(probe < self.indices.len(), {
-            if let Some(pos) = self.indices[probe] {
-                let entry_hash = pos.hash();
-
-                if entry_hash.probe_distance(Self::mask(), probe) > 0 {
-                    unsafe { *self.indices.get_unchecked_mut(last_probe) = self.indices[probe] }
-                    self.indices[probe] = None;
-                } else {
-                    break;
-                }
-            } else {
-                break;
-            }
-            last_probe = probe;
-        });
-    }
-}
-
-impl<K, V, const N: usize> Clone for CoreMap<K, V, N>
-where
-    K: Eq + Hash + Clone,
-    V: Clone,
-{
-    fn clone(&self) -> Self {
-        Self {
-            entries: self.entries.clone(),
-            indices: self.indices.clone(),
-        }
-    }
-}
-
-/// A view into an entry in the map
-pub enum Entry<'a, K, V, const N: usize> {
-    /// The entry corresponding to the key `K` exists in the map
-    Occupied(OccupiedEntry<'a, K, V, N>),
-    /// The entry corresponding to the key `K` does not exist in the map
-    Vacant(VacantEntry<'a, K, V, N>),
-}
-
-/// An occupied entry which can be manipulated
-pub struct OccupiedEntry<'a, K, V, const N: usize> {
-    key: K,
-    probe: usize,
-    pos: usize,
-    core: &'a mut CoreMap<K, V, N>,
-}
-
-impl<'a, K, V, const N: usize> OccupiedEntry<'a, K, V, N>
-where
-    K: Eq + Hash,
-{
-    /// Gets a reference to the key that this entity corresponds to
-    pub fn key(&self) -> &K {
-        &self.key
-    }
-
-    /// Removes this entry from the map and yields its corresponding key and value
-    pub fn remove_entry(self) -> (K, V) {
-        self.core.remove_found(self.probe, self.pos)
-    }
-
-    /// Gets a reference to the value associated with this entry
-    pub fn get(&self) -> &V {
-        // SAFETY: Already checked existence at instantiation and the only mutable reference
-        // to the map is internally held.
-        unsafe { &self.core.entries.get_unchecked(self.pos).value }
-    }
-
-    /// Gets a mutable reference to the value associated with this entry
-    pub fn get_mut(&mut self) -> &mut V {
-        // SAFETY: Already checked existence at instantiation and the only mutable reference
-        // to the map is internally held.
-        unsafe { &mut self.core.entries.get_unchecked_mut(self.pos).value }
-    }
-
-    /// Consumes this entry and yields a reference to the underlying value
-    pub fn into_mut(self) -> &'a mut V {
-        // SAFETY: Already checked existence at instantiation and the only mutable reference
-        // to the map is internally held.
-        unsafe { &mut self.core.entries.get_unchecked_mut(self.pos).value }
-    }
-
-    /// Overwrites the underlying map's value with this entry's value
-    pub fn insert(self, value: V) -> V {
-        // SAFETY: Already checked existence at instantiation and the only mutable reference
-        // to the map is internally held.
-        unsafe {
-            mem::replace(
-                &mut self.core.entries.get_unchecked_mut(self.pos).value,
-                value,
-            )
-        }
-    }
-
-    /// Removes this entry from the map and yields its value
-    pub fn remove(self) -> V {
-        self.remove_entry().1
-    }
-}
-
-/// A view into an empty slot in the underlying map
-pub struct VacantEntry<'a, K, V, const N: usize> {
-    key: K,
-    hash_val: HashValue,
-    core: &'a mut CoreMap<K, V, N>,
-}
-impl<'a, K, V, const N: usize> VacantEntry<'a, K, V, N>
-where
-    K: Eq + Hash,
-{
-    /// Get the key associated with this entry
-    pub fn key(&self) -> &K {
-        &self.key
-    }
-
-    /// Consumes this entry to yield to key associated with it
-    pub fn into_key(self) -> K {
-        self.key
-    }
-
-    /// Inserts this entry into to underlying map, yields a mutable reference to the inserted value.
-    /// If the map is at capacity the value is returned instead.
-    pub fn insert(self, value: V) -> Result<&'a mut V, V> {
-        if self.core.entries.is_full() {
-            Err(value)
-        } else {
-            match self.core.insert(self.hash_val, self.key, value) {
-                Insert::Success(inserted) => {
-                    unsafe {
-                        // SAFETY: Already checked existence at instantiation and the only mutable reference
-                        // to the map is internally held.
-                        Ok(&mut (*self.core.entries.as_mut_ptr().add(inserted.index)).value)
-                    }
-                }
-                Insert::Full((_, v)) => Err(v),
-            }
-        }
-    }
-}
-
-/// Fixed capacity [`IndexMap`](https://docs.rs/indexmap/1/indexmap/map/struct.IndexMap.html)
-///
-/// Note that you cannot use `IndexMap` directly, since it is generic around the hashing algorithm
-/// in use. Pick a concrete instantiation like [`FnvIndexMap`](./type.FnvIndexMap.html) instead
-/// or create your own.
-///
-/// Note that the capacity of the `IndexMap` must be a power of 2.
-///
-/// # Examples
-/// Since `IndexMap` cannot be used directly, we're using its `FnvIndexMap` instantiation
-/// for this example.
-///
-/// ```
-/// use heapless::FnvIndexMap;
-///
-/// // A hash map with a capacity of 16 key-value pairs allocated on the stack
-/// let mut book_reviews = FnvIndexMap::<_, _, 16>::new();
-///
-/// // review some books.
-/// book_reviews.insert("Adventures of Huckleberry Finn",    "My favorite book.").unwrap();
-/// book_reviews.insert("Grimms' Fairy Tales",               "Masterpiece.").unwrap();
-/// book_reviews.insert("Pride and Prejudice",               "Very enjoyable.").unwrap();
-/// book_reviews.insert("The Adventures of Sherlock Holmes", "Eye lyked it alot.").unwrap();
-///
-/// // check for a specific one.
-/// if !book_reviews.contains_key("Les Misérables") {
-///     println!("We've got {} reviews, but Les Misérables ain't one.",
-///              book_reviews.len());
-/// }
-///
-/// // oops, this review has a lot of spelling mistakes, let's delete it.
-/// book_reviews.remove("The Adventures of Sherlock Holmes");
-///
-/// // look up the values associated with some keys.
-/// let to_find = ["Pride and Prejudice", "Alice's Adventure in Wonderland"];
-/// for book in &to_find {
-///     match book_reviews.get(book) {
-///         Some(review) => println!("{}: {}", book, review),
-///         None => println!("{} is unreviewed.", book)
-///     }
-/// }
-///
-/// // iterate over everything.
-/// for (book, review) in &book_reviews {
-///     println!("{}: \"{}\"", book, review);
-/// }
-/// ```
-pub struct IndexMap<K, V, S, const N: usize> {
-    core: CoreMap<K, V, N>,
-    build_hasher: S,
-}
-
-impl<K, V, S, const N: usize> IndexMap<K, V, BuildHasherDefault<S>, N> {
-    /// Creates an empty `IndexMap`.
-    pub const fn new() -> Self {
-        // Const assert
-        crate::sealed::greater_than_1::<N>();
-        crate::sealed::power_of_two::<N>();
-
-        IndexMap {
-            build_hasher: BuildHasherDefault::new(),
-            core: CoreMap::new(),
-        }
-    }
-}
-
-impl<K, V, S, const N: usize> IndexMap<K, V, S, N>
-where
-    K: Eq + Hash,
-    S: BuildHasher,
-{
-    /* Public API */
-    /// Returns the number of elements the map can hold
-    pub fn capacity(&self) -> usize {
-        N
-    }
-
-    /// Return an iterator over the keys of the map, in their order
-    ///
-    /// ```
-    /// use heapless::FnvIndexMap;
-    ///
-    /// let mut map = FnvIndexMap::<_, _, 16>::new();
-    /// map.insert("a", 1).unwrap();
-    /// map.insert("b", 2).unwrap();
-    /// map.insert("c", 3).unwrap();
-    ///
-    /// for key in map.keys() {
-    ///     println!("{}", key);
-    /// }
-    /// ```
-    pub fn keys(&self) -> impl Iterator<Item = &K> {
-        self.core.entries.iter().map(|bucket| &bucket.key)
-    }
-
-    /// Return an iterator over the values of the map, in their order
-    ///
-    /// ```
-    /// use heapless::FnvIndexMap;
-    ///
-    /// let mut map = FnvIndexMap::<_, _, 16>::new();
-    /// map.insert("a", 1).unwrap();
-    /// map.insert("b", 2).unwrap();
-    /// map.insert("c", 3).unwrap();
-    ///
-    /// for val in map.values() {
-    ///     println!("{}", val);
-    /// }
-    /// ```
-    pub fn values(&self) -> impl Iterator<Item = &V> {
-        self.core.entries.iter().map(|bucket| &bucket.value)
-    }
-
-    /// Return an iterator over mutable references to the the values of the map, in their order
-    ///
-    /// ```
-    /// use heapless::FnvIndexMap;
-    ///
-    /// let mut map = FnvIndexMap::<_, _, 16>::new();
-    /// map.insert("a", 1).unwrap();
-    /// map.insert("b", 2).unwrap();
-    /// map.insert("c", 3).unwrap();
-    ///
-    /// for val in map.values_mut() {
-    ///     *val += 10;
-    /// }
-    ///
-    /// for val in map.values() {
-    ///     println!("{}", val);
-    /// }
-    /// ```
-    pub fn values_mut(&mut self) -> impl Iterator<Item = &mut V> {
-        self.core.entries.iter_mut().map(|bucket| &mut bucket.value)
-    }
-
-    /// Return an iterator over the key-value pairs of the map, in their order
-    ///
-    /// ```
-    /// use heapless::FnvIndexMap;
-    ///
-    /// let mut map = FnvIndexMap::<_, _, 16>::new();
-    /// map.insert("a", 1).unwrap();
-    /// map.insert("b", 2).unwrap();
-    /// map.insert("c", 3).unwrap();
-    ///
-    /// for (key, val) in map.iter() {
-    ///     println!("key: {} val: {}", key, val);
-    /// }
-    /// ```
-    pub fn iter(&self) -> Iter<'_, K, V> {
-        Iter {
-            iter: self.core.entries.iter(),
-        }
-    }
-
-    /// Return an iterator over the key-value pairs of the map, in their order
-    ///
-    /// ```
-    /// use heapless::FnvIndexMap;
-    ///
-    /// let mut map = FnvIndexMap::<_, _, 16>::new();
-    /// map.insert("a", 1).unwrap();
-    /// map.insert("b", 2).unwrap();
-    /// map.insert("c", 3).unwrap();
-    ///
-    /// for (_, val) in map.iter_mut() {
-    ///     *val = 2;
-    /// }
-    ///
-    /// for (key, val) in &map {
-    ///     println!("key: {} val: {}", key, val);
-    /// }
-    /// ```
-    pub fn iter_mut(&mut self) -> IterMut<'_, K, V> {
-        IterMut {
-            iter: self.core.entries.iter_mut(),
-        }
-    }
-
-    /// Get the first key-value pair
-    ///
-    /// Computes in **O(1)** time
-    pub fn first(&self) -> Option<(&K, &V)> {
-        self.core
-            .entries
-            .first()
-            .map(|bucket| (&bucket.key, &bucket.value))
-    }
-
-    /// Get the first key-value pair, with mutable access to the value
-    ///
-    /// Computes in **O(1)** time
-    pub fn first_mut(&mut self) -> Option<(&K, &mut V)> {
-        self.core
-            .entries
-            .first_mut()
-            .map(|bucket| (&bucket.key, &mut bucket.value))
-    }
-
-    /// Get the last key-value pair
-    ///
-    /// Computes in **O(1)** time
-    pub fn last(&self) -> Option<(&K, &V)> {
-        self.core
-            .entries
-            .last()
-            .map(|bucket| (&bucket.key, &bucket.value))
-    }
-
-    /// Get the last key-value pair, with mutable access to the value
-    ///
-    /// Computes in **O(1)** time
-    pub fn last_mut(&mut self) -> Option<(&K, &mut V)> {
-        self.core
-            .entries
-            .last_mut()
-            .map(|bucket| (&bucket.key, &mut bucket.value))
-    }
-
-    /// Returns an entry for the corresponding key
-    /// ```
-    /// use heapless::FnvIndexMap;
-    /// use heapless::Entry;
-    /// let mut map = FnvIndexMap::<_, _, 16>::new();
-    /// if let Entry::Vacant(v) = map.entry("a") {
-    ///     v.insert(1).unwrap();
-    /// }
-    /// if let Entry::Occupied(mut o) = map.entry("a") {
-    ///     println!("found {}", *o.get()); // Prints 1
-    ///     o.insert(2);
-    /// }
-    /// // Prints 2
-    /// println!("val: {}", *map.get("a").unwrap());
-    /// ```
-    pub fn entry(&mut self, key: K) -> Entry<'_, K, V, N> {
-        let hash_val = hash_with(&key, &self.build_hasher);
-        if let Some((probe, pos)) = self.core.find(hash_val, &key) {
-            Entry::Occupied(OccupiedEntry {
-                key,
-                probe,
-                pos,
-                core: &mut self.core,
-            })
-        } else {
-            Entry::Vacant(VacantEntry {
-                key,
-                hash_val,
-                core: &mut self.core,
-            })
-        }
-    }
-
-    /// Return the number of key-value pairs in the map.
-    ///
-    /// Computes in **O(1)** time.
-    ///
-    /// ```
-    /// use heapless::FnvIndexMap;
-    ///
-    /// let mut a = FnvIndexMap::<_, _, 16>::new();
-    /// assert_eq!(a.len(), 0);
-    /// a.insert(1, "a").unwrap();
-    /// assert_eq!(a.len(), 1);
-    /// ```
-    pub fn len(&self) -> usize {
-        self.core.entries.len()
-    }
-
-    /// Returns true if the map contains no elements.
-    ///
-    /// Computes in **O(1)** time.
-    ///
-    /// ```
-    /// use heapless::FnvIndexMap;
-    ///
-    /// let mut a = FnvIndexMap::<_, _, 16>::new();
-    /// assert!(a.is_empty());
-    /// a.insert(1, "a");
-    /// assert!(!a.is_empty());
-    /// ```
-    pub fn is_empty(&self) -> bool {
-        self.len() == 0
-    }
-
-    /// Remove all key-value pairs in the map, while preserving its capacity.
-    ///
-    /// Computes in **O(n)** time.
-    ///
-    /// ```
-    /// use heapless::FnvIndexMap;
-    ///
-    /// let mut a = FnvIndexMap::<_, _, 16>::new();
-    /// a.insert(1, "a");
-    /// a.clear();
-    /// assert!(a.is_empty());
-    /// ```
-    pub fn clear(&mut self) {
-        self.core.entries.clear();
-        for pos in self.core.indices.iter_mut() {
-            *pos = None;
-        }
-    }
-
-    /// Returns a reference to the value corresponding to the key.
-    ///
-    /// The key may be any borrowed form of the map's key type, but `Hash` and `Eq` on the borrowed
-    /// form *must* match those for the key type.
-    ///
-    /// Computes in **O(1)** time (average).
-    ///
-    /// ```
-    /// use heapless::FnvIndexMap;
-    ///
-    /// let mut map = FnvIndexMap::<_, _, 16>::new();
-    /// map.insert(1, "a").unwrap();
-    /// assert_eq!(map.get(&1), Some(&"a"));
-    /// assert_eq!(map.get(&2), None);
-    /// ```
-    pub fn get<Q>(&self, key: &Q) -> Option<&V>
-    where
-        K: Borrow<Q>,
-        Q: ?Sized + Hash + Eq,
-    {
-        self.find(key)
-            .map(|(_, found)| unsafe { &self.core.entries.get_unchecked(found).value })
-    }
-
-    /// Returns true if the map contains a value for the specified key.
-    ///
-    /// The key may be any borrowed form of the map's key type, but `Hash` and `Eq` on the borrowed
-    /// form *must* match those for the key type.
-    ///
-    /// Computes in **O(1)** time (average).
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexMap;
-    ///
-    /// let mut map = FnvIndexMap::<_, _, 8>::new();
-    /// map.insert(1, "a").unwrap();
-    /// assert_eq!(map.contains_key(&1), true);
-    /// assert_eq!(map.contains_key(&2), false);
-    /// ```
-    pub fn contains_key<Q>(&self, key: &Q) -> bool
-    where
-        K: Borrow<Q>,
-        Q: ?Sized + Eq + Hash,
-    {
-        self.find(key).is_some()
-    }
-
-    /// Returns a mutable reference to the value corresponding to the key.
-    ///
-    /// The key may be any borrowed form of the map's key type, but `Hash` and `Eq` on the borrowed
-    /// form *must* match those for the key type.
-    ///
-    /// Computes in **O(1)** time (average).
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexMap;
-    ///
-    /// let mut map = FnvIndexMap::<_, _, 8>::new();
-    /// map.insert(1, "a").unwrap();
-    /// if let Some(x) = map.get_mut(&1) {
-    ///     *x = "b";
-    /// }
-    /// assert_eq!(map[&1], "b");
-    /// ```
-    pub fn get_mut<'v, Q>(&'v mut self, key: &Q) -> Option<&'v mut V>
-    where
-        K: Borrow<Q>,
-        Q: ?Sized + Hash + Eq,
-    {
-        if let Some((_, found)) = self.find(key) {
-            Some(unsafe { &mut self.core.entries.get_unchecked_mut(found).value })
-        } else {
-            None
-        }
-    }
-
-    /// Inserts a key-value pair into the map.
-    ///
-    /// If an equivalent key already exists in the map: the key remains and retains in its place in
-    /// the order, its corresponding value is updated with `value` and the older value is returned
-    /// inside `Some(_)`.
-    ///
-    /// If no equivalent key existed in the map: the new key-value pair is inserted, last in order,
-    /// and `None` is returned.
-    ///
-    /// Computes in **O(1)** time (average).
-    ///
-    /// See also entry if you you want to insert or modify or if you need to get the index of the
-    /// corresponding key-value pair.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexMap;
-    ///
-    /// let mut map = FnvIndexMap::<_, _, 8>::new();
-    /// assert_eq!(map.insert(37, "a"), Ok(None));
-    /// assert_eq!(map.is_empty(), false);
-    ///
-    /// map.insert(37, "b");
-    /// assert_eq!(map.insert(37, "c"), Ok(Some("b")));
-    /// assert_eq!(map[&37], "c");
-    /// ```
-    pub fn insert(&mut self, key: K, value: V) -> Result<Option<V>, (K, V)> {
-        let hash = hash_with(&key, &self.build_hasher);
-        match self.core.insert(hash, key, value) {
-            Insert::Success(inserted) => Ok(inserted.old_value),
-            Insert::Full((k, v)) => Err((k, v)),
-        }
-    }
-
-    /// Same as [`swap_remove`](struct.IndexMap.html#method.swap_remove)
-    ///
-    /// Computes in **O(1)** time (average).
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexMap;
-    ///
-    /// let mut map = FnvIndexMap::<_, _, 8>::new();
-    /// map.insert(1, "a").unwrap();
-    /// assert_eq!(map.remove(&1), Some("a"));
-    /// assert_eq!(map.remove(&1), None);
-    /// ```
-    pub fn remove<Q>(&mut self, key: &Q) -> Option<V>
-    where
-        K: Borrow<Q>,
-        Q: ?Sized + Hash + Eq,
-    {
-        self.swap_remove(key)
-    }
-
-    /// Remove the key-value pair equivalent to `key` and return its value.
-    ///
-    /// Like `Vec::swap_remove`, the pair is removed by swapping it with the last element of the map
-    /// and popping it off. **This perturbs the postion of what used to be the last element!**
-    ///
-    /// Return `None` if `key` is not in map.
-    ///
-    /// Computes in **O(1)** time (average).
-    pub fn swap_remove<Q>(&mut self, key: &Q) -> Option<V>
-    where
-        K: Borrow<Q>,
-        Q: ?Sized + Hash + Eq,
-    {
-        self.find(key)
-            .map(|(probe, found)| self.core.remove_found(probe, found).1)
-    }
-
-    /* Private API */
-    /// Return probe (indices) and position (entries)
-    fn find<Q>(&self, key: &Q) -> Option<(usize, usize)>
-    where
-        K: Borrow<Q>,
-        Q: ?Sized + Hash + Eq,
-    {
-        if self.len() == 0 {
-            return None;
-        }
-        let h = hash_with(key, &self.build_hasher);
-        self.core.find(h, key)
-    }
-}
-
-impl<'a, K, Q, V, S, const N: usize> ops::Index<&'a Q> for IndexMap<K, V, S, N>
-where
-    K: Eq + Hash + Borrow<Q>,
-    Q: ?Sized + Eq + Hash,
-    S: BuildHasher,
-{
-    type Output = V;
-
-    fn index(&self, key: &Q) -> &V {
-        self.get(key).expect("key not found")
-    }
-}
-
-impl<'a, K, Q, V, S, const N: usize> ops::IndexMut<&'a Q> for IndexMap<K, V, S, N>
-where
-    K: Eq + Hash + Borrow<Q>,
-    Q: ?Sized + Eq + Hash,
-    S: BuildHasher,
-{
-    fn index_mut(&mut self, key: &Q) -> &mut V {
-        self.get_mut(key).expect("key not found")
-    }
-}
-
-impl<K, V, S, const N: usize> Clone for IndexMap<K, V, S, N>
-where
-    K: Eq + Hash + Clone,
-    V: Clone,
-    S: Clone,
-{
-    fn clone(&self) -> Self {
-        Self {
-            core: self.core.clone(),
-            build_hasher: self.build_hasher.clone(),
-        }
-    }
-}
-
-impl<K, V, S, const N: usize> fmt::Debug for IndexMap<K, V, S, N>
-where
-    K: Eq + Hash + fmt::Debug,
-    V: fmt::Debug,
-    S: BuildHasher,
-{
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        f.debug_map().entries(self.iter()).finish()
-    }
-}
-
-impl<K, V, S, const N: usize> Default for IndexMap<K, V, S, N>
-where
-    K: Eq + Hash,
-    S: BuildHasher + Default,
-{
-    fn default() -> Self {
-        // Const assert
-        crate::sealed::greater_than_1::<N>();
-        crate::sealed::power_of_two::<N>();
-
-        IndexMap {
-            build_hasher: <_>::default(),
-            core: CoreMap::new(),
-        }
-    }
-}
-
-impl<K, V, S, S2, const N: usize, const N2: usize> PartialEq<IndexMap<K, V, S2, N2>>
-    for IndexMap<K, V, S, N>
-where
-    K: Eq + Hash,
-    V: Eq,
-    S: BuildHasher,
-    S2: BuildHasher,
-{
-    fn eq(&self, other: &IndexMap<K, V, S2, N2>) -> bool {
-        self.len() == other.len()
-            && self
-                .iter()
-                .all(|(key, value)| other.get(key).map_or(false, |v| *value == *v))
-    }
-}
-
-impl<K, V, S, const N: usize> Eq for IndexMap<K, V, S, N>
-where
-    K: Eq + Hash,
-    V: Eq,
-    S: BuildHasher,
-{
-}
-
-impl<K, V, S, const N: usize> Extend<(K, V)> for IndexMap<K, V, S, N>
-where
-    K: Eq + Hash,
-    S: BuildHasher,
-{
-    fn extend<I>(&mut self, iterable: I)
-    where
-        I: IntoIterator<Item = (K, V)>,
-    {
-        for (k, v) in iterable {
-            self.insert(k, v).ok().unwrap();
-        }
-    }
-}
-
-impl<'a, K, V, S, const N: usize> Extend<(&'a K, &'a V)> for IndexMap<K, V, S, N>
-where
-    K: Eq + Hash + Copy,
-    V: Copy,
-    S: BuildHasher,
-{
-    fn extend<I>(&mut self, iterable: I)
-    where
-        I: IntoIterator<Item = (&'a K, &'a V)>,
-    {
-        self.extend(iterable.into_iter().map(|(&key, &value)| (key, value)))
-    }
-}
-
-impl<K, V, S, const N: usize> FromIterator<(K, V)> for IndexMap<K, V, S, N>
-where
-    K: Eq + Hash,
-    S: BuildHasher + Default,
-{
-    fn from_iter<I>(iterable: I) -> Self
-    where
-        I: IntoIterator<Item = (K, V)>,
-    {
-        let mut map = IndexMap::default();
-        map.extend(iterable);
-        map
-    }
-}
-
-#[derive(Clone)]
-pub struct IntoIter<K, V, const N: usize> {
-    entries: Vec<Bucket<K, V>, N>,
-}
-
-impl<K, V, const N: usize> Iterator for IntoIter<K, V, N> {
-    type Item = (K, V);
-
-    fn next(&mut self) -> Option<Self::Item> {
-        self.entries.pop().map(|bucket| (bucket.key, bucket.value))
-    }
-}
-
-impl<K, V, S, const N: usize> IntoIterator for IndexMap<K, V, S, N>
-where
-    K: Eq + Hash,
-    S: BuildHasher,
-{
-    type Item = (K, V);
-    type IntoIter = IntoIter<K, V, N>;
-
-    fn into_iter(self) -> Self::IntoIter {
-        IntoIter {
-            entries: self.core.entries,
-        }
-    }
-}
-
-impl<'a, K, V, S, const N: usize> IntoIterator for &'a IndexMap<K, V, S, N>
-where
-    K: Eq + Hash,
-    S: BuildHasher,
-{
-    type Item = (&'a K, &'a V);
-    type IntoIter = Iter<'a, K, V>;
-
-    fn into_iter(self) -> Self::IntoIter {
-        self.iter()
-    }
-}
-
-impl<'a, K, V, S, const N: usize> IntoIterator for &'a mut IndexMap<K, V, S, N>
-where
-    K: Eq + Hash,
-    S: BuildHasher,
-{
-    type Item = (&'a K, &'a mut V);
-    type IntoIter = IterMut<'a, K, V>;
-
-    fn into_iter(self) -> Self::IntoIter {
-        self.iter_mut()
-    }
-}
-
-pub struct Iter<'a, K, V> {
-    iter: slice::Iter<'a, Bucket<K, V>>,
-}
-
-impl<'a, K, V> Iterator for Iter<'a, K, V> {
-    type Item = (&'a K, &'a V);
-
-    fn next(&mut self) -> Option<Self::Item> {
-        self.iter.next().map(|bucket| (&bucket.key, &bucket.value))
-    }
-}
-
-impl<'a, K, V> Clone for Iter<'a, K, V> {
-    fn clone(&self) -> Self {
-        Self {
-            iter: self.iter.clone(),
-        }
-    }
-}
-
-pub struct IterMut<'a, K, V> {
-    iter: slice::IterMut<'a, Bucket<K, V>>,
-}
-
-impl<'a, K, V> Iterator for IterMut<'a, K, V> {
-    type Item = (&'a K, &'a mut V);
-
-    fn next(&mut self) -> Option<Self::Item> {
-        self.iter
-            .next()
-            .map(|bucket| (&bucket.key, &mut bucket.value))
-    }
-}
-
-fn hash_with<K, S>(key: &K, build_hasher: &S) -> HashValue
-where
-    K: ?Sized + Hash,
-    S: BuildHasher,
-{
-    let mut h = build_hasher.build_hasher();
-    key.hash(&mut h);
-    HashValue(h.finish() as u16)
-}
-
-#[cfg(test)]
-mod tests {
-    use crate::{indexmap::Entry, FnvIndexMap};
-
-    use core::mem;
-
-    #[test]
-    fn size() {
-        const CAP: usize = 4;
-        assert_eq!(
-            mem::size_of::<FnvIndexMap<i16, u16, CAP>>(),
-            CAP * mem::size_of::<u32>() + // indices
-                CAP * (mem::size_of::<i16>() + // key
-                     mem::size_of::<u16>() + // value
-                     mem::size_of::<u16>() // hash
-                ) + // buckets
-                mem::size_of::<usize>() // entries.length
-        )
-    }
-
-    #[test]
-    fn partial_eq() {
-        {
-            let mut a: FnvIndexMap<_, _, 4> = FnvIndexMap::new();
-            a.insert("k1", "v1").unwrap();
-
-            let mut b: FnvIndexMap<_, _, 4> = FnvIndexMap::new();
-            b.insert("k1", "v1").unwrap();
-
-            assert!(a == b);
-
-            b.insert("k2", "v2").unwrap();
-
-            assert!(a != b);
-        }
-
-        {
-            let mut a: FnvIndexMap<_, _, 4> = FnvIndexMap::new();
-            a.insert("k1", "v1").unwrap();
-            a.insert("k2", "v2").unwrap();
-
-            let mut b: FnvIndexMap<_, _, 4> = FnvIndexMap::new();
-            b.insert("k2", "v2").unwrap();
-            b.insert("k1", "v1").unwrap();
-
-            assert!(a == b);
-        }
-    }
-
-    #[test]
-    fn into_iter() {
-        let mut src: FnvIndexMap<_, _, 4> = FnvIndexMap::new();
-        src.insert("k1", "v1").unwrap();
-        src.insert("k2", "v2").unwrap();
-        src.insert("k3", "v3").unwrap();
-        src.insert("k4", "v4").unwrap();
-        let clone = src.clone();
-        for (k, v) in clone.into_iter() {
-            assert_eq!(v, *src.get(k).unwrap());
-        }
-    }
-
-    #[test]
-    fn insert_replaces_on_full_map() {
-        let mut a: FnvIndexMap<_, _, 2> = FnvIndexMap::new();
-        a.insert("k1", "v1").unwrap();
-        a.insert("k2", "v2").unwrap();
-        a.insert("k1", "v2").unwrap();
-        assert_eq!(a.get("k1"), a.get("k2"));
-    }
-
-    const MAP_SLOTS: usize = 4096;
-    fn almost_filled_map() -> FnvIndexMap<usize, usize, MAP_SLOTS> {
-        let mut almost_filled = FnvIndexMap::new();
-        for i in 1..MAP_SLOTS {
-            almost_filled.insert(i, i).unwrap();
-        }
-        almost_filled
-    }
-
-    #[test]
-    fn entry_find() {
-        let key = 0;
-        let value = 0;
-        let mut src = almost_filled_map();
-        let entry = src.entry(key);
-        match entry {
-            Entry::Occupied(_) => {
-                panic!("Found entry without inserting");
-            }
-            Entry::Vacant(v) => {
-                assert_eq!(&key, v.key());
-                assert_eq!(key, v.into_key());
-            }
-        }
-        src.insert(key, value).unwrap();
-        let entry = src.entry(key);
-        match entry {
-            Entry::Occupied(mut o) => {
-                assert_eq!(&key, o.key());
-                assert_eq!(&value, o.get());
-                assert_eq!(&value, o.get_mut());
-                assert_eq!(&value, o.into_mut());
-            }
-            Entry::Vacant(_) => {
-                panic!("Entry not found");
-            }
-        }
-    }
-
-    #[test]
-    fn entry_vacant_insert() {
-        let key = 0;
-        let value = 0;
-        let mut src = almost_filled_map();
-        assert_eq!(MAP_SLOTS - 1, src.len());
-        let entry = src.entry(key);
-        match entry {
-            Entry::Occupied(_) => {
-                panic!("Entry found when empty");
-            }
-            Entry::Vacant(v) => {
-                v.insert(value).unwrap();
-            }
-        };
-        assert_eq!(value, *src.get(&key).unwrap())
-    }
-
-    #[test]
-    fn entry_occupied_insert() {
-        let key = 0;
-        let value = 0;
-        let value2 = 5;
-        let mut src = almost_filled_map();
-        assert_eq!(MAP_SLOTS - 1, src.len());
-        src.insert(key, value).unwrap();
-        let entry = src.entry(key);
-        match entry {
-            Entry::Occupied(o) => {
-                assert_eq!(value, o.insert(value2));
-            }
-            Entry::Vacant(_) => {
-                panic!("Entry not found");
-            }
-        };
-        assert_eq!(value2, *src.get(&key).unwrap())
-    }
-
-    #[test]
-    fn entry_remove_entry() {
-        let key = 0;
-        let value = 0;
-        let mut src = almost_filled_map();
-        src.insert(key, value).unwrap();
-        assert_eq!(MAP_SLOTS, src.len());
-        let entry = src.entry(key);
-        match entry {
-            Entry::Occupied(o) => {
-                assert_eq!((key, value), o.remove_entry());
-            }
-            Entry::Vacant(_) => {
-                panic!("Entry not found")
-            }
-        };
-        assert_eq!(MAP_SLOTS - 1, src.len());
-    }
-
-    #[test]
-    fn entry_remove() {
-        let key = 0;
-        let value = 0;
-        let mut src = almost_filled_map();
-        src.insert(key, value).unwrap();
-        assert_eq!(MAP_SLOTS, src.len());
-        let entry = src.entry(key);
-        match entry {
-            Entry::Occupied(o) => {
-                assert_eq!(value, o.remove());
-            }
-            Entry::Vacant(_) => {
-                panic!("Entry not found");
-            }
-        };
-        assert_eq!(MAP_SLOTS - 1, src.len());
-    }
-
-    #[test]
-    fn entry_roll_through_all() {
-        let mut src: FnvIndexMap<usize, usize, MAP_SLOTS> = FnvIndexMap::new();
-        for i in 0..MAP_SLOTS {
-            match src.entry(i) {
-                Entry::Occupied(_) => {
-                    panic!("Entry found before insert");
-                }
-                Entry::Vacant(v) => {
-                    v.insert(i).unwrap();
-                }
-            }
-        }
-        let add_mod = 99;
-        for i in 0..MAP_SLOTS {
-            match src.entry(i) {
-                Entry::Occupied(o) => {
-                    assert_eq!(i, o.insert(i + add_mod));
-                }
-                Entry::Vacant(_) => {
-                    panic!("Entry not found after insert");
-                }
-            }
-        }
-        for i in 0..MAP_SLOTS {
-            match src.entry(i) {
-                Entry::Occupied(o) => {
-                    assert_eq!((i, i + add_mod), o.remove_entry());
-                }
-                Entry::Vacant(_) => {
-                    panic!("Entry not found after insert");
-                }
-            }
-        }
-        for i in 0..MAP_SLOTS {
-            assert!(matches!(src.entry(i), Entry::Vacant(_)));
-        }
-        assert!(src.is_empty());
-    }
-
-    #[test]
-    fn first_last() {
-        let mut map = FnvIndexMap::<_, _, 4>::new();
-
-        assert_eq!(None, map.first());
-        assert_eq!(None, map.last());
-
-        map.insert(0, 0).unwrap();
-        map.insert(2, 2).unwrap();
-
-        assert_eq!(Some((&0, &0)), map.first());
-        assert_eq!(Some((&2, &2)), map.last());
-
-        map.insert(1, 1).unwrap();
-
-        assert_eq!(Some((&1, &1)), map.last());
-
-        *map.first_mut().unwrap().1 += 1;
-        *map.last_mut().unwrap().1 += 1;
-
-        assert_eq!(Some((&0, &1)), map.first());
-        assert_eq!(Some((&1, &2)), map.last());
-    }
-}
-
\ No newline at end of file diff --git a/docs/doc/src/heapless/indexset.rs.html b/docs/doc/src/heapless/indexset.rs.html deleted file mode 100644 index d211c0e..0000000 --- a/docs/doc/src/heapless/indexset.rs.html +++ /dev/null @@ -1,1279 +0,0 @@ -indexset.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-
use crate::indexmap::{self, IndexMap};
-use core::{borrow::Borrow, fmt, iter::FromIterator};
-use hash32::{BuildHasher, BuildHasherDefault, FnvHasher, Hash};
-
-/// A [`heapless::IndexSet`](./struct.IndexSet.html) using the
-/// default FNV hasher.
-/// A list of all Methods and Traits available for `FnvIndexSet` can be found in
-/// the [`heapless::IndexSet`](./struct.IndexSet.html) documentation.
-///
-/// # Examples
-/// ```
-/// use heapless::FnvIndexSet;
-///
-/// // A hash set with a capacity of 16 elements allocated on the stack
-/// let mut books = FnvIndexSet::<_, 16>::new();
-///
-/// // Add some books.
-/// books.insert("A Dance With Dragons").unwrap();
-/// books.insert("To Kill a Mockingbird").unwrap();
-/// books.insert("The Odyssey").unwrap();
-/// books.insert("The Great Gatsby").unwrap();
-///
-/// // Check for a specific one.
-/// if !books.contains("The Winds of Winter") {
-///     println!("We have {} books, but The Winds of Winter ain't one.",
-///              books.len());
-/// }
-///
-/// // Remove a book.
-/// books.remove("The Odyssey");
-///
-/// // Iterate over everything.
-/// for book in &books {
-///     println!("{}", book);
-/// }
-/// ```
-pub type FnvIndexSet<T, const N: usize> = IndexSet<T, BuildHasherDefault<FnvHasher>, N>;
-
-/// Fixed capacity [`IndexSet`](https://docs.rs/indexmap/1/indexmap/set/struct.IndexSet.html).
-///
-/// Note that you cannot use `IndexSet` directly, since it is generic around the hashing algorithm
-/// in use. Pick a concrete instantiation like [`FnvIndexSet`](./type.FnvIndexSet.html) instead
-/// or create your own.
-///
-/// Note that the capacity of the `IndexSet` must be a power of 2.
-///
-/// # Examples
-/// Since `IndexSet` cannot be used directly, we're using its `FnvIndexSet` instantiation
-/// for this example.
-///
-/// ```
-/// use heapless::FnvIndexSet;
-///
-/// // A hash set with a capacity of 16 elements allocated on the stack
-/// let mut books = FnvIndexSet::<_, 16>::new();
-///
-/// // Add some books.
-/// books.insert("A Dance With Dragons").unwrap();
-/// books.insert("To Kill a Mockingbird").unwrap();
-/// books.insert("The Odyssey").unwrap();
-/// books.insert("The Great Gatsby").unwrap();
-///
-/// // Check for a specific one.
-/// if !books.contains("The Winds of Winter") {
-///     println!("We have {} books, but The Winds of Winter ain't one.",
-///              books.len());
-/// }
-///
-/// // Remove a book.
-/// books.remove("The Odyssey");
-///
-/// // Iterate over everything.
-/// for book in &books {
-///     println!("{}", book);
-/// }
-/// ```
-pub struct IndexSet<T, S, const N: usize> {
-    map: IndexMap<T, (), S, N>,
-}
-
-impl<T, S, const N: usize> IndexSet<T, BuildHasherDefault<S>, N> {
-    /// Creates an empty `IndexSet`
-    pub const fn new() -> Self {
-        IndexSet {
-            map: IndexMap::new(),
-        }
-    }
-}
-
-impl<T, S, const N: usize> IndexSet<T, S, N>
-where
-    T: Eq + Hash,
-    S: BuildHasher,
-{
-    /// Returns the number of elements the set can hold
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexSet;
-    ///
-    /// let set = FnvIndexSet::<i32, 16>::new();
-    /// assert_eq!(set.capacity(), 16);
-    /// ```
-    pub fn capacity(&self) -> usize {
-        self.map.capacity()
-    }
-
-    /// Return an iterator over the values of the set, in their order
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexSet;
-    ///
-    /// let mut set = FnvIndexSet::<_, 16>::new();
-    /// set.insert("a").unwrap();
-    /// set.insert("b").unwrap();
-    ///
-    /// // Will print in an arbitrary order.
-    /// for x in set.iter() {
-    ///     println!("{}", x);
-    /// }
-    /// ```
-    pub fn iter(&self) -> Iter<'_, T> {
-        Iter {
-            iter: self.map.iter(),
-        }
-    }
-
-    /// Get the first value
-    ///
-    /// Computes in **O(1)** time
-    pub fn first(&self) -> Option<&T> {
-        self.map.first().map(|(k, _v)| k)
-    }
-
-    /// Get the last value
-    ///
-    /// Computes in **O(1)** time
-    pub fn last(&self) -> Option<&T> {
-        self.map.last().map(|(k, _v)| k)
-    }
-
-    /// Visits the values representing the difference, i.e. the values that are in `self` but not in
-    /// `other`.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexSet;
-    ///
-    /// let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-    /// let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-    ///
-    /// // Can be seen as `a - b`.
-    /// for x in a.difference(&b) {
-    ///     println!("{}", x); // Print 1
-    /// }
-    ///
-    /// let diff: FnvIndexSet<_, 16> = a.difference(&b).collect();
-    /// assert_eq!(diff, [1].iter().collect::<FnvIndexSet<_, 16>>());
-    ///
-    /// // Note that difference is not symmetric,
-    /// // and `b - a` means something else:
-    /// let diff: FnvIndexSet<_, 16> = b.difference(&a).collect();
-    /// assert_eq!(diff, [4].iter().collect::<FnvIndexSet<_, 16>>());
-    /// ```
-    pub fn difference<'a, S2, const N2: usize>(
-        &'a self,
-        other: &'a IndexSet<T, S2, N2>,
-    ) -> Difference<'a, T, S2, N2>
-    where
-        S2: BuildHasher,
-    {
-        Difference {
-            iter: self.iter(),
-            other,
-        }
-    }
-
-    /// Visits the values representing the symmetric difference, i.e. the values that are in `self`
-    /// or in `other` but not in both.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexSet;
-    ///
-    /// let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-    /// let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-    ///
-    /// // Print 1, 4 in that order order.
-    /// for x in a.symmetric_difference(&b) {
-    ///     println!("{}", x);
-    /// }
-    ///
-    /// let diff1: FnvIndexSet<_, 16> = a.symmetric_difference(&b).collect();
-    /// let diff2: FnvIndexSet<_, 16> = b.symmetric_difference(&a).collect();
-    ///
-    /// assert_eq!(diff1, diff2);
-    /// assert_eq!(diff1, [1, 4].iter().collect::<FnvIndexSet<_, 16>>());
-    /// ```
-    pub fn symmetric_difference<'a, S2, const N2: usize>(
-        &'a self,
-        other: &'a IndexSet<T, S2, N2>,
-    ) -> impl Iterator<Item = &'a T>
-    where
-        S2: BuildHasher,
-    {
-        self.difference(other).chain(other.difference(self))
-    }
-
-    /// Visits the values representing the intersection, i.e. the values that are both in `self` and
-    /// `other`.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexSet;
-    ///
-    /// let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-    /// let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-    ///
-    /// // Print 2, 3 in that order.
-    /// for x in a.intersection(&b) {
-    ///     println!("{}", x);
-    /// }
-    ///
-    /// let intersection: FnvIndexSet<_, 16> = a.intersection(&b).collect();
-    /// assert_eq!(intersection, [2, 3].iter().collect::<FnvIndexSet<_, 16>>());
-    /// ```
-    pub fn intersection<'a, S2, const N2: usize>(
-        &'a self,
-        other: &'a IndexSet<T, S2, N2>,
-    ) -> Intersection<'a, T, S2, N2>
-    where
-        S2: BuildHasher,
-    {
-        Intersection {
-            iter: self.iter(),
-            other,
-        }
-    }
-
-    /// Visits the values representing the union, i.e. all the values in `self` or `other`, without
-    /// duplicates.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexSet;
-    ///
-    /// let mut a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-    /// let mut b: FnvIndexSet<_, 16> = [4, 2, 3, 4].iter().cloned().collect();
-    ///
-    /// // Print 1, 2, 3, 4 in that order.
-    /// for x in a.union(&b) {
-    ///     println!("{}", x);
-    /// }
-    ///
-    /// let union: FnvIndexSet<_, 16> = a.union(&b).collect();
-    /// assert_eq!(union, [1, 2, 3, 4].iter().collect::<FnvIndexSet<_, 16>>());
-    /// ```
-    pub fn union<'a, S2, const N2: usize>(
-        &'a self,
-        other: &'a IndexSet<T, S2, N2>,
-    ) -> impl Iterator<Item = &'a T>
-    where
-        S2: BuildHasher,
-    {
-        self.iter().chain(other.difference(self))
-    }
-
-    /// Returns the number of elements in the set.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexSet;
-    ///
-    /// let mut v: FnvIndexSet<_, 16> = FnvIndexSet::new();
-    /// assert_eq!(v.len(), 0);
-    /// v.insert(1).unwrap();
-    /// assert_eq!(v.len(), 1);
-    /// ```
-    pub fn len(&self) -> usize {
-        self.map.len()
-    }
-
-    /// Returns `true` if the set contains no elements.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexSet;
-    ///
-    /// let mut v: FnvIndexSet<_, 16> = FnvIndexSet::new();
-    /// assert!(v.is_empty());
-    /// v.insert(1).unwrap();
-    /// assert!(!v.is_empty());
-    /// ```
-    pub fn is_empty(&self) -> bool {
-        self.map.is_empty()
-    }
-
-    /// Clears the set, removing all values.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexSet;
-    ///
-    /// let mut v: FnvIndexSet<_, 16> = FnvIndexSet::new();
-    /// v.insert(1).unwrap();
-    /// v.clear();
-    /// assert!(v.is_empty());
-    /// ```
-    pub fn clear(&mut self) {
-        self.map.clear()
-    }
-
-    /// Returns `true` if the set contains a value.
-    ///
-    /// The value may be any borrowed form of the set's value type, but `Hash` and `Eq` on the
-    /// borrowed form must match those for the value type.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexSet;
-    ///
-    /// let set: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-    /// assert_eq!(set.contains(&1), true);
-    /// assert_eq!(set.contains(&4), false);
-    /// ```
-    pub fn contains<Q>(&self, value: &Q) -> bool
-    where
-        T: Borrow<Q>,
-        Q: ?Sized + Eq + Hash,
-    {
-        self.map.contains_key(value)
-    }
-
-    /// Returns `true` if `self` has no elements in common with `other`. This is equivalent to
-    /// checking for an empty intersection.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexSet;
-    ///
-    /// let a: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-    /// let mut b = FnvIndexSet::<_, 16>::new();
-    ///
-    /// assert_eq!(a.is_disjoint(&b), true);
-    /// b.insert(4).unwrap();
-    /// assert_eq!(a.is_disjoint(&b), true);
-    /// b.insert(1).unwrap();
-    /// assert_eq!(a.is_disjoint(&b), false);
-    /// ```
-    pub fn is_disjoint<S2, const N2: usize>(&self, other: &IndexSet<T, S2, N2>) -> bool
-    where
-        S2: BuildHasher,
-    {
-        self.iter().all(|v| !other.contains(v))
-    }
-
-    /// Returns `true` if the set is a subset of another, i.e. `other` contains at least all the
-    /// values in `self`.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexSet;
-    ///
-    /// let sup: FnvIndexSet<_, 16> = [1, 2, 3].iter().cloned().collect();
-    /// let mut set = FnvIndexSet::<_, 16>::new();
-    ///
-    /// assert_eq!(set.is_subset(&sup), true);
-    /// set.insert(2).unwrap();
-    /// assert_eq!(set.is_subset(&sup), true);
-    /// set.insert(4).unwrap();
-    /// assert_eq!(set.is_subset(&sup), false);
-    /// ```
-    pub fn is_subset<S2, const N2: usize>(&self, other: &IndexSet<T, S2, N2>) -> bool
-    where
-        S2: BuildHasher,
-    {
-        self.iter().all(|v| other.contains(v))
-    }
-
-    // Returns `true` if the set is a superset of another, i.e. `self` contains at least all the
-    // values in `other`.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexSet;
-    ///
-    /// let sub: FnvIndexSet<_, 16> = [1, 2].iter().cloned().collect();
-    /// let mut set = FnvIndexSet::<_, 16>::new();
-    ///
-    /// assert_eq!(set.is_superset(&sub), false);
-    ///
-    /// set.insert(0).unwrap();
-    /// set.insert(1).unwrap();
-    /// assert_eq!(set.is_superset(&sub), false);
-    ///
-    /// set.insert(2).unwrap();
-    /// assert_eq!(set.is_superset(&sub), true);
-    /// ```
-    pub fn is_superset<S2, const N2: usize>(&self, other: &IndexSet<T, S2, N2>) -> bool
-    where
-        S2: BuildHasher,
-    {
-        other.is_subset(self)
-    }
-
-    /// Adds a value to the set.
-    ///
-    /// If the set did not have this value present, `true` is returned.
-    ///
-    /// If the set did have this value present, `false` is returned.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexSet;
-    ///
-    /// let mut set = FnvIndexSet::<_, 16>::new();
-    ///
-    /// assert_eq!(set.insert(2).unwrap(), true);
-    /// assert_eq!(set.insert(2).unwrap(), false);
-    /// assert_eq!(set.len(), 1);
-    /// ```
-    pub fn insert(&mut self, value: T) -> Result<bool, T> {
-        self.map
-            .insert(value, ())
-            .map(|old| old.is_none())
-            .map_err(|(k, _)| k)
-    }
-
-    /// Removes a value from the set. Returns `true` if the value was present in the set.
-    ///
-    /// The value may be any borrowed form of the set's value type, but `Hash` and `Eq` on the
-    /// borrowed form must match those for the value type.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::FnvIndexSet;
-    ///
-    /// let mut set = FnvIndexSet::<_, 16>::new();
-    ///
-    /// set.insert(2).unwrap();
-    /// assert_eq!(set.remove(&2), true);
-    /// assert_eq!(set.remove(&2), false);
-    /// ```
-    pub fn remove<Q>(&mut self, value: &Q) -> bool
-    where
-        T: Borrow<Q>,
-        Q: ?Sized + Eq + Hash,
-    {
-        self.map.remove(value).is_some()
-    }
-}
-
-impl<T, S, const N: usize> Clone for IndexSet<T, S, N>
-where
-    T: Eq + Hash + Clone,
-    S: Clone,
-{
-    fn clone(&self) -> Self {
-        Self {
-            map: self.map.clone(),
-        }
-    }
-}
-
-impl<T, S, const N: usize> fmt::Debug for IndexSet<T, S, N>
-where
-    T: Eq + Hash + fmt::Debug,
-    S: BuildHasher,
-{
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        f.debug_set().entries(self.iter()).finish()
-    }
-}
-
-impl<T, S, const N: usize> Default for IndexSet<T, S, N>
-where
-    T: Eq + Hash,
-    S: BuildHasher + Default,
-{
-    fn default() -> Self {
-        IndexSet {
-            map: <_>::default(),
-        }
-    }
-}
-
-impl<T, S1, S2, const N1: usize, const N2: usize> PartialEq<IndexSet<T, S2, N2>>
-    for IndexSet<T, S1, N1>
-where
-    T: Eq + Hash,
-    S1: BuildHasher,
-    S2: BuildHasher,
-{
-    fn eq(&self, other: &IndexSet<T, S2, N2>) -> bool {
-        self.len() == other.len() && self.is_subset(other)
-    }
-}
-
-impl<T, S, const N: usize> Extend<T> for IndexSet<T, S, N>
-where
-    T: Eq + Hash,
-    S: BuildHasher,
-{
-    fn extend<I>(&mut self, iterable: I)
-    where
-        I: IntoIterator<Item = T>,
-    {
-        self.map.extend(iterable.into_iter().map(|k| (k, ())))
-    }
-}
-
-impl<'a, T, S, const N: usize> Extend<&'a T> for IndexSet<T, S, N>
-where
-    T: 'a + Eq + Hash + Copy,
-    S: BuildHasher,
-{
-    fn extend<I>(&mut self, iterable: I)
-    where
-        I: IntoIterator<Item = &'a T>,
-    {
-        self.extend(iterable.into_iter().cloned())
-    }
-}
-
-impl<T, S, const N: usize> FromIterator<T> for IndexSet<T, S, N>
-where
-    T: Eq + Hash,
-    S: BuildHasher + Default,
-{
-    fn from_iter<I>(iter: I) -> Self
-    where
-        I: IntoIterator<Item = T>,
-    {
-        let mut set = IndexSet::default();
-        set.extend(iter);
-        set
-    }
-}
-
-impl<'a, T, S, const N: usize> IntoIterator for &'a IndexSet<T, S, N>
-where
-    T: Eq + Hash,
-    S: BuildHasher,
-{
-    type Item = &'a T;
-    type IntoIter = Iter<'a, T>;
-
-    fn into_iter(self) -> Self::IntoIter {
-        self.iter()
-    }
-}
-
-pub struct Iter<'a, T> {
-    iter: indexmap::Iter<'a, T, ()>,
-}
-
-impl<'a, T> Iterator for Iter<'a, T> {
-    type Item = &'a T;
-
-    fn next(&mut self) -> Option<Self::Item> {
-        self.iter.next().map(|(k, _)| k)
-    }
-}
-
-impl<'a, T> Clone for Iter<'a, T> {
-    fn clone(&self) -> Self {
-        Self {
-            iter: self.iter.clone(),
-        }
-    }
-}
-
-pub struct Difference<'a, T, S, const N: usize>
-where
-    S: BuildHasher,
-    T: Eq + Hash,
-{
-    iter: Iter<'a, T>,
-    other: &'a IndexSet<T, S, N>,
-}
-
-impl<'a, T, S, const N: usize> Iterator for Difference<'a, T, S, N>
-where
-    S: BuildHasher,
-    T: Eq + Hash,
-{
-    type Item = &'a T;
-
-    fn next(&mut self) -> Option<Self::Item> {
-        loop {
-            let elt = self.iter.next()?;
-            if !self.other.contains(elt) {
-                return Some(elt);
-            }
-        }
-    }
-}
-
-pub struct Intersection<'a, T, S, const N: usize>
-where
-    S: BuildHasher,
-    T: Eq + Hash,
-{
-    iter: Iter<'a, T>,
-    other: &'a IndexSet<T, S, N>,
-}
-
-impl<'a, T, S, const N: usize> Iterator for Intersection<'a, T, S, N>
-where
-    S: BuildHasher,
-    T: Eq + Hash,
-{
-    type Item = &'a T;
-
-    fn next(&mut self) -> Option<Self::Item> {
-        loop {
-            let elt = self.iter.next()?;
-            if self.other.contains(elt) {
-                return Some(elt);
-            }
-        }
-    }
-}
-
\ No newline at end of file diff --git a/docs/doc/src/heapless/lib.rs.html b/docs/doc/src/heapless/lib.rs.html deleted file mode 100644 index d8d5644..0000000 --- a/docs/doc/src/heapless/lib.rs.html +++ /dev/null @@ -1,239 +0,0 @@ -lib.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-
//! `static` friendly data structures that don't require dynamic memory allocation
-//!
-//! The core principle behind `heapless` is that its data structures are backed by a *static* memory
-//! allocation. For example, you can think of `heapless::Vec` as an alternative version of
-//! `std::Vec` with fixed capacity and that can't be re-allocated on the fly (e.g. via `push`).
-//!
-//! All `heapless` data structures store their memory allocation *inline* and specify their capacity
-//! via their type parameter `N`. This means that you can instantiate a `heapless` data structure on
-//! the stack, in a `static` variable, or even in the heap.
-//!
-//! ```
-//! use heapless::Vec; // fixed capacity `std::Vec`
-//!
-//! // on the stack
-//! let mut xs: Vec<u8, 8> = Vec::new(); // can hold up to 8 elements
-//! xs.push(42).unwrap();
-//! assert_eq!(xs.pop(), Some(42));
-//!
-//! // in a `static` variable
-//! static mut XS: Vec<u8, 8> = Vec::new();
-//!
-//! let xs = unsafe { &mut XS };
-//!
-//! xs.push(42);
-//! assert_eq!(xs.pop(), Some(42));
-//!
-//! // in the heap (though kind of pointless because no reallocation)
-//! let mut ys: Box<Vec<u8, 8>> = Box::new(Vec::new());
-//! ys.push(42).unwrap();
-//! assert_eq!(ys.pop(), Some(42));
-//! ```
-//!
-//! Because they have fixed capacity `heapless` data structures don't implicitly reallocate. This
-//! means that operations like `heapless::Vec.push` are *truly* constant time rather than amortized
-//! constant time with potentially unbounded (depends on the allocator) worst case execution time
-//! (which is bad / unacceptable for hard real time applications).
-//!
-//! `heapless` data structures don't use a memory allocator which means no risk of an uncatchable
-//! Out Of Memory (OOM) condition while performing operations on them. It's certainly possible to
-//! run out of capacity while growing `heapless` data structures, but the API lets you handle this
-//! possibility by returning a `Result` on operations that may exhaust the capacity of the data
-//! structure.
-//!
-//! List of currently implemented data structures:
-//!
-//! - [`Arc`](pool/singleton/arc/struct.Arc.html) -- Thread-safe reference-counting pointer backed by a memory pool
-//! - [`BinaryHeap`](binary_heap/struct.BinaryHeap.html) -- priority queue
-//! - [`IndexMap`](struct.IndexMap.html) -- hash table
-//! - [`IndexSet`](struct.IndexSet.html) -- hash set
-//! - [`LinearMap`](struct.LinearMap.html)
-//! - [`Pool`](pool/struct.Pool.html) -- lock-free memory pool
-//! - [`String`](struct.String.html)
-//! - [`Vec`](struct.Vec.html)
-//! - [`mpmc::Q*`](mpmc/index.html) -- multiple producer multiple consumer lock-free queue
-//! - [`spsc::Queue`](spsc/struct.Queue.html) -- single producer single consumer lock-free queue
-//!
-//! # Optional Features
-//!
-//! The `heapless` crate provides the following optional Cargo features:
-//!
-//! - `ufmt-impl`: Implement [`ufmt_write::uWrite`] for `String<N>` and `Vec<u8, N>`
-//!
-//! [`ufmt_write::uWrite`]: https://docs.rs/ufmt-write/
-//!
-//! # Minimum Supported Rust Version (MSRV)
-//!
-//! This crate is guaranteed to compile on stable Rust 1.51 and up with its default set of features.
-//! It *might* compile on older versions but that may change in any new patch release.
-
-#![cfg_attr(not(test), no_std)]
-#![deny(missing_docs)]
-#![deny(rust_2018_compatibility)]
-#![deny(rust_2018_idioms)]
-#![deny(warnings)]
-#![deny(const_err)]
-
-pub use binary_heap::BinaryHeap;
-pub use deque::Deque;
-pub use histbuf::{HistoryBuffer, OldestOrdered};
-pub use indexmap::{Bucket, Entry, FnvIndexMap, IndexMap, OccupiedEntry, Pos, VacantEntry};
-pub use indexset::{FnvIndexSet, IndexSet};
-pub use linear_map::LinearMap;
-#[cfg(all(has_cas, feature = "cas"))]
-pub use pool::singleton::arc::Arc;
-pub use string::String;
-pub use vec::Vec;
-
-#[macro_use]
-#[cfg(test)]
-mod test_helpers;
-
-mod deque;
-mod histbuf;
-mod indexmap;
-mod indexset;
-mod linear_map;
-mod string;
-mod vec;
-
-#[cfg(feature = "serde")]
-mod de;
-#[cfg(feature = "serde")]
-mod ser;
-
-pub mod binary_heap;
-#[cfg(feature = "defmt-impl")]
-mod defmt;
-#[cfg(all(has_cas, feature = "cas"))]
-pub mod mpmc;
-#[cfg(all(has_cas, feature = "cas"))]
-pub mod pool;
-pub mod sorted_linked_list;
-#[cfg(has_atomics)]
-pub mod spsc;
-
-#[cfg(feature = "ufmt-impl")]
-mod ufmt;
-
-mod sealed;
-
\ No newline at end of file diff --git a/docs/doc/src/heapless/linear_map.rs.html b/docs/doc/src/heapless/linear_map.rs.html deleted file mode 100644 index 48c1aaa..0000000 --- a/docs/doc/src/heapless/linear_map.rs.html +++ /dev/null @@ -1,1089 +0,0 @@ -linear_map.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-
use crate::Vec;
-use core::{borrow::Borrow, fmt, iter::FromIterator, mem, ops, slice};
-
-/// A fixed capacity map / dictionary that performs lookups via linear search
-///
-/// Note that as this map doesn't use hashing so most operations are **O(N)** instead of O(1)
-
-pub struct LinearMap<K, V, const N: usize> {
-    pub(crate) buffer: Vec<(K, V), N>,
-}
-
-impl<K, V, const N: usize> LinearMap<K, V, N> {
-    /// Creates an empty `LinearMap`
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::LinearMap;
-    ///
-    /// // allocate the map on the stack
-    /// let mut map: LinearMap<&str, isize, 8> = LinearMap::new();
-    ///
-    /// // allocate the map in a static variable
-    /// static mut MAP: LinearMap<&str, isize, 8> = LinearMap::new();
-    /// ```
-    pub const fn new() -> Self {
-        Self { buffer: Vec::new() }
-    }
-}
-
-impl<K, V, const N: usize> LinearMap<K, V, N>
-where
-    K: Eq,
-{
-    /// Returns the number of elements that the map can hold
-    ///
-    /// Computes in **O(1)** time
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::LinearMap;
-    ///
-    /// let map: LinearMap<&str, isize, 8> = LinearMap::new();
-    /// assert_eq!(map.capacity(), 8);
-    /// ```
-    pub fn capacity(&self) -> usize {
-        N
-    }
-
-    /// Clears the map, removing all key-value pairs
-    ///
-    /// Computes in **O(1)** time
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::LinearMap;
-    ///
-    /// let mut map: LinearMap<_, _, 8> = LinearMap::new();
-    /// map.insert(1, "a").unwrap();
-    /// map.clear();
-    /// assert!(map.is_empty());
-    /// ```
-    pub fn clear(&mut self) {
-        self.buffer.clear()
-    }
-
-    /// Returns true if the map contains a value for the specified key.
-    ///
-    /// Computes in **O(N)** time
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::LinearMap;
-    ///
-    /// let mut map: LinearMap<_, _, 8> = LinearMap::new();
-    /// map.insert(1, "a").unwrap();
-    /// assert_eq!(map.contains_key(&1), true);
-    /// assert_eq!(map.contains_key(&2), false);
-    /// ```
-    pub fn contains_key(&self, key: &K) -> bool {
-        self.get(key).is_some()
-    }
-
-    /// Returns a reference to the value corresponding to the key
-    ///
-    /// Computes in **O(N)** time
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::LinearMap;
-    ///
-    /// let mut map: LinearMap<_, _, 8> = LinearMap::new();
-    /// map.insert(1, "a").unwrap();
-    /// assert_eq!(map.get(&1), Some(&"a"));
-    /// assert_eq!(map.get(&2), None);
-    /// ```
-    pub fn get<Q>(&self, key: &Q) -> Option<&V>
-    where
-        K: Borrow<Q>,
-        Q: Eq + ?Sized,
-    {
-        self.iter()
-            .find(|&(k, _)| k.borrow() == key)
-            .map(|(_, v)| v)
-    }
-
-    /// Returns a mutable reference to the value corresponding to the key
-    ///
-    /// Computes in **O(N)** time
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::LinearMap;
-    ///
-    /// let mut map: LinearMap<_, _, 8> = LinearMap::new();
-    /// map.insert(1, "a").unwrap();
-    /// if let Some(x) = map.get_mut(&1) {
-    ///     *x = "b";
-    /// }
-    /// assert_eq!(map[&1], "b");
-    /// ```
-    pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
-    where
-        K: Borrow<Q>,
-        Q: Eq + ?Sized,
-    {
-        self.iter_mut()
-            .find(|&(k, _)| k.borrow() == key)
-            .map(|(_, v)| v)
-    }
-
-    /// Returns the number of elements in this map
-    ///
-    /// Computes in **O(1)** time
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::LinearMap;
-    ///
-    /// let mut a: LinearMap<_, _, 8> = LinearMap::new();
-    /// assert_eq!(a.len(), 0);
-    /// a.insert(1, "a").unwrap();
-    /// assert_eq!(a.len(), 1);
-    /// ```
-    pub fn len(&self) -> usize {
-        self.buffer.len()
-    }
-
-    /// Inserts a key-value pair into the map.
-    ///
-    /// If the map did not have this key present, `None` is returned.
-    ///
-    /// If the map did have this key present, the value is updated, and the old value is returned.
-    ///
-    /// Computes in **O(N)** time
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::LinearMap;
-    ///
-    /// let mut map: LinearMap<_, _, 8> = LinearMap::new();
-    /// assert_eq!(map.insert(37, "a").unwrap(), None);
-    /// assert_eq!(map.is_empty(), false);
-    ///
-    /// map.insert(37, "b").unwrap();
-    /// assert_eq!(map.insert(37, "c").unwrap(), Some("b"));
-    /// assert_eq!(map[&37], "c");
-    /// ```
-    pub fn insert(&mut self, key: K, mut value: V) -> Result<Option<V>, (K, V)> {
-        if let Some((_, v)) = self.iter_mut().find(|&(k, _)| *k == key) {
-            mem::swap(v, &mut value);
-            return Ok(Some(value));
-        }
-
-        self.buffer.push((key, value))?;
-        Ok(None)
-    }
-
-    /// Returns true if the map contains no elements
-    ///
-    /// Computes in **O(1)** time
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::LinearMap;
-    ///
-    /// let mut a: LinearMap<_, _, 8> = LinearMap::new();
-    /// assert!(a.is_empty());
-    /// a.insert(1, "a").unwrap();
-    /// assert!(!a.is_empty());
-    /// ```
-    pub fn is_empty(&self) -> bool {
-        self.len() == 0
-    }
-
-    /// An iterator visiting all key-value pairs in arbitrary order.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::LinearMap;
-    ///
-    /// let mut map: LinearMap<_, _, 8> = LinearMap::new();
-    /// map.insert("a", 1).unwrap();
-    /// map.insert("b", 2).unwrap();
-    /// map.insert("c", 3).unwrap();
-    ///
-    /// for (key, val) in map.iter() {
-    ///     println!("key: {} val: {}", key, val);
-    /// }
-    /// ```
-    pub fn iter(&self) -> Iter<'_, K, V> {
-        Iter {
-            iter: self.buffer.as_slice().iter(),
-        }
-    }
-
-    /// An iterator visiting all key-value pairs in arbitrary order, with mutable references to the
-    /// values
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::LinearMap;
-    ///
-    /// let mut map: LinearMap<_, _, 8> = LinearMap::new();
-    /// map.insert("a", 1).unwrap();
-    /// map.insert("b", 2).unwrap();
-    /// map.insert("c", 3).unwrap();
-    ///
-    /// // Update all values
-    /// for (_, val) in map.iter_mut() {
-    ///     *val = 2;
-    /// }
-    ///
-    /// for (key, val) in &map {
-    ///     println!("key: {} val: {}", key, val);
-    /// }
-    /// ```
-    pub fn iter_mut(&mut self) -> IterMut<'_, K, V> {
-        IterMut {
-            iter: self.buffer.as_mut_slice().iter_mut(),
-        }
-    }
-
-    /// An iterator visiting all keys in arbitrary order
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::LinearMap;
-    ///
-    /// let mut map: LinearMap<_, _, 8> = LinearMap::new();
-    /// map.insert("a", 1).unwrap();
-    /// map.insert("b", 2).unwrap();
-    /// map.insert("c", 3).unwrap();
-    ///
-    /// for key in map.keys() {
-    ///     println!("{}", key);
-    /// }
-    /// ```
-    pub fn keys(&self) -> impl Iterator<Item = &K> {
-        self.iter().map(|(k, _)| k)
-    }
-
-    /// Removes a key from the map, returning the value at the key if the key was previously in the
-    /// map
-    ///
-    /// Computes in **O(N)** time
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::LinearMap;
-    ///
-    /// let mut map: LinearMap<_, _, 8> = LinearMap::new();
-    /// map.insert(1, "a").unwrap();
-    /// assert_eq!(map.remove(&1), Some("a"));
-    /// assert_eq!(map.remove(&1), None);
-    /// ```
-    pub fn remove<Q>(&mut self, key: &Q) -> Option<V>
-    where
-        K: Borrow<Q>,
-        Q: Eq + ?Sized,
-    {
-        let idx = self
-            .keys()
-            .enumerate()
-            .find(|&(_, k)| k.borrow() == key)
-            .map(|(idx, _)| idx);
-
-        idx.map(|idx| self.buffer.swap_remove(idx).1)
-    }
-
-    /// An iterator visiting all values in arbitrary order
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::LinearMap;
-    ///
-    /// let mut map: LinearMap<_, _, 8> = LinearMap::new();
-    /// map.insert("a", 1).unwrap();
-    /// map.insert("b", 2).unwrap();
-    /// map.insert("c", 3).unwrap();
-    ///
-    /// for val in map.values() {
-    ///     println!("{}", val);
-    /// }
-    /// ```
-    pub fn values(&self) -> impl Iterator<Item = &V> {
-        self.iter().map(|(_, v)| v)
-    }
-
-    /// An iterator visiting all values mutably in arbitrary order
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::LinearMap;
-    ///
-    /// let mut map: LinearMap<_, _, 8> = LinearMap::new();
-    /// map.insert("a", 1).unwrap();
-    /// map.insert("b", 2).unwrap();
-    /// map.insert("c", 3).unwrap();
-    ///
-    /// for val in map.values_mut() {
-    ///     *val += 10;
-    /// }
-    ///
-    /// for val in map.values() {
-    ///     println!("{}", val);
-    /// }
-    /// ```
-    pub fn values_mut(&mut self) -> impl Iterator<Item = &mut V> {
-        self.iter_mut().map(|(_, v)| v)
-    }
-}
-
-impl<'a, K, V, Q, const N: usize> ops::Index<&'a Q> for LinearMap<K, V, N>
-where
-    K: Borrow<Q> + Eq,
-    Q: Eq + ?Sized,
-{
-    type Output = V;
-
-    fn index(&self, key: &Q) -> &V {
-        self.get(key).expect("no entry found for key")
-    }
-}
-
-impl<'a, K, V, Q, const N: usize> ops::IndexMut<&'a Q> for LinearMap<K, V, N>
-where
-    K: Borrow<Q> + Eq,
-    Q: Eq + ?Sized,
-{
-    fn index_mut(&mut self, key: &Q) -> &mut V {
-        self.get_mut(key).expect("no entry found for key")
-    }
-}
-
-impl<K, V, const N: usize> Default for LinearMap<K, V, N>
-where
-    K: Eq,
-{
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-impl<K, V, const N: usize> Clone for LinearMap<K, V, N>
-where
-    K: Eq + Clone,
-    V: Clone,
-{
-    fn clone(&self) -> Self {
-        Self {
-            buffer: self.buffer.clone(),
-        }
-    }
-}
-
-impl<K, V, const N: usize> fmt::Debug for LinearMap<K, V, N>
-where
-    K: Eq + fmt::Debug,
-    V: fmt::Debug,
-{
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        f.debug_map().entries(self.iter()).finish()
-    }
-}
-
-impl<K, V, const N: usize> FromIterator<(K, V)> for LinearMap<K, V, N>
-where
-    K: Eq,
-{
-    fn from_iter<I>(iter: I) -> Self
-    where
-        I: IntoIterator<Item = (K, V)>,
-    {
-        let mut out = Self::new();
-        out.buffer.extend(iter);
-        out
-    }
-}
-
-pub struct IntoIter<K, V, const N: usize>
-where
-    K: Eq,
-{
-    inner: <Vec<(K, V), N> as IntoIterator>::IntoIter,
-}
-
-impl<K, V, const N: usize> Iterator for IntoIter<K, V, N>
-where
-    K: Eq,
-{
-    type Item = (K, V);
-    fn next(&mut self) -> Option<Self::Item> {
-        self.inner.next()
-    }
-}
-
-impl<'a, K, V, const N: usize> IntoIterator for &'a LinearMap<K, V, N>
-where
-    K: Eq,
-{
-    type Item = (&'a K, &'a V);
-    type IntoIter = Iter<'a, K, V>;
-
-    fn into_iter(self) -> Self::IntoIter {
-        self.iter()
-    }
-}
-
-pub struct Iter<'a, K, V> {
-    iter: slice::Iter<'a, (K, V)>,
-}
-
-impl<'a, K, V> Iterator for Iter<'a, K, V> {
-    type Item = (&'a K, &'a V);
-
-    fn next(&mut self) -> Option<Self::Item> {
-        self.iter.next().map(|&(ref k, ref v)| (k, v))
-    }
-}
-
-impl<'a, K, V> Clone for Iter<'a, K, V> {
-    fn clone(&self) -> Self {
-        Self {
-            iter: self.iter.clone(),
-        }
-    }
-}
-
-impl<K, V, const N: usize> Drop for LinearMap<K, V, N> {
-    fn drop(&mut self) {
-        // heapless::Vec implements drop right?
-        drop(&self.buffer);
-        // original code below
-        // unsafe { ptr::drop_in_place(self.buffer.as_mut_slice()) }
-    }
-}
-
-pub struct IterMut<'a, K, V> {
-    iter: slice::IterMut<'a, (K, V)>,
-}
-
-impl<'a, K, V> Iterator for IterMut<'a, K, V> {
-    type Item = (&'a K, &'a mut V);
-
-    fn next(&mut self) -> Option<Self::Item> {
-        self.iter.next().map(|&mut (ref k, ref mut v)| (k, v))
-    }
-}
-
-impl<K, V, const N: usize, const N2: usize> PartialEq<LinearMap<K, V, N2>> for LinearMap<K, V, N>
-where
-    K: Eq,
-    V: PartialEq,
-{
-    fn eq(&self, other: &LinearMap<K, V, N2>) -> bool {
-        self.len() == other.len()
-            && self
-                .iter()
-                .all(|(key, value)| other.get(key).map_or(false, |v| *value == *v))
-    }
-}
-
-impl<K, V, const N: usize> Eq for LinearMap<K, V, N>
-where
-    K: Eq,
-    V: PartialEq,
-{
-}
-
-#[cfg(test)]
-mod test {
-    use crate::LinearMap;
-
-    #[test]
-    fn static_new() {
-        static mut _L: LinearMap<i32, i32, 8> = LinearMap::new();
-    }
-
-    #[test]
-    fn partial_eq() {
-        {
-            let mut a = LinearMap::<_, _, 1>::new();
-            a.insert("k1", "v1").unwrap();
-
-            let mut b = LinearMap::<_, _, 2>::new();
-            b.insert("k1", "v1").unwrap();
-
-            assert!(a == b);
-
-            b.insert("k2", "v2").unwrap();
-
-            assert!(a != b);
-        }
-
-        {
-            let mut a = LinearMap::<_, _, 2>::new();
-            a.insert("k1", "v1").unwrap();
-            a.insert("k2", "v2").unwrap();
-
-            let mut b = LinearMap::<_, _, 2>::new();
-            b.insert("k2", "v2").unwrap();
-            b.insert("k1", "v1").unwrap();
-
-            assert!(a == b);
-        }
-    }
-
-    // TODO: drop test
-}
-
\ No newline at end of file diff --git a/docs/doc/src/heapless/sealed.rs.html b/docs/doc/src/heapless/sealed.rs.html deleted file mode 100644 index fee5a48..0000000 --- a/docs/doc/src/heapless/sealed.rs.html +++ /dev/null @@ -1,117 +0,0 @@ -sealed.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-
#[allow(dead_code)]
-#[allow(path_statements)]
-pub(crate) const fn smaller_than<const N: usize, const MAX: usize>() {
-    Assert::<N, MAX>::LESS;
-}
-
-#[allow(dead_code)]
-#[allow(path_statements)]
-pub(crate) const fn greater_than_eq_0<const N: usize>() {
-    Assert::<N, 0>::GREATER_EQ;
-}
-
-#[allow(dead_code)]
-#[allow(path_statements)]
-pub(crate) const fn greater_than_0<const N: usize>() {
-    Assert::<N, 0>::GREATER;
-}
-
-#[allow(dead_code)]
-#[allow(path_statements)]
-pub(crate) const fn greater_than_1<const N: usize>() {
-    Assert::<N, 1>::GREATER;
-}
-
-#[allow(dead_code)]
-#[allow(path_statements)]
-pub(crate) const fn power_of_two<const N: usize>() {
-    Assert::<N, 0>::GREATER;
-    Assert::<N, 0>::POWER_OF_TWO;
-}
-
-#[allow(dead_code)]
-/// Const assert hack
-pub struct Assert<const L: usize, const R: usize>;
-
-#[allow(dead_code)]
-impl<const L: usize, const R: usize> Assert<L, R> {
-    /// Const assert hack
-    pub const GREATER_EQ: usize = L - R;
-
-    /// Const assert hack
-    pub const LESS_EQ: usize = R - L;
-
-    /// Const assert hack
-    pub const NOT_EQ: isize = 0 / (R as isize - L as isize);
-
-    /// Const assert hack
-    pub const EQ: usize = (R - L) + (L - R);
-
-    /// Const assert hack
-    pub const GREATER: usize = L - R - 1;
-
-    /// Const assert hack
-    pub const LESS: usize = R - L - 1;
-
-    /// Const assert hack
-    pub const POWER_OF_TWO: usize = 0 - (L & (L - 1));
-}
-
\ No newline at end of file diff --git a/docs/doc/src/heapless/sorted_linked_list.rs.html b/docs/doc/src/heapless/sorted_linked_list.rs.html deleted file mode 100644 index 96cc198..0000000 --- a/docs/doc/src/heapless/sorted_linked_list.rs.html +++ /dev/null @@ -1,1733 +0,0 @@ -sorted_linked_list.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-
//! A fixed sorted priority linked list, similar to [`BinaryHeap`] but with different properties
-//! on `push`, `pop`, etc.
-//! For example, the sorting of the list will never `memcpy` the underlying value, so having large
-//! objects in the list will not cause a performance hit.
-//!
-//! # Examples
-//!
-//! ```
-//! use heapless::sorted_linked_list::{SortedLinkedList, Max};
-//! let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-//!
-//! // The largest value will always be first
-//! ll.push(1).unwrap();
-//! assert_eq!(ll.peek(), Some(&1));
-//!
-//! ll.push(2).unwrap();
-//! assert_eq!(ll.peek(), Some(&2));
-//!
-//! ll.push(3).unwrap();
-//! assert_eq!(ll.peek(), Some(&3));
-//!
-//! // This will not fit in the queue.
-//! assert_eq!(ll.push(4), Err(4));
-//! ```
-//!
-//! [`BinaryHeap`]: `crate::binary_heap::BinaryHeap`
-
-use core::cmp::Ordering;
-use core::fmt;
-use core::marker::PhantomData;
-use core::mem::MaybeUninit;
-use core::ops::{Deref, DerefMut};
-use core::ptr;
-
-/// Trait for defining an index for the linked list, never implemented by users.
-pub trait SortedLinkedListIndex: Copy {
-    #[doc(hidden)]
-    unsafe fn new_unchecked(val: usize) -> Self;
-    #[doc(hidden)]
-    unsafe fn get_unchecked(self) -> usize;
-    #[doc(hidden)]
-    fn option(self) -> Option<usize>;
-    #[doc(hidden)]
-    fn none() -> Self;
-}
-
-/// Marker for Min sorted [`SortedLinkedList`].
-pub struct Min;
-
-/// Marker for Max sorted [`SortedLinkedList`].
-pub struct Max;
-
-/// The linked list kind: min-list or max-list
-pub trait Kind: private::Sealed {
-    #[doc(hidden)]
-    fn ordering() -> Ordering;
-}
-
-impl Kind for Min {
-    fn ordering() -> Ordering {
-        Ordering::Less
-    }
-}
-
-impl Kind for Max {
-    fn ordering() -> Ordering {
-        Ordering::Greater
-    }
-}
-
-/// Sealed traits
-mod private {
-    pub trait Sealed {}
-}
-
-impl private::Sealed for Max {}
-impl private::Sealed for Min {}
-
-/// A node in the [`SortedLinkedList`].
-pub struct Node<T, Idx> {
-    val: MaybeUninit<T>,
-    next: Idx,
-}
-
-/// The linked list.
-pub struct SortedLinkedList<T, Idx, K, const N: usize>
-where
-    Idx: SortedLinkedListIndex,
-{
-    list: [Node<T, Idx>; N],
-    head: Idx,
-    free: Idx,
-    _kind: PhantomData<K>,
-}
-
-// Internal macro for generating indexes for the linkedlist and const new for the linked list
-macro_rules! impl_index_and_const_new {
-    ($name:ident, $ty:ty, $new_name:ident, $max_val:expr) => {
-        /// Index for the [`SortedLinkedList`] with specific backing storage.
-        #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
-        pub struct $name($ty);
-
-        impl SortedLinkedListIndex for $name {
-            #[inline(always)]
-            unsafe fn new_unchecked(val: usize) -> Self {
-                Self::new_unchecked(val as $ty)
-            }
-
-            /// This is only valid if `self.option()` is not `None`.
-            #[inline(always)]
-            unsafe fn get_unchecked(self) -> usize {
-                self.0 as usize
-            }
-
-            #[inline(always)]
-            fn option(self) -> Option<usize> {
-                if self.0 == <$ty>::MAX {
-                    None
-                } else {
-                    Some(self.0 as usize)
-                }
-            }
-
-            #[inline(always)]
-            fn none() -> Self {
-                Self::none()
-            }
-        }
-
-        impl $name {
-            /// Needed for a `const fn new()`.
-            #[inline]
-            const unsafe fn new_unchecked(value: $ty) -> Self {
-                $name(value)
-            }
-
-            /// Needed for a `const fn new()`.
-            #[inline]
-            const fn none() -> Self {
-                $name(<$ty>::MAX)
-            }
-        }
-
-        impl<T, K, const N: usize> SortedLinkedList<T, $name, K, N> {
-            const UNINIT: Node<T, $name> = Node {
-                val: MaybeUninit::uninit(),
-                next: $name::none(),
-            };
-
-            /// Create a new linked list.
-            pub const fn $new_name() -> Self {
-                // Const assert N < MAX
-                crate::sealed::smaller_than::<N, $max_val>();
-
-                let mut list = SortedLinkedList {
-                    list: [Self::UNINIT; N],
-                    head: $name::none(),
-                    free: unsafe { $name::new_unchecked(0) },
-                    _kind: PhantomData,
-                };
-
-                if N == 0 {
-                    list.free = $name::none();
-                    return list;
-                }
-
-                let mut free = 0;
-
-                // Initialize indexes
-                while free < N - 1 {
-                    list.list[free].next = unsafe { $name::new_unchecked(free as $ty + 1) };
-                    free += 1;
-                }
-
-                list
-            }
-        }
-    };
-}
-
-impl_index_and_const_new!(LinkedIndexU8, u8, new_u8, { u8::MAX as usize - 1 });
-impl_index_and_const_new!(LinkedIndexU16, u16, new_u16, { u16::MAX as usize - 1 });
-impl_index_and_const_new!(LinkedIndexUsize, usize, new_usize, { usize::MAX - 1 });
-
-impl<T, Idx, K, const N: usize> SortedLinkedList<T, Idx, K, N>
-where
-    Idx: SortedLinkedListIndex,
-{
-    /// Internal access helper
-    #[inline(always)]
-    fn node_at(&self, index: usize) -> &Node<T, Idx> {
-        // Safety: The entire `self.list` is initialized in `new`, which makes this safe.
-        unsafe { self.list.get_unchecked(index) }
-    }
-
-    /// Internal access helper
-    #[inline(always)]
-    fn node_at_mut(&mut self, index: usize) -> &mut Node<T, Idx> {
-        // Safety: The entire `self.list` is initialized in `new`, which makes this safe.
-        unsafe { self.list.get_unchecked_mut(index) }
-    }
-
-    /// Internal access helper
-    #[inline(always)]
-    fn write_data_in_node_at(&mut self, index: usize, data: T) {
-        // Safety: The entire `self.list` is initialized in `new`, which makes this safe.
-        unsafe {
-            self.node_at_mut(index).val.as_mut_ptr().write(data);
-        }
-    }
-
-    /// Internal access helper
-    #[inline(always)]
-    fn read_data_in_node_at(&self, index: usize) -> &T {
-        // Safety: The entire `self.list` is initialized in `new`, which makes this safe.
-        unsafe { &*self.node_at(index).val.as_ptr() }
-    }
-
-    /// Internal access helper
-    #[inline(always)]
-    fn read_mut_data_in_node_at(&mut self, index: usize) -> &mut T {
-        // Safety: The entire `self.list` is initialized in `new`, which makes this safe.
-        unsafe { &mut *self.node_at_mut(index).val.as_mut_ptr() }
-    }
-
-    /// Internal access helper
-    #[inline(always)]
-    fn extract_data_in_node_at(&mut self, index: usize) -> T {
-        // Safety: The entire `self.list` is initialized in `new`, which makes this safe.
-        unsafe { self.node_at(index).val.as_ptr().read() }
-    }
-}
-
-impl<T, Idx, K, const N: usize> SortedLinkedList<T, Idx, K, N>
-where
-    T: Ord,
-    Idx: SortedLinkedListIndex,
-    K: Kind,
-{
-    /// Pushes a value onto the list without checking if the list is full.
-    ///
-    /// Complexity is worst-case `O(N)`.
-    ///
-    /// # Safety
-    ///
-    /// Assumes that the list is not full.
-    pub unsafe fn push_unchecked(&mut self, value: T) {
-        let new = self.free.get_unchecked();
-
-        // Store the data and update the next free spot
-        self.write_data_in_node_at(new, value);
-        self.free = self.node_at(new).next;
-
-        if let Some(head) = self.head.option() {
-            // Check if we need to replace head
-            if self
-                .read_data_in_node_at(head)
-                .cmp(self.read_data_in_node_at(new))
-                != K::ordering()
-            {
-                self.node_at_mut(new).next = self.head;
-                self.head = Idx::new_unchecked(new);
-            } else {
-                // It's not head, search the list for the correct placement
-                let mut current = head;
-
-                while let Some(next) = self.node_at(current).next.option() {
-                    if self
-                        .read_data_in_node_at(next)
-                        .cmp(self.read_data_in_node_at(new))
-                        != K::ordering()
-                    {
-                        break;
-                    }
-
-                    current = next;
-                }
-
-                self.node_at_mut(new).next = self.node_at(current).next;
-                self.node_at_mut(current).next = Idx::new_unchecked(new);
-            }
-        } else {
-            self.node_at_mut(new).next = self.head;
-            self.head = Idx::new_unchecked(new);
-        }
-    }
-
-    /// Pushes an element to the linked list and sorts it into place.
-    ///
-    /// Complexity is worst-case `O(N)`.
-    ///
-    /// # Example
-    ///
-    /// ```
-    /// use heapless::sorted_linked_list::{SortedLinkedList, Max};
-    /// let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-    ///
-    /// // The largest value will always be first
-    /// ll.push(1).unwrap();
-    /// assert_eq!(ll.peek(), Some(&1));
-    ///
-    /// ll.push(2).unwrap();
-    /// assert_eq!(ll.peek(), Some(&2));
-    ///
-    /// ll.push(3).unwrap();
-    /// assert_eq!(ll.peek(), Some(&3));
-    ///
-    /// // This will not fit in the queue.
-    /// assert_eq!(ll.push(4), Err(4));
-    /// ```
-    pub fn push(&mut self, value: T) -> Result<(), T> {
-        if !self.is_full() {
-            Ok(unsafe { self.push_unchecked(value) })
-        } else {
-            Err(value)
-        }
-    }
-
-    /// Get an iterator over the sorted list.
-    ///
-    /// # Example
-    ///
-    /// ```
-    /// use heapless::sorted_linked_list::{SortedLinkedList, Max};
-    /// let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-    ///
-    /// ll.push(1).unwrap();
-    /// ll.push(2).unwrap();
-    ///
-    /// let mut iter = ll.iter();
-    ///
-    /// assert_eq!(iter.next(), Some(&2));
-    /// assert_eq!(iter.next(), Some(&1));
-    /// assert_eq!(iter.next(), None);
-    /// ```
-    pub fn iter(&self) -> Iter<'_, T, Idx, K, N> {
-        Iter {
-            list: self,
-            index: self.head,
-        }
-    }
-
-    /// Find an element in the list that can be changed and resorted.
-    ///
-    /// # Example
-    ///
-    /// ```
-    /// use heapless::sorted_linked_list::{SortedLinkedList, Max};
-    /// let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-    ///
-    /// ll.push(1).unwrap();
-    /// ll.push(2).unwrap();
-    /// ll.push(3).unwrap();
-    ///
-    /// // Find a value and update it
-    /// let mut find = ll.find_mut(|v| *v == 2).unwrap();
-    /// *find += 1000;
-    /// find.finish();
-    ///
-    /// assert_eq!(ll.pop(), Ok(1002));
-    /// assert_eq!(ll.pop(), Ok(3));
-    /// assert_eq!(ll.pop(), Ok(1));
-    /// assert_eq!(ll.pop(), Err(()));
-    /// ```
-    pub fn find_mut<F>(&mut self, mut f: F) -> Option<FindMut<'_, T, Idx, K, N>>
-    where
-        F: FnMut(&T) -> bool,
-    {
-        let head = self.head.option()?;
-
-        // Special-case, first element
-        if f(self.read_data_in_node_at(head)) {
-            return Some(FindMut {
-                is_head: true,
-                prev_index: Idx::none(),
-                index: self.head,
-                list: self,
-                maybe_changed: false,
-            });
-        }
-
-        let mut current = head;
-
-        while let Some(next) = self.node_at(current).next.option() {
-            if f(self.read_data_in_node_at(next)) {
-                return Some(FindMut {
-                    is_head: false,
-                    prev_index: unsafe { Idx::new_unchecked(current) },
-                    index: unsafe { Idx::new_unchecked(next) },
-                    list: self,
-                    maybe_changed: false,
-                });
-            }
-
-            current = next;
-        }
-
-        None
-    }
-
-    /// Peek at the first element.
-    ///
-    /// # Example
-    ///
-    /// ```
-    /// use heapless::sorted_linked_list::{SortedLinkedList, Max, Min};
-    /// let mut ll_max: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-    ///
-    /// // The largest value will always be first
-    /// ll_max.push(1).unwrap();
-    /// assert_eq!(ll_max.peek(), Some(&1));
-    /// ll_max.push(2).unwrap();
-    /// assert_eq!(ll_max.peek(), Some(&2));
-    /// ll_max.push(3).unwrap();
-    /// assert_eq!(ll_max.peek(), Some(&3));
-    ///
-    /// let mut ll_min: SortedLinkedList<_, _, Min, 3> = SortedLinkedList::new_usize();
-    ///
-    /// // The Smallest value will always be first
-    /// ll_min.push(3).unwrap();
-    /// assert_eq!(ll_min.peek(), Some(&3));
-    /// ll_min.push(2).unwrap();
-    /// assert_eq!(ll_min.peek(), Some(&2));
-    /// ll_min.push(1).unwrap();
-    /// assert_eq!(ll_min.peek(), Some(&1));
-    /// ```
-    pub fn peek(&self) -> Option<&T> {
-        self.head
-            .option()
-            .map(|head| self.read_data_in_node_at(head))
-    }
-
-    /// Pop an element from the list without checking so the list is not empty.
-    ///
-    /// # Safety
-    ///
-    /// Assumes that the list is not empty.
-    pub unsafe fn pop_unchecked(&mut self) -> T {
-        let head = self.head.get_unchecked();
-        let current = head;
-        self.head = self.node_at(head).next;
-        self.node_at_mut(current).next = self.free;
-        self.free = Idx::new_unchecked(current);
-
-        self.extract_data_in_node_at(current)
-    }
-
-    /// Pops the first element in the list.
-    ///
-    /// Complexity is worst-case `O(1)`.
-    ///
-    /// # Example
-    ///
-    /// ```
-    /// use heapless::sorted_linked_list::{SortedLinkedList, Max};
-    /// let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-    ///
-    /// ll.push(1).unwrap();
-    /// ll.push(2).unwrap();
-    ///
-    /// assert_eq!(ll.pop(), Ok(2));
-    /// assert_eq!(ll.pop(), Ok(1));
-    /// assert_eq!(ll.pop(), Err(()));
-    /// ```
-    pub fn pop(&mut self) -> Result<T, ()> {
-        if !self.is_empty() {
-            Ok(unsafe { self.pop_unchecked() })
-        } else {
-            Err(())
-        }
-    }
-
-    /// Checks if the linked list is full.
-    ///
-    /// # Example
-    ///
-    /// ```
-    /// use heapless::sorted_linked_list::{SortedLinkedList, Max};
-    /// let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-    ///
-    /// assert_eq!(ll.is_full(), false);
-    ///
-    /// ll.push(1).unwrap();
-    /// assert_eq!(ll.is_full(), false);
-    /// ll.push(2).unwrap();
-    /// assert_eq!(ll.is_full(), false);
-    /// ll.push(3).unwrap();
-    /// assert_eq!(ll.is_full(), true);
-    /// ```
-    #[inline]
-    pub fn is_full(&self) -> bool {
-        self.free.option().is_none()
-    }
-
-    /// Checks if the linked list is empty.
-    ///
-    /// # Example
-    ///
-    /// ```
-    /// use heapless::sorted_linked_list::{SortedLinkedList, Max};
-    /// let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-    ///
-    /// assert_eq!(ll.is_empty(), true);
-    ///
-    /// ll.push(1).unwrap();
-    /// assert_eq!(ll.is_empty(), false);
-    /// ```
-    #[inline]
-    pub fn is_empty(&self) -> bool {
-        self.head.option().is_none()
-    }
-}
-
-/// Iterator for the linked list.
-pub struct Iter<'a, T, Idx, K, const N: usize>
-where
-    T: Ord,
-    Idx: SortedLinkedListIndex,
-    K: Kind,
-{
-    list: &'a SortedLinkedList<T, Idx, K, N>,
-    index: Idx,
-}
-
-impl<'a, T, Idx, K, const N: usize> Iterator for Iter<'a, T, Idx, K, N>
-where
-    T: Ord,
-    Idx: SortedLinkedListIndex,
-    K: Kind,
-{
-    type Item = &'a T;
-
-    fn next(&mut self) -> Option<Self::Item> {
-        let index = self.index.option()?;
-
-        let node = self.list.node_at(index);
-        self.index = node.next;
-
-        Some(self.list.read_data_in_node_at(index))
-    }
-}
-
-/// Comes from [`SortedLinkedList::find_mut`].
-pub struct FindMut<'a, T, Idx, K, const N: usize>
-where
-    T: Ord,
-    Idx: SortedLinkedListIndex,
-    K: Kind,
-{
-    list: &'a mut SortedLinkedList<T, Idx, K, N>,
-    is_head: bool,
-    prev_index: Idx,
-    index: Idx,
-    maybe_changed: bool,
-}
-
-impl<'a, T, Idx, K, const N: usize> FindMut<'a, T, Idx, K, N>
-where
-    T: Ord,
-    Idx: SortedLinkedListIndex,
-    K: Kind,
-{
-    fn pop_internal(&mut self) -> T {
-        if self.is_head {
-            // If it is the head element, we can do a normal pop
-            unsafe { self.list.pop_unchecked() }
-        } else {
-            // Somewhere in the list
-            let prev = unsafe { self.prev_index.get_unchecked() };
-            let curr = unsafe { self.index.get_unchecked() };
-
-            // Re-point the previous index
-            self.list.node_at_mut(prev).next = self.list.node_at_mut(curr).next;
-
-            // Release the index into the free queue
-            self.list.node_at_mut(curr).next = self.list.free;
-            self.list.free = self.index;
-
-            self.list.extract_data_in_node_at(curr)
-        }
-    }
-
-    /// This will pop the element from the list.
-    ///
-    /// Complexity is worst-case `O(1)`.
-    ///
-    /// # Example
-    ///
-    /// ```
-    /// use heapless::sorted_linked_list::{SortedLinkedList, Max};
-    /// let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-    ///
-    /// ll.push(1).unwrap();
-    /// ll.push(2).unwrap();
-    /// ll.push(3).unwrap();
-    ///
-    /// // Find a value and update it
-    /// let mut find = ll.find_mut(|v| *v == 2).unwrap();
-    /// find.pop();
-    ///
-    /// assert_eq!(ll.pop(), Ok(3));
-    /// assert_eq!(ll.pop(), Ok(1));
-    /// assert_eq!(ll.pop(), Err(()));
-    /// ```
-    #[inline]
-    pub fn pop(mut self) -> T {
-        self.pop_internal()
-    }
-
-    /// This will resort the element into the correct position in the list if needed. The resorting
-    /// will only happen if the element has been accessed mutably.
-    ///
-    /// Same as calling `drop`.
-    ///
-    /// Complexity is worst-case `O(N)`.
-    ///
-    /// # Example
-    ///
-    /// ```
-    /// use heapless::sorted_linked_list::{SortedLinkedList, Max};
-    /// let mut ll: SortedLinkedList<_, _, Max, 3> = SortedLinkedList::new_usize();
-    ///
-    /// ll.push(1).unwrap();
-    /// ll.push(2).unwrap();
-    /// ll.push(3).unwrap();
-    ///
-    /// let mut find = ll.find_mut(|v| *v == 2).unwrap();
-    /// find.finish(); // No resort, we did not access the value.
-    ///
-    /// let mut find = ll.find_mut(|v| *v == 2).unwrap();
-    /// *find += 1000;
-    /// find.finish(); // Will resort, we accessed (and updated) the value.
-    ///
-    /// assert_eq!(ll.pop(), Ok(1002));
-    /// assert_eq!(ll.pop(), Ok(3));
-    /// assert_eq!(ll.pop(), Ok(1));
-    /// assert_eq!(ll.pop(), Err(()));
-    /// ```
-    #[inline]
-    pub fn finish(self) {
-        drop(self)
-    }
-}
-
-impl<T, Idx, K, const N: usize> Drop for FindMut<'_, T, Idx, K, N>
-where
-    T: Ord,
-    Idx: SortedLinkedListIndex,
-    K: Kind,
-{
-    fn drop(&mut self) {
-        // Only resort the list if the element has changed
-        if self.maybe_changed {
-            let val = self.pop_internal();
-            unsafe { self.list.push_unchecked(val) };
-        }
-    }
-}
-
-impl<T, Idx, K, const N: usize> Deref for FindMut<'_, T, Idx, K, N>
-where
-    T: Ord,
-    Idx: SortedLinkedListIndex,
-    K: Kind,
-{
-    type Target = T;
-
-    fn deref(&self) -> &Self::Target {
-        self.list
-            .read_data_in_node_at(unsafe { self.index.get_unchecked() })
-    }
-}
-
-impl<T, Idx, K, const N: usize> DerefMut for FindMut<'_, T, Idx, K, N>
-where
-    T: Ord,
-    Idx: SortedLinkedListIndex,
-    K: Kind,
-{
-    fn deref_mut(&mut self) -> &mut Self::Target {
-        self.maybe_changed = true;
-        self.list
-            .read_mut_data_in_node_at(unsafe { self.index.get_unchecked() })
-    }
-}
-
-// /// Useful for debug during development.
-// impl<T, Idx, K, const N: usize> fmt::Debug for FindMut<'_, T, Idx, K, N>
-// where
-//     T: Ord + core::fmt::Debug,
-//     Idx: SortedLinkedListIndex,
-//     K: Kind,
-// {
-//     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-//         f.debug_struct("FindMut")
-//             .field("prev_index", &self.prev_index.option())
-//             .field("index", &self.index.option())
-//             .field(
-//                 "prev_value",
-//                 &self
-//                     .list
-//                     .read_data_in_node_at(self.prev_index.option().unwrap()),
-//             )
-//             .field(
-//                 "value",
-//                 &self.list.read_data_in_node_at(self.index.option().unwrap()),
-//             )
-//             .finish()
-//     }
-// }
-
-impl<T, Idx, K, const N: usize> fmt::Debug for SortedLinkedList<T, Idx, K, N>
-where
-    T: Ord + core::fmt::Debug,
-    Idx: SortedLinkedListIndex,
-    K: Kind,
-{
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        f.debug_list().entries(self.iter()).finish()
-    }
-}
-
-impl<T, Idx, K, const N: usize> Drop for SortedLinkedList<T, Idx, K, N>
-where
-    Idx: SortedLinkedListIndex,
-{
-    fn drop(&mut self) {
-        let mut index = self.head;
-
-        while let Some(i) = index.option() {
-            let node = self.node_at_mut(i);
-            index = node.next;
-
-            unsafe {
-                ptr::drop_in_place(node.val.as_mut_ptr());
-            }
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use super::*;
-
-    #[test]
-    fn const_new() {
-        static mut _V1: SortedLinkedList<u32, LinkedIndexU8, Max, 100> = SortedLinkedList::new_u8();
-        static mut _V2: SortedLinkedList<u32, LinkedIndexU16, Max, 10_000> =
-            SortedLinkedList::new_u16();
-        static mut _V3: SortedLinkedList<u32, LinkedIndexUsize, Max, 100_000> =
-            SortedLinkedList::new_usize();
-    }
-
-    #[test]
-    fn test_peek() {
-        let mut ll: SortedLinkedList<u32, LinkedIndexUsize, Max, 3> = SortedLinkedList::new_usize();
-
-        ll.push(1).unwrap();
-        assert_eq!(ll.peek().unwrap(), &1);
-
-        ll.push(2).unwrap();
-        assert_eq!(ll.peek().unwrap(), &2);
-
-        ll.push(3).unwrap();
-        assert_eq!(ll.peek().unwrap(), &3);
-
-        let mut ll: SortedLinkedList<u32, LinkedIndexUsize, Min, 3> = SortedLinkedList::new_usize();
-
-        ll.push(2).unwrap();
-        assert_eq!(ll.peek().unwrap(), &2);
-
-        ll.push(1).unwrap();
-        assert_eq!(ll.peek().unwrap(), &1);
-
-        ll.push(3).unwrap();
-        assert_eq!(ll.peek().unwrap(), &1);
-    }
-
-    #[test]
-    fn test_full() {
-        let mut ll: SortedLinkedList<u32, LinkedIndexUsize, Max, 3> = SortedLinkedList::new_usize();
-        ll.push(1).unwrap();
-        ll.push(2).unwrap();
-        ll.push(3).unwrap();
-
-        assert!(ll.is_full())
-    }
-
-    #[test]
-    fn test_empty() {
-        let ll: SortedLinkedList<u32, LinkedIndexUsize, Max, 3> = SortedLinkedList::new_usize();
-
-        assert!(ll.is_empty())
-    }
-
-    #[test]
-    fn test_zero_size() {
-        let ll: SortedLinkedList<u32, LinkedIndexUsize, Max, 0> = SortedLinkedList::new_usize();
-
-        assert!(ll.is_empty());
-        assert!(ll.is_full());
-    }
-
-    #[test]
-    fn test_rejected_push() {
-        let mut ll: SortedLinkedList<u32, LinkedIndexUsize, Max, 3> = SortedLinkedList::new_usize();
-        ll.push(1).unwrap();
-        ll.push(2).unwrap();
-        ll.push(3).unwrap();
-
-        // This won't fit
-        let r = ll.push(4);
-
-        assert_eq!(r, Err(4));
-    }
-
-    #[test]
-    fn test_updating() {
-        let mut ll: SortedLinkedList<u32, LinkedIndexUsize, Max, 3> = SortedLinkedList::new_usize();
-        ll.push(1).unwrap();
-        ll.push(2).unwrap();
-        ll.push(3).unwrap();
-
-        let mut find = ll.find_mut(|v| *v == 2).unwrap();
-
-        *find += 1000;
-        find.finish();
-
-        assert_eq!(ll.peek().unwrap(), &1002);
-
-        let mut find = ll.find_mut(|v| *v == 3).unwrap();
-
-        *find += 1000;
-        find.finish();
-
-        assert_eq!(ll.peek().unwrap(), &1003);
-
-        // Remove largest element
-        ll.find_mut(|v| *v == 1003).unwrap().pop();
-
-        assert_eq!(ll.peek().unwrap(), &1002);
-    }
-
-    #[test]
-    fn test_updating_1() {
-        let mut ll: SortedLinkedList<u32, LinkedIndexUsize, Max, 3> = SortedLinkedList::new_usize();
-        ll.push(1).unwrap();
-
-        let v = ll.pop().unwrap();
-
-        assert_eq!(v, 1);
-    }
-
-    #[test]
-    fn test_updating_2() {
-        let mut ll: SortedLinkedList<u32, LinkedIndexUsize, Max, 3> = SortedLinkedList::new_usize();
-        ll.push(1).unwrap();
-
-        let mut find = ll.find_mut(|v| *v == 1).unwrap();
-
-        *find += 1000;
-        find.finish();
-
-        assert_eq!(ll.peek().unwrap(), &1001);
-    }
-}
-
\ No newline at end of file diff --git a/docs/doc/src/heapless/string.rs.html b/docs/doc/src/heapless/string.rs.html deleted file mode 100644 index a3f1aa4..0000000 --- a/docs/doc/src/heapless/string.rs.html +++ /dev/null @@ -1,1441 +0,0 @@ -string.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-
use core::{cmp::Ordering, fmt, fmt::Write, hash, iter, ops, str};
-
-use hash32;
-
-use crate::Vec;
-
-/// A fixed capacity [`String`](https://doc.rust-lang.org/std/string/struct.String.html)
-pub struct String<const N: usize> {
-    vec: Vec<u8, N>,
-}
-
-impl<const N: usize> String<N> {
-    /// Constructs a new, empty `String` with a fixed capacity of `N` bytes
-    ///
-    /// # Examples
-    ///
-    /// Basic usage:
-    ///
-    /// ```
-    /// use heapless::String;
-    ///
-    /// // allocate the string on the stack
-    /// let mut s: String<4> = String::new();
-    ///
-    /// // allocate the string in a static variable
-    /// static mut S: String<4> = String::new();
-    /// ```
-    #[inline]
-    pub const fn new() -> Self {
-        Self { vec: Vec::new() }
-    }
-
-    /// Converts a `String` into a byte vector.
-    ///
-    /// This consumes the `String`, so we do not need to copy its contents.
-    ///
-    /// # Examples
-    ///
-    /// Basic usage:
-    ///
-    /// ```
-    /// use heapless::String;
-    ///
-    /// let s: String<4> = String::from("ab");
-    /// let b = s.into_bytes();
-    /// assert!(b.len() == 2);
-    ///
-    /// assert_eq!(&['a' as u8, 'b' as u8], &b[..]);
-    /// ```
-    #[inline]
-    pub fn into_bytes(self) -> Vec<u8, N> {
-        self.vec
-    }
-
-    /// Extracts a string slice containing the entire string.
-    ///
-    /// # Examples
-    ///
-    /// Basic usage:
-    ///
-    /// ```
-    /// use heapless::String;
-    ///
-    /// let mut s: String<4> = String::from("ab");
-    /// assert!(s.as_str() == "ab");
-    ///
-    /// let _s = s.as_str();
-    /// // s.push('c'); // <- cannot borrow `s` as mutable because it is also borrowed as immutable
-    /// ```
-    #[inline]
-    pub fn as_str(&self) -> &str {
-        unsafe { str::from_utf8_unchecked(self.vec.as_slice()) }
-    }
-
-    /// Converts a `String` into a mutable string slice.
-    ///
-    /// # Examples
-    ///
-    /// Basic usage:
-    ///
-    /// ```
-    /// use heapless::String;
-    ///
-    /// let mut s: String<4> = String::from("ab");
-    /// let s = s.as_mut_str();
-    /// s.make_ascii_uppercase();
-    /// ```
-    #[inline]
-    pub fn as_mut_str(&mut self) -> &mut str {
-        unsafe { str::from_utf8_unchecked_mut(self.vec.as_mut_slice()) }
-    }
-
-    /// Returns a mutable reference to the contents of this `String`.
-    ///
-    /// # Safety
-    ///
-    /// This function is unsafe because it does not check that the bytes passed
-    /// to it are valid UTF-8. If this constraint is violated, it may cause
-    /// memory unsafety issues with future users of the `String`, as the rest of
-    /// the library assumes that `String`s are valid UTF-8.
-    ///
-    /// # Examples
-    ///
-    /// Basic usage:
-    ///
-    /// ```
-    /// let mut s = String::from("hello");
-    ///
-    /// unsafe {
-    ///     let vec = s.as_mut_vec();
-    ///     assert_eq!(&[104, 101, 108, 108, 111][..], &vec[..]);
-    ///
-    ///     vec.reverse();
-    /// }
-    /// assert_eq!(s, "olleh");
-    /// ```
-    pub unsafe fn as_mut_vec(&mut self) -> &mut Vec<u8, N> {
-        &mut self.vec
-    }
-
-    /// Appends a given string slice onto the end of this `String`.
-    ///
-    /// # Examples
-    ///
-    /// Basic usage:
-    ///
-    /// ```
-    /// use heapless::String;
-    ///
-    /// let mut s: String<8> = String::from("foo");
-    ///
-    /// assert!(s.push_str("bar").is_ok());
-    ///
-    /// assert_eq!("foobar", s);
-    ///
-    /// assert!(s.push_str("tender").is_err());
-    /// ```
-    #[inline]
-    pub fn push_str(&mut self, string: &str) -> Result<(), ()> {
-        self.vec.extend_from_slice(string.as_bytes())
-    }
-
-    /// Returns the maximum number of elements the String can hold
-    ///
-    /// # Examples
-    ///
-    /// Basic usage:
-    ///
-    /// ```
-    /// use heapless::String;
-    ///
-    /// let mut s: String<4> = String::new();
-    /// assert!(s.capacity() == 4);
-    /// ```
-    #[inline]
-    pub fn capacity(&self) -> usize {
-        self.vec.capacity()
-    }
-
-    /// Appends the given [`char`] to the end of this `String`.
-    ///
-    /// [`char`]: ../../std/primitive.char.html
-    ///
-    /// # Examples
-    ///
-    /// Basic usage:
-    ///
-    /// ```
-    /// use heapless::String;
-    ///
-    /// let mut s: String<8> = String::from("abc");
-    ///
-    /// s.push('1').unwrap();
-    /// s.push('2').unwrap();
-    /// s.push('3').unwrap();
-    ///
-    /// assert!("abc123" == s.as_str());
-    ///
-    /// assert_eq!("abc123", s);
-    /// ```
-    #[inline]
-    pub fn push(&mut self, c: char) -> Result<(), ()> {
-        match c.len_utf8() {
-            1 => self.vec.push(c as u8).map_err(|_| {}),
-            _ => self
-                .vec
-                .extend_from_slice(c.encode_utf8(&mut [0; 4]).as_bytes()),
-        }
-    }
-
-    /// Shortens this `String` to the specified length.
-    ///
-    /// If `new_len` is greater than the string's current length, this has no
-    /// effect.
-    ///
-    /// Note that this method has no effect on the allocated capacity
-    /// of the string
-    ///
-    /// # Panics
-    ///
-    /// Panics if `new_len` does not lie on a [`char`] boundary.
-    ///
-    /// [`char`]: ../../std/primitive.char.html
-    ///
-    /// # Examples
-    ///
-    /// Basic usage:
-    ///
-    /// ```
-    /// use heapless::String;
-    ///
-    /// let mut s: String<8> = String::from("hello");
-    ///
-    /// s.truncate(2);
-    ///
-    /// assert_eq!("he", s);
-    /// ```
-    #[inline]
-    pub fn truncate(&mut self, new_len: usize) {
-        if new_len <= self.len() {
-            assert!(self.is_char_boundary(new_len));
-            self.vec.truncate(new_len)
-        }
-    }
-
-    /// Removes the last character from the string buffer and returns it.
-    ///
-    /// Returns [`None`] if this `String` is empty.
-    ///
-    /// [`None`]: ../../std/option/enum.Option.html#variant.None
-    ///
-    /// # Examples
-    ///
-    /// Basic usage:
-    ///
-    /// ```
-    /// use heapless::String;
-    ///
-    /// let mut s: String<8> = String::from("foo");
-    ///
-    /// assert_eq!(s.pop(), Some('o'));
-    /// assert_eq!(s.pop(), Some('o'));
-    /// assert_eq!(s.pop(), Some('f'));
-    ///
-    /// assert_eq!(s.pop(), None);
-    /// ```
-    pub fn pop(&mut self) -> Option<char> {
-        let ch = self.chars().rev().next()?;
-
-        // pop bytes that correspond to `ch`
-        for _ in 0..ch.len_utf8() {
-            unsafe {
-                self.vec.pop_unchecked();
-            }
-        }
-
-        Some(ch)
-    }
-
-    /// Truncates this `String`, removing all contents.
-    ///
-    /// While this means the `String` will have a length of zero, it does not
-    /// touch its capacity.
-    ///
-    /// # Examples
-    ///
-    /// Basic usage:
-    ///
-    /// ```
-    /// use heapless::String;
-    ///
-    /// let mut s: String<8> = String::from("foo");
-    ///
-    /// s.clear();
-    ///
-    /// assert!(s.is_empty());
-    /// assert_eq!(0, s.len());
-    /// assert_eq!(8, s.capacity());
-    /// ```
-    #[inline]
-    pub fn clear(&mut self) {
-        self.vec.clear()
-    }
-}
-
-impl<const N: usize> Default for String<N> {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-impl<'a, const N: usize> From<&'a str> for String<N> {
-    fn from(s: &'a str) -> Self {
-        let mut new = String::new();
-        new.push_str(s).unwrap();
-        new
-    }
-}
-
-impl<const N: usize> str::FromStr for String<N> {
-    type Err = ();
-
-    fn from_str(s: &str) -> Result<Self, Self::Err> {
-        let mut new = String::new();
-        new.push_str(s)?;
-        Ok(new)
-    }
-}
-
-impl<const N: usize> iter::FromIterator<char> for String<N> {
-    fn from_iter<T: IntoIterator<Item = char>>(iter: T) -> Self {
-        let mut new = String::new();
-        for c in iter {
-            new.push(c).unwrap();
-        }
-        new
-    }
-}
-
-impl<'a, const N: usize> iter::FromIterator<&'a char> for String<N> {
-    fn from_iter<T: IntoIterator<Item = &'a char>>(iter: T) -> Self {
-        let mut new = String::new();
-        for c in iter {
-            new.push(*c).unwrap();
-        }
-        new
-    }
-}
-
-impl<'a, const N: usize> iter::FromIterator<&'a str> for String<N> {
-    fn from_iter<T: IntoIterator<Item = &'a str>>(iter: T) -> Self {
-        let mut new = String::new();
-        for c in iter {
-            new.push_str(c).unwrap();
-        }
-        new
-    }
-}
-
-impl<const N: usize> Clone for String<N> {
-    fn clone(&self) -> Self {
-        Self {
-            vec: self.vec.clone(),
-        }
-    }
-}
-
-impl<const N: usize> fmt::Debug for String<N> {
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        <str as fmt::Debug>::fmt(self, f)
-    }
-}
-
-impl<const N: usize> fmt::Display for String<N> {
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        <str as fmt::Display>::fmt(self, f)
-    }
-}
-
-impl<const N: usize> hash::Hash for String<N> {
-    #[inline]
-    fn hash<H: hash::Hasher>(&self, hasher: &mut H) {
-        <str as hash::Hash>::hash(self, hasher)
-    }
-}
-
-impl<const N: usize> hash32::Hash for String<N> {
-    #[inline]
-    fn hash<H: hash32::Hasher>(&self, hasher: &mut H) {
-        <str as hash32::Hash>::hash(self, hasher)
-    }
-}
-
-impl<const N: usize> fmt::Write for String<N> {
-    fn write_str(&mut self, s: &str) -> Result<(), fmt::Error> {
-        self.push_str(s).map_err(|_| fmt::Error)
-    }
-
-    fn write_char(&mut self, c: char) -> Result<(), fmt::Error> {
-        self.push(c).map_err(|_| fmt::Error)
-    }
-}
-
-impl<const N: usize> ops::Deref for String<N> {
-    type Target = str;
-
-    fn deref(&self) -> &str {
-        self.as_str()
-    }
-}
-
-impl<const N: usize> ops::DerefMut for String<N> {
-    fn deref_mut(&mut self) -> &mut str {
-        self.as_mut_str()
-    }
-}
-
-impl<const N: usize> AsRef<str> for String<N> {
-    #[inline]
-    fn as_ref(&self) -> &str {
-        self
-    }
-}
-
-impl<const N: usize> AsRef<[u8]> for String<N> {
-    #[inline]
-    fn as_ref(&self) -> &[u8] {
-        self.as_bytes()
-    }
-}
-
-impl<const N1: usize, const N2: usize> PartialEq<String<N2>> for String<N1> {
-    fn eq(&self, rhs: &String<N2>) -> bool {
-        str::eq(&**self, &**rhs)
-    }
-
-    fn ne(&self, rhs: &String<N2>) -> bool {
-        str::ne(&**self, &**rhs)
-    }
-}
-
-// String<N> == str
-impl<const N: usize> PartialEq<str> for String<N> {
-    #[inline]
-    fn eq(&self, other: &str) -> bool {
-        str::eq(&self[..], &other[..])
-    }
-    #[inline]
-    fn ne(&self, other: &str) -> bool {
-        str::ne(&self[..], &other[..])
-    }
-}
-
-// String<N> == &'str
-impl<const N: usize> PartialEq<&str> for String<N> {
-    #[inline]
-    fn eq(&self, other: &&str) -> bool {
-        str::eq(&self[..], &other[..])
-    }
-    #[inline]
-    fn ne(&self, other: &&str) -> bool {
-        str::ne(&self[..], &other[..])
-    }
-}
-
-// str == String<N>
-impl<const N: usize> PartialEq<String<N>> for str {
-    #[inline]
-    fn eq(&self, other: &String<N>) -> bool {
-        str::eq(&self[..], &other[..])
-    }
-    #[inline]
-    fn ne(&self, other: &String<N>) -> bool {
-        str::ne(&self[..], &other[..])
-    }
-}
-
-// &'str == String<N>
-impl<const N: usize> PartialEq<String<N>> for &str {
-    #[inline]
-    fn eq(&self, other: &String<N>) -> bool {
-        str::eq(&self[..], &other[..])
-    }
-    #[inline]
-    fn ne(&self, other: &String<N>) -> bool {
-        str::ne(&self[..], &other[..])
-    }
-}
-
-impl<const N: usize> Eq for String<N> {}
-
-impl<const N1: usize, const N2: usize> PartialOrd<String<N2>> for String<N1> {
-    #[inline]
-    fn partial_cmp(&self, other: &String<N2>) -> Option<Ordering> {
-        PartialOrd::partial_cmp(&**self, &**other)
-    }
-}
-
-impl<const N: usize> Ord for String<N> {
-    #[inline]
-    fn cmp(&self, other: &Self) -> Ordering {
-        Ord::cmp(&**self, &**other)
-    }
-}
-
-macro_rules! impl_from_num {
-    ($num:ty, $size:expr) => {
-        impl<const N: usize> From<$num> for String<N> {
-            fn from(s: $num) -> Self {
-                let mut new = String::new();
-                write!(&mut new, "{}", s).unwrap();
-                new
-            }
-        }
-    };
-}
-
-impl_from_num!(i8, 4);
-impl_from_num!(i16, 6);
-impl_from_num!(i32, 11);
-impl_from_num!(i64, 20);
-
-impl_from_num!(u8, 3);
-impl_from_num!(u16, 5);
-impl_from_num!(u32, 10);
-impl_from_num!(u64, 20);
-
-#[cfg(test)]
-mod tests {
-    use crate::{String, Vec};
-
-    #[test]
-    fn static_new() {
-        static mut _S: String<8> = String::new();
-    }
-
-    #[test]
-    fn clone() {
-        let s1: String<20> = String::from("abcd");
-        let mut s2 = s1.clone();
-        s2.push_str(" efgh").unwrap();
-
-        assert_eq!(s1, "abcd");
-        assert_eq!(s2, "abcd efgh");
-    }
-
-    #[test]
-    fn cmp() {
-        let s1: String<4> = String::from("abcd");
-        let s2: String<4> = String::from("zzzz");
-
-        assert!(s1 < s2);
-    }
-
-    #[test]
-    fn cmp_heterogenous_size() {
-        let s1: String<4> = String::from("abcd");
-        let s2: String<8> = String::from("zzzz");
-
-        assert!(s1 < s2);
-    }
-
-    #[test]
-    fn debug() {
-        use core::fmt::Write;
-
-        let s: String<8> = String::from("abcd");
-        let mut std_s = std::string::String::new();
-        write!(std_s, "{:?}", s).unwrap();
-        assert_eq!("\"abcd\"", std_s);
-    }
-
-    #[test]
-    fn display() {
-        use core::fmt::Write;
-
-        let s: String<8> = String::from("abcd");
-        let mut std_s = std::string::String::new();
-        write!(std_s, "{}", s).unwrap();
-        assert_eq!("abcd", std_s);
-    }
-
-    #[test]
-    fn empty() {
-        let s: String<4> = String::new();
-        assert!(s.capacity() == 4);
-        assert_eq!(s, "");
-        assert_eq!(s.len(), 0);
-        assert_ne!(s.len(), 4);
-    }
-
-    #[test]
-    fn from() {
-        let s: String<4> = String::from("123");
-        assert!(s.len() == 3);
-        assert_eq!(s, "123");
-    }
-
-    #[test]
-    fn from_str() {
-        use core::str::FromStr;
-
-        let s: String<4> = String::<4>::from_str("123").unwrap();
-        assert!(s.len() == 3);
-        assert_eq!(s, "123");
-
-        let e: () = String::<2>::from_str("123").unwrap_err();
-        assert_eq!(e, ());
-    }
-
-    #[test]
-    fn from_iter() {
-        let mut v: Vec<char, 5> = Vec::new();
-        v.push('h').unwrap();
-        v.push('e').unwrap();
-        v.push('l').unwrap();
-        v.push('l').unwrap();
-        v.push('o').unwrap();
-        let string1: String<5> = v.iter().collect(); //&char
-        let string2: String<5> = "hello".chars().collect(); //char
-        assert_eq!(string1, "hello");
-        assert_eq!(string2, "hello");
-    }
-
-    #[test]
-    #[should_panic]
-    fn from_panic() {
-        let _: String<4> = String::from("12345");
-    }
-
-    #[test]
-    fn from_num() {
-        let v: String<20> = String::from(18446744073709551615 as u64);
-        assert_eq!(v, "18446744073709551615");
-    }
-
-    #[test]
-    fn into_bytes() {
-        let s: String<4> = String::from("ab");
-        let b: Vec<u8, 4> = s.into_bytes();
-        assert_eq!(b.len(), 2);
-        assert_eq!(&['a' as u8, 'b' as u8], &b[..]);
-    }
-
-    #[test]
-    fn as_str() {
-        let s: String<4> = String::from("ab");
-
-        assert_eq!(s.as_str(), "ab");
-        // should be moved to fail test
-        //    let _s = s.as_str();
-        // s.push('c'); // <- cannot borrow `s` as mutable because it is also borrowed as immutable
-    }
-
-    #[test]
-    fn as_mut_str() {
-        let mut s: String<4> = String::from("ab");
-        let s = s.as_mut_str();
-        s.make_ascii_uppercase();
-        assert_eq!(s, "AB");
-    }
-
-    #[test]
-    fn push_str() {
-        let mut s: String<8> = String::from("foo");
-        assert!(s.push_str("bar").is_ok());
-        assert_eq!("foobar", s);
-        assert_eq!(s, "foobar");
-        assert!(s.push_str("tender").is_err());
-        assert_eq!("foobar", s);
-        assert_eq!(s, "foobar");
-    }
-
-    #[test]
-    fn push() {
-        let mut s: String<6> = String::from("abc");
-        assert!(s.push('1').is_ok());
-        assert!(s.push('2').is_ok());
-        assert!(s.push('3').is_ok());
-        assert!(s.push('4').is_err());
-        assert!("abc123" == s.as_str());
-    }
-
-    #[test]
-    fn as_bytes() {
-        let s: String<8> = String::from("hello");
-        assert_eq!(&[104, 101, 108, 108, 111], s.as_bytes());
-    }
-
-    #[test]
-    fn truncate() {
-        let mut s: String<8> = String::from("hello");
-        s.truncate(6);
-        assert_eq!(s.len(), 5);
-        s.truncate(2);
-        assert_eq!(s.len(), 2);
-        assert_eq!("he", s);
-        assert_eq!(s, "he");
-    }
-
-    #[test]
-    fn pop() {
-        let mut s: String<8> = String::from("foo");
-        assert_eq!(s.pop(), Some('o'));
-        assert_eq!(s.pop(), Some('o'));
-        assert_eq!(s.pop(), Some('f'));
-        assert_eq!(s.pop(), None);
-    }
-
-    #[test]
-    fn pop_uenc() {
-        let mut s: String<8> = String::from("é");
-        assert_eq!(s.len(), 3);
-        match s.pop() {
-            Some(c) => {
-                assert_eq!(s.len(), 1);
-                assert_eq!(c, '\u{0301}'); // accute accent of e
-                ()
-            }
-            None => assert!(false),
-        };
-    }
-
-    #[test]
-    fn is_empty() {
-        let mut v: String<8> = String::new();
-        assert!(v.is_empty());
-        let _ = v.push('a');
-        assert!(!v.is_empty());
-    }
-
-    #[test]
-    fn clear() {
-        let mut s: String<8> = String::from("foo");
-        s.clear();
-        assert!(s.is_empty());
-        assert_eq!(0, s.len());
-        assert_eq!(8, s.capacity());
-    }
-}
-
\ No newline at end of file diff --git a/docs/doc/src/heapless/vec.rs.html b/docs/doc/src/heapless/vec.rs.html deleted file mode 100644 index f737e40..0000000 --- a/docs/doc/src/heapless/vec.rs.html +++ /dev/null @@ -1,3201 +0,0 @@ -vec.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-270
-271
-272
-273
-274
-275
-276
-277
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-302
-303
-304
-305
-306
-307
-308
-309
-310
-311
-312
-313
-314
-315
-316
-317
-318
-319
-320
-321
-322
-323
-324
-325
-326
-327
-328
-329
-330
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-342
-343
-344
-345
-346
-347
-348
-349
-350
-351
-352
-353
-354
-355
-356
-357
-358
-359
-360
-361
-362
-363
-364
-365
-366
-367
-368
-369
-370
-371
-372
-373
-374
-375
-376
-377
-378
-379
-380
-381
-382
-383
-384
-385
-386
-387
-388
-389
-390
-391
-392
-393
-394
-395
-396
-397
-398
-399
-400
-401
-402
-403
-404
-405
-406
-407
-408
-409
-410
-411
-412
-413
-414
-415
-416
-417
-418
-419
-420
-421
-422
-423
-424
-425
-426
-427
-428
-429
-430
-431
-432
-433
-434
-435
-436
-437
-438
-439
-440
-441
-442
-443
-444
-445
-446
-447
-448
-449
-450
-451
-452
-453
-454
-455
-456
-457
-458
-459
-460
-461
-462
-463
-464
-465
-466
-467
-468
-469
-470
-471
-472
-473
-474
-475
-476
-477
-478
-479
-480
-481
-482
-483
-484
-485
-486
-487
-488
-489
-490
-491
-492
-493
-494
-495
-496
-497
-498
-499
-500
-501
-502
-503
-504
-505
-506
-507
-508
-509
-510
-511
-512
-513
-514
-515
-516
-517
-518
-519
-520
-521
-522
-523
-524
-525
-526
-527
-528
-529
-530
-531
-532
-533
-534
-535
-536
-537
-538
-539
-540
-541
-542
-543
-544
-545
-546
-547
-548
-549
-550
-551
-552
-553
-554
-555
-556
-557
-558
-559
-560
-561
-562
-563
-564
-565
-566
-567
-568
-569
-570
-571
-572
-573
-574
-575
-576
-577
-578
-579
-580
-581
-582
-583
-584
-585
-586
-587
-588
-589
-590
-591
-592
-593
-594
-595
-596
-597
-598
-599
-600
-601
-602
-603
-604
-605
-606
-607
-608
-609
-610
-611
-612
-613
-614
-615
-616
-617
-618
-619
-620
-621
-622
-623
-624
-625
-626
-627
-628
-629
-630
-631
-632
-633
-634
-635
-636
-637
-638
-639
-640
-641
-642
-643
-644
-645
-646
-647
-648
-649
-650
-651
-652
-653
-654
-655
-656
-657
-658
-659
-660
-661
-662
-663
-664
-665
-666
-667
-668
-669
-670
-671
-672
-673
-674
-675
-676
-677
-678
-679
-680
-681
-682
-683
-684
-685
-686
-687
-688
-689
-690
-691
-692
-693
-694
-695
-696
-697
-698
-699
-700
-701
-702
-703
-704
-705
-706
-707
-708
-709
-710
-711
-712
-713
-714
-715
-716
-717
-718
-719
-720
-721
-722
-723
-724
-725
-726
-727
-728
-729
-730
-731
-732
-733
-734
-735
-736
-737
-738
-739
-740
-741
-742
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
-759
-760
-761
-762
-763
-764
-765
-766
-767
-768
-769
-770
-771
-772
-773
-774
-775
-776
-777
-778
-779
-780
-781
-782
-783
-784
-785
-786
-787
-788
-789
-790
-791
-792
-793
-794
-795
-796
-797
-798
-799
-800
-801
-802
-803
-804
-805
-806
-807
-808
-809
-810
-811
-812
-813
-814
-815
-816
-817
-818
-819
-820
-821
-822
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836
-837
-838
-839
-840
-841
-842
-843
-844
-845
-846
-847
-848
-849
-850
-851
-852
-853
-854
-855
-856
-857
-858
-859
-860
-861
-862
-863
-864
-865
-866
-867
-868
-869
-870
-871
-872
-873
-874
-875
-876
-877
-878
-879
-880
-881
-882
-883
-884
-885
-886
-887
-888
-889
-890
-891
-892
-893
-894
-895
-896
-897
-898
-899
-900
-901
-902
-903
-904
-905
-906
-907
-908
-909
-910
-911
-912
-913
-914
-915
-916
-917
-918
-919
-920
-921
-922
-923
-924
-925
-926
-927
-928
-929
-930
-931
-932
-933
-934
-935
-936
-937
-938
-939
-940
-941
-942
-943
-944
-945
-946
-947
-948
-949
-950
-951
-952
-953
-954
-955
-956
-957
-958
-959
-960
-961
-962
-963
-964
-965
-966
-967
-968
-969
-970
-971
-972
-973
-974
-975
-976
-977
-978
-979
-980
-981
-982
-983
-984
-985
-986
-987
-988
-989
-990
-991
-992
-993
-994
-995
-996
-997
-998
-999
-1000
-1001
-1002
-1003
-1004
-1005
-1006
-1007
-1008
-1009
-1010
-1011
-1012
-1013
-1014
-1015
-1016
-1017
-1018
-1019
-1020
-1021
-1022
-1023
-1024
-1025
-1026
-1027
-1028
-1029
-1030
-1031
-1032
-1033
-1034
-1035
-1036
-1037
-1038
-1039
-1040
-1041
-1042
-1043
-1044
-1045
-1046
-1047
-1048
-1049
-1050
-1051
-1052
-1053
-1054
-1055
-1056
-1057
-1058
-1059
-1060
-1061
-1062
-1063
-1064
-1065
-1066
-1067
-1068
-1069
-1070
-1071
-1072
-1073
-1074
-1075
-1076
-1077
-1078
-1079
-1080
-1081
-1082
-1083
-1084
-1085
-1086
-1087
-1088
-1089
-1090
-1091
-1092
-1093
-1094
-1095
-1096
-1097
-1098
-1099
-1100
-1101
-1102
-1103
-1104
-1105
-1106
-1107
-1108
-1109
-1110
-1111
-1112
-1113
-1114
-1115
-1116
-1117
-1118
-1119
-1120
-1121
-1122
-1123
-1124
-1125
-1126
-1127
-1128
-1129
-1130
-1131
-1132
-1133
-1134
-1135
-1136
-1137
-1138
-1139
-1140
-1141
-1142
-1143
-1144
-1145
-1146
-1147
-1148
-1149
-1150
-1151
-1152
-1153
-1154
-1155
-1156
-1157
-1158
-1159
-1160
-1161
-1162
-1163
-1164
-1165
-1166
-1167
-1168
-1169
-1170
-1171
-1172
-1173
-1174
-1175
-1176
-1177
-1178
-1179
-1180
-1181
-1182
-1183
-1184
-1185
-1186
-1187
-1188
-1189
-1190
-1191
-1192
-1193
-1194
-1195
-1196
-1197
-1198
-1199
-1200
-1201
-1202
-1203
-1204
-1205
-1206
-1207
-1208
-1209
-1210
-1211
-1212
-1213
-1214
-1215
-1216
-1217
-1218
-1219
-1220
-1221
-1222
-1223
-1224
-1225
-1226
-1227
-1228
-1229
-1230
-1231
-1232
-1233
-1234
-1235
-1236
-1237
-1238
-1239
-1240
-1241
-1242
-1243
-1244
-1245
-1246
-1247
-1248
-1249
-1250
-1251
-1252
-1253
-1254
-1255
-1256
-1257
-1258
-1259
-1260
-1261
-1262
-1263
-1264
-1265
-1266
-1267
-1268
-1269
-1270
-1271
-1272
-1273
-1274
-1275
-1276
-1277
-1278
-1279
-1280
-1281
-1282
-1283
-1284
-1285
-1286
-1287
-1288
-1289
-1290
-1291
-1292
-1293
-1294
-1295
-1296
-1297
-1298
-1299
-1300
-1301
-1302
-1303
-1304
-1305
-1306
-1307
-1308
-1309
-1310
-1311
-1312
-1313
-1314
-1315
-1316
-1317
-1318
-1319
-1320
-1321
-1322
-1323
-1324
-1325
-1326
-1327
-1328
-1329
-1330
-1331
-1332
-1333
-1334
-1335
-1336
-1337
-1338
-1339
-1340
-1341
-1342
-1343
-1344
-1345
-1346
-1347
-1348
-1349
-1350
-1351
-1352
-1353
-1354
-1355
-1356
-1357
-1358
-1359
-1360
-1361
-1362
-1363
-1364
-1365
-1366
-1367
-1368
-1369
-1370
-1371
-1372
-1373
-1374
-1375
-1376
-1377
-1378
-1379
-1380
-1381
-1382
-1383
-1384
-1385
-1386
-1387
-1388
-1389
-1390
-1391
-1392
-1393
-1394
-1395
-1396
-1397
-1398
-1399
-1400
-1401
-1402
-1403
-1404
-1405
-1406
-1407
-1408
-1409
-1410
-1411
-1412
-1413
-1414
-1415
-1416
-1417
-1418
-1419
-1420
-1421
-1422
-1423
-1424
-1425
-1426
-1427
-1428
-1429
-1430
-1431
-1432
-1433
-1434
-1435
-1436
-1437
-1438
-1439
-1440
-1441
-1442
-1443
-1444
-1445
-1446
-1447
-1448
-1449
-1450
-1451
-1452
-1453
-1454
-1455
-1456
-1457
-1458
-1459
-1460
-1461
-1462
-1463
-1464
-1465
-1466
-1467
-1468
-1469
-1470
-1471
-1472
-1473
-1474
-1475
-1476
-1477
-1478
-1479
-1480
-1481
-1482
-1483
-1484
-1485
-1486
-1487
-1488
-1489
-1490
-1491
-1492
-1493
-1494
-1495
-1496
-1497
-1498
-1499
-1500
-1501
-1502
-1503
-1504
-1505
-1506
-1507
-1508
-1509
-1510
-1511
-1512
-1513
-1514
-1515
-1516
-1517
-1518
-1519
-1520
-1521
-1522
-1523
-1524
-1525
-1526
-1527
-1528
-1529
-1530
-1531
-1532
-1533
-1534
-1535
-1536
-1537
-1538
-1539
-1540
-1541
-1542
-1543
-1544
-1545
-1546
-1547
-1548
-1549
-1550
-1551
-1552
-1553
-1554
-1555
-1556
-1557
-1558
-1559
-1560
-1561
-1562
-1563
-1564
-1565
-1566
-1567
-1568
-1569
-1570
-1571
-1572
-1573
-1574
-1575
-1576
-1577
-1578
-1579
-1580
-1581
-1582
-1583
-1584
-1585
-1586
-1587
-1588
-1589
-1590
-1591
-1592
-1593
-1594
-1595
-1596
-1597
-1598
-1599
-1600
-
use core::{
-    cmp::Ordering, convert::TryFrom, fmt, hash, iter::FromIterator, mem::MaybeUninit, ops, ptr,
-    slice,
-};
-use hash32;
-
-/// A fixed capacity [`Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html)
-///
-/// # Examples
-///
-/// ```
-/// use heapless::Vec;
-///
-///
-/// // A vector with a fixed capacity of 8 elements allocated on the stack
-/// let mut vec = Vec::<_, 8>::new();
-/// vec.push(1);
-/// vec.push(2);
-///
-/// assert_eq!(vec.len(), 2);
-/// assert_eq!(vec[0], 1);
-///
-/// assert_eq!(vec.pop(), Some(2));
-/// assert_eq!(vec.len(), 1);
-///
-/// vec[0] = 7;
-/// assert_eq!(vec[0], 7);
-///
-/// vec.extend([1, 2, 3].iter().cloned());
-///
-/// for x in &vec {
-///     println!("{}", x);
-/// }
-/// assert_eq!(*vec, [7, 1, 2, 3]);
-/// ```
-pub struct Vec<T, const N: usize> {
-    // NOTE order is important for optimizations. the `len` first layout lets the compiler optimize
-    // `new` to: reserve stack space and zero the first word. With the fields in the reverse order
-    // the compiler optimizes `new` to `memclr`-ing the *entire* stack space, including the `buffer`
-    // field which should be left uninitialized. Optimizations were last checked with Rust 1.60
-    len: usize,
-
-    buffer: [MaybeUninit<T>; N],
-}
-
-impl<T, const N: usize> Vec<T, N> {
-    const ELEM: MaybeUninit<T> = MaybeUninit::uninit();
-    const INIT: [MaybeUninit<T>; N] = [Self::ELEM; N]; // important for optimization of `new`
-
-    /// Constructs a new, empty vector with a fixed capacity of `N`
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::Vec;
-    ///
-    /// // allocate the vector on the stack
-    /// let mut x: Vec<u8, 16> = Vec::new();
-    ///
-    /// // allocate the vector in a static variable
-    /// static mut X: Vec<u8, 16> = Vec::new();
-    /// ```
-    /// `Vec` `const` constructor; wrap the returned value in [`Vec`](../struct.Vec.html)
-    pub const fn new() -> Self {
-        // Const assert N >= 0
-        crate::sealed::greater_than_eq_0::<N>();
-
-        Self {
-            len: 0,
-            buffer: Self::INIT,
-        }
-    }
-
-    /// Constructs a new vector with a fixed capacity of `N` and fills it
-    /// with the provided slice.
-    ///
-    /// This is equivalent to the following code:
-    ///
-    /// ```
-    /// use heapless::Vec;
-    ///
-    /// let mut v: Vec<u8, 16> = Vec::new();
-    /// v.extend_from_slice(&[1, 2, 3]).unwrap();
-    /// ```
-    #[inline]
-    pub fn from_slice(other: &[T]) -> Result<Self, ()>
-    where
-        T: Clone,
-    {
-        let mut v = Vec::new();
-        v.extend_from_slice(other)?;
-        Ok(v)
-    }
-
-    /// Clones a vec into a new vec
-    pub(crate) fn clone(&self) -> Self
-    where
-        T: Clone,
-    {
-        let mut new = Self::new();
-        // avoid `extend_from_slice` as that introduces a runtime check / panicking branch
-        for elem in self {
-            unsafe {
-                new.push_unchecked(elem.clone());
-            }
-        }
-        new
-    }
-
-    /// Returns a raw pointer to the vector’s buffer.
-    pub fn as_ptr(&self) -> *const T {
-        self.buffer.as_ptr() as *const T
-    }
-
-    /// Returns a raw pointer to the vector’s buffer, which may be mutated through.
-    pub fn as_mut_ptr(&mut self) -> *mut T {
-        self.buffer.as_mut_ptr() as *mut T
-    }
-
-    /// Extracts a slice containing the entire vector.
-    ///
-    /// Equivalent to `&s[..]`.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::Vec;
-    /// let buffer: Vec<u8, 5> = Vec::from_slice(&[1, 2, 3, 5, 8]).unwrap();
-    /// assert_eq!(buffer.as_slice(), &[1, 2, 3, 5, 8]);
-    /// ```
-    pub fn as_slice(&self) -> &[T] {
-        // NOTE(unsafe) avoid bound checks in the slicing operation
-        // &buffer[..self.len]
-        unsafe { slice::from_raw_parts(self.buffer.as_ptr() as *const T, self.len) }
-    }
-
-    /// Returns the contents of the vector as an array of length `M` if the length
-    /// of the vector is exactly `M`, otherwise returns `Err(self)`.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::Vec;
-    /// let buffer: Vec<u8, 42> = Vec::from_slice(&[1, 2, 3, 5, 8]).unwrap();
-    /// let array: [u8; 5] = buffer.into_array().unwrap();
-    /// assert_eq!(array, [1, 2, 3, 5, 8]);
-    /// ```
-    pub fn into_array<const M: usize>(self) -> Result<[T; M], Self> {
-        if self.len() == M {
-            // This is how the unstable `MaybeUninit::array_assume_init` method does it
-            let array = unsafe { (&self.buffer as *const _ as *const [T; M]).read() };
-
-            // We don't want `self`'s destructor to be called because that would drop all the
-            // items in the array
-            core::mem::forget(self);
-
-            Ok(array)
-        } else {
-            Err(self)
-        }
-    }
-
-    /// Extracts a mutable slice containing the entire vector.
-    ///
-    /// Equivalent to `&s[..]`.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::Vec;
-    /// let mut buffer: Vec<u8, 5> = Vec::from_slice(&[1, 2, 3, 5, 8]).unwrap();
-    /// buffer[0] = 9;
-    /// assert_eq!(buffer.as_slice(), &[9, 2, 3, 5, 8]);
-    /// ```
-    pub(crate) fn as_mut_slice(&mut self) -> &mut [T] {
-        // NOTE(unsafe) avoid bound checks in the slicing operation
-        // &mut buffer[..self.len]
-        unsafe { slice::from_raw_parts_mut(self.buffer.as_mut_ptr() as *mut T, self.len) }
-    }
-
-    /// Returns the maximum number of elements the vector can hold.
-    pub const fn capacity(&self) -> usize {
-        N
-    }
-
-    /// Clears the vector, removing all values.
-    pub fn clear(&mut self) {
-        self.truncate(0);
-    }
-
-    /// Extends the vec from an iterator.
-    ///
-    /// # Panic
-    ///
-    /// Panics if the vec cannot hold all elements of the iterator.
-    pub fn extend<I>(&mut self, iter: I)
-    where
-        I: IntoIterator<Item = T>,
-    {
-        for elem in iter {
-            self.push(elem).ok().unwrap()
-        }
-    }
-
-    /// Clones and appends all elements in a slice to the `Vec`.
-    ///
-    /// Iterates over the slice `other`, clones each element, and then appends
-    /// it to this `Vec`. The `other` vector is traversed in-order.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::Vec;
-    ///
-    /// let mut vec = Vec::<u8, 8>::new();
-    /// vec.push(1).unwrap();
-    /// vec.extend_from_slice(&[2, 3, 4]).unwrap();
-    /// assert_eq!(*vec, [1, 2, 3, 4]);
-    /// ```
-    pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), ()>
-    where
-        T: Clone,
-    {
-        if self.len + other.len() > self.capacity() {
-            // won't fit in the `Vec`; don't modify anything and return an error
-            Err(())
-        } else {
-            for elem in other {
-                unsafe {
-                    self.push_unchecked(elem.clone());
-                }
-            }
-            Ok(())
-        }
-    }
-
-    /// Removes the last element from a vector and returns it, or `None` if it's empty
-    pub fn pop(&mut self) -> Option<T> {
-        if self.len != 0 {
-            Some(unsafe { self.pop_unchecked() })
-        } else {
-            None
-        }
-    }
-
-    /// Appends an `item` to the back of the collection
-    ///
-    /// Returns back the `item` if the vector is full
-    pub fn push(&mut self, item: T) -> Result<(), T> {
-        if self.len < self.capacity() {
-            unsafe { self.push_unchecked(item) }
-            Ok(())
-        } else {
-            Err(item)
-        }
-    }
-
-    /// Removes the last element from a vector and returns it
-    ///
-    /// # Safety
-    ///
-    /// This assumes the vec to have at least one element.
-    pub unsafe fn pop_unchecked(&mut self) -> T {
-        debug_assert!(!self.is_empty());
-
-        self.len -= 1;
-        (self.buffer.get_unchecked_mut(self.len).as_ptr() as *const T).read()
-    }
-
-    /// Appends an `item` to the back of the collection
-    ///
-    /// # Safety
-    ///
-    /// This assumes the vec is not full.
-    pub unsafe fn push_unchecked(&mut self, item: T) {
-        // NOTE(ptr::write) the memory slot that we are about to write to is uninitialized. We
-        // use `ptr::write` to avoid running `T`'s destructor on the uninitialized memory
-        debug_assert!(!self.is_full());
-
-        *self.buffer.get_unchecked_mut(self.len) = MaybeUninit::new(item);
-
-        self.len += 1;
-    }
-
-    /// Shortens the vector, keeping the first `len` elements and dropping the rest.
-    pub fn truncate(&mut self, len: usize) {
-        // This is safe because:
-        //
-        // * the slice passed to `drop_in_place` is valid; the `len > self.len`
-        //   case avoids creating an invalid slice, and
-        // * the `len` of the vector is shrunk before calling `drop_in_place`,
-        //   such that no value will be dropped twice in case `drop_in_place`
-        //   were to panic once (if it panics twice, the program aborts).
-        unsafe {
-            // Note: It's intentional that this is `>` and not `>=`.
-            //       Changing it to `>=` has negative performance
-            //       implications in some cases. See rust-lang/rust#78884 for more.
-            if len > self.len {
-                return;
-            }
-            let remaining_len = self.len - len;
-            let s = ptr::slice_from_raw_parts_mut(self.as_mut_ptr().add(len), remaining_len);
-            self.len = len;
-            ptr::drop_in_place(s);
-        }
-    }
-
-    /// Resizes the Vec in-place so that len is equal to new_len.
-    ///
-    /// If new_len is greater than len, the Vec is extended by the
-    /// difference, with each additional slot filled with value. If
-    /// new_len is less than len, the Vec is simply truncated.
-    ///
-    /// See also [`resize_default`](struct.Vec.html#method.resize_default).
-    pub fn resize(&mut self, new_len: usize, value: T) -> Result<(), ()>
-    where
-        T: Clone,
-    {
-        if new_len > self.capacity() {
-            return Err(());
-        }
-
-        if new_len > self.len {
-            while self.len < new_len {
-                self.push(value.clone()).ok();
-            }
-        } else {
-            self.truncate(new_len);
-        }
-
-        Ok(())
-    }
-
-    /// Resizes the `Vec` in-place so that `len` is equal to `new_len`.
-    ///
-    /// If `new_len` is greater than `len`, the `Vec` is extended by the
-    /// difference, with each additional slot filled with `Default::default()`.
-    /// If `new_len` is less than `len`, the `Vec` is simply truncated.
-    ///
-    /// See also [`resize`](struct.Vec.html#method.resize).
-    pub fn resize_default(&mut self, new_len: usize) -> Result<(), ()>
-    where
-        T: Clone + Default,
-    {
-        self.resize(new_len, T::default())
-    }
-
-    /// Forces the length of the vector to `new_len`.
-    ///
-    /// This is a low-level operation that maintains none of the normal
-    /// invariants of the type. Normally changing the length of a vector
-    /// is done using one of the safe operations instead, such as
-    /// [`truncate`], [`resize`], [`extend`], or [`clear`].
-    ///
-    /// [`truncate`]: #method.truncate
-    /// [`resize`]: #method.resize
-    /// [`extend`]: https://doc.rust-lang.org/stable/core/iter/trait.Extend.html#tymethod.extend
-    /// [`clear`]: #method.clear
-    ///
-    /// # Safety
-    ///
-    /// - `new_len` must be less than or equal to [`capacity()`].
-    /// - The elements at `old_len..new_len` must be initialized.
-    ///
-    /// [`capacity()`]: #method.capacity
-    ///
-    /// # Examples
-    ///
-    /// This method can be useful for situations in which the vector
-    /// is serving as a buffer for other code, particularly over FFI:
-    ///
-    /// ```no_run
-    /// # #![allow(dead_code)]
-    /// use heapless::Vec;
-    ///
-    /// # // This is just a minimal skeleton for the doc example;
-    /// # // don't use this as a starting point for a real library.
-    /// # pub struct StreamWrapper { strm: *mut core::ffi::c_void }
-    /// # const Z_OK: i32 = 0;
-    /// # extern "C" {
-    /// #     fn deflateGetDictionary(
-    /// #         strm: *mut core::ffi::c_void,
-    /// #         dictionary: *mut u8,
-    /// #         dictLength: *mut usize,
-    /// #     ) -> i32;
-    /// # }
-    /// # impl StreamWrapper {
-    /// pub fn get_dictionary(&self) -> Option<Vec<u8, 32768>> {
-    ///     // Per the FFI method's docs, "32768 bytes is always enough".
-    ///     let mut dict = Vec::new();
-    ///     let mut dict_length = 0;
-    ///     // SAFETY: When `deflateGetDictionary` returns `Z_OK`, it holds that:
-    ///     // 1. `dict_length` elements were initialized.
-    ///     // 2. `dict_length` <= the capacity (32_768)
-    ///     // which makes `set_len` safe to call.
-    ///     unsafe {
-    ///         // Make the FFI call...
-    ///         let r = deflateGetDictionary(self.strm, dict.as_mut_ptr(), &mut dict_length);
-    ///         if r == Z_OK {
-    ///             // ...and update the length to what was initialized.
-    ///             dict.set_len(dict_length);
-    ///             Some(dict)
-    ///         } else {
-    ///             None
-    ///         }
-    ///     }
-    /// }
-    /// # }
-    /// ```
-    ///
-    /// While the following example is sound, there is a memory leak since
-    /// the inner vectors were not freed prior to the `set_len` call:
-    ///
-    /// ```
-    /// use core::iter::FromIterator;
-    /// use heapless::Vec;
-    ///
-    /// let mut vec = Vec::<Vec<u8, 3>, 3>::from_iter(
-    ///     [
-    ///         Vec::from_iter([1, 0, 0].iter().cloned()),
-    ///         Vec::from_iter([0, 1, 0].iter().cloned()),
-    ///         Vec::from_iter([0, 0, 1].iter().cloned()),
-    ///     ]
-    ///     .iter()
-    ///     .cloned()
-    /// );
-    /// // SAFETY:
-    /// // 1. `old_len..0` is empty so no elements need to be initialized.
-    /// // 2. `0 <= capacity` always holds whatever `capacity` is.
-    /// unsafe {
-    ///     vec.set_len(0);
-    /// }
-    /// ```
-    ///
-    /// Normally, here, one would use [`clear`] instead to correctly drop
-    /// the contents and thus not leak memory.
-    pub unsafe fn set_len(&mut self, new_len: usize) {
-        debug_assert!(new_len <= self.capacity());
-
-        self.len = new_len
-    }
-
-    /// Removes an element from the vector and returns it.
-    ///
-    /// The removed element is replaced by the last element of the vector.
-    ///
-    /// This does not preserve ordering, but is O(1).
-    ///
-    /// # Panics
-    ///
-    /// Panics if `index` is out of bounds.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::Vec;
-    ///// use heapless::consts::*;
-    ///
-    /// let mut v: Vec<_, 8> = Vec::new();
-    /// v.push("foo").unwrap();
-    /// v.push("bar").unwrap();
-    /// v.push("baz").unwrap();
-    /// v.push("qux").unwrap();
-    ///
-    /// assert_eq!(v.swap_remove(1), "bar");
-    /// assert_eq!(&*v, ["foo", "qux", "baz"]);
-    ///
-    /// assert_eq!(v.swap_remove(0), "foo");
-    /// assert_eq!(&*v, ["baz", "qux"]);
-    /// ```
-    pub fn swap_remove(&mut self, index: usize) -> T {
-        assert!(index < self.len);
-        unsafe { self.swap_remove_unchecked(index) }
-    }
-
-    /// Removes an element from the vector and returns it.
-    ///
-    /// The removed element is replaced by the last element of the vector.
-    ///
-    /// This does not preserve ordering, but is O(1).
-    ///
-    /// # Safety
-    ///
-    ///  Assumes `index` within bounds.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::Vec;
-    ///
-    /// let mut v: Vec<_, 8> = Vec::new();
-    /// v.push("foo").unwrap();
-    /// v.push("bar").unwrap();
-    /// v.push("baz").unwrap();
-    /// v.push("qux").unwrap();
-    ///
-    /// assert_eq!(unsafe { v.swap_remove_unchecked(1) }, "bar");
-    /// assert_eq!(&*v, ["foo", "qux", "baz"]);
-    ///
-    /// assert_eq!(unsafe { v.swap_remove_unchecked(0) }, "foo");
-    /// assert_eq!(&*v, ["baz", "qux"]);
-    /// ```
-    pub unsafe fn swap_remove_unchecked(&mut self, index: usize) -> T {
-        let length = self.len();
-        debug_assert!(index < length);
-        let value = ptr::read(self.as_ptr().add(index));
-        let base_ptr = self.as_mut_ptr();
-        ptr::copy(base_ptr.add(length - 1), base_ptr.add(index), 1);
-        self.len -= 1;
-        value
-    }
-
-    /// Returns true if the vec is full
-    #[inline]
-    pub fn is_full(&self) -> bool {
-        self.len == self.capacity()
-    }
-
-    /// Returns true if the vec is empty
-    #[inline]
-    pub fn is_empty(&self) -> bool {
-        self.len == 0
-    }
-
-    /// Returns `true` if `needle` is a prefix of the Vec.
-    ///
-    /// Always returns `true` if `needle` is an empty slice.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::Vec;
-    ///
-    /// let v: Vec<_, 8> = Vec::from_slice(b"abc").unwrap();
-    /// assert_eq!(v.starts_with(b""), true);
-    /// assert_eq!(v.starts_with(b"ab"), true);
-    /// assert_eq!(v.starts_with(b"bc"), false);
-    /// ```
-    #[inline]
-    pub fn starts_with(&self, needle: &[T]) -> bool
-    where
-        T: PartialEq,
-    {
-        let n = needle.len();
-        self.len >= n && needle == &self[..n]
-    }
-
-    /// Returns `true` if `needle` is a suffix of the Vec.
-    ///
-    /// Always returns `true` if `needle` is an empty slice.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::Vec;
-    ///
-    /// let v: Vec<_, 8> = Vec::from_slice(b"abc").unwrap();
-    /// assert_eq!(v.ends_with(b""), true);
-    /// assert_eq!(v.ends_with(b"ab"), false);
-    /// assert_eq!(v.ends_with(b"bc"), true);
-    /// ```
-    #[inline]
-    pub fn ends_with(&self, needle: &[T]) -> bool
-    where
-        T: PartialEq,
-    {
-        let (v, n) = (self.len(), needle.len());
-        v >= n && needle == &self[v - n..]
-    }
-
-    /// Inserts an element at position `index` within the vector, shifting all
-    /// elements after it to the right.
-    ///
-    /// Returns back the `element` if the vector is full.
-    ///
-    /// # Panics
-    ///
-    /// Panics if `index > len`.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::Vec;
-    ///
-    /// let mut vec: Vec<_, 8> = Vec::from_slice(&[1, 2, 3]).unwrap();
-    /// vec.insert(1, 4);
-    /// assert_eq!(vec, [1, 4, 2, 3]);
-    /// vec.insert(4, 5);
-    /// assert_eq!(vec, [1, 4, 2, 3, 5]);
-    /// ```
-    pub fn insert(&mut self, index: usize, element: T) -> Result<(), T> {
-        let len = self.len();
-        if index > len {
-            panic!(
-                "insertion index (is {}) should be <= len (is {})",
-                index, len
-            );
-        }
-
-        // check there's space for the new element
-        if self.is_full() {
-            return Err(element);
-        }
-
-        unsafe {
-            // infallible
-            // The spot to put the new value
-            {
-                let p = self.as_mut_ptr().add(index);
-                // Shift everything over to make space. (Duplicating the
-                // `index`th element into two consecutive places.)
-                ptr::copy(p, p.offset(1), len - index);
-                // Write it in, overwriting the first copy of the `index`th
-                // element.
-                ptr::write(p, element);
-            }
-            self.set_len(len + 1);
-        }
-
-        Ok(())
-    }
-
-    /// Removes and returns the element at position `index` within the vector,
-    /// shifting all elements after it to the left.
-    ///
-    /// Note: Because this shifts over the remaining elements, it has a
-    /// worst-case performance of *O*(*n*). If you don't need the order of
-    /// elements to be preserved, use [`swap_remove`] instead. If you'd like to
-    /// remove elements from the beginning of the `Vec`, consider using
-    /// [`Deque::pop_front`] instead.
-    ///
-    /// [`swap_remove`]: Vec::swap_remove
-    /// [`Deque::pop_front`]: crate::Deque::pop_front
-    ///
-    /// # Panics
-    ///
-    /// Panics if `index` is out of bounds.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::Vec;
-    ///
-    /// let mut v: Vec<_, 8> = Vec::from_slice(&[1, 2, 3]).unwrap();
-    /// assert_eq!(v.remove(1), 2);
-    /// assert_eq!(v, [1, 3]);
-    /// ```
-    pub fn remove(&mut self, index: usize) -> T {
-        let len = self.len();
-        if index >= len {
-            panic!("removal index (is {}) should be < len (is {})", index, len);
-        }
-        unsafe {
-            // infallible
-            let ret;
-            {
-                // the place we are taking from.
-                let ptr = self.as_mut_ptr().add(index);
-                // copy it out, unsafely having a copy of the value on
-                // the stack and in the vector at the same time.
-                ret = ptr::read(ptr);
-
-                // Shift everything down to fill in that spot.
-                ptr::copy(ptr.offset(1), ptr, len - index - 1);
-            }
-            self.set_len(len - 1);
-            ret
-        }
-    }
-
-    /// Retains only the elements specified by the predicate.
-    ///
-    /// In other words, remove all elements `e` for which `f(&e)` returns `false`.
-    /// This method operates in place, visiting each element exactly once in the
-    /// original order, and preserves the order of the retained elements.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::Vec;
-    ///
-    /// let mut vec: Vec<_, 8> = Vec::from_slice(&[1, 2, 3, 4]).unwrap();
-    /// vec.retain(|&x| x % 2 == 0);
-    /// assert_eq!(vec, [2, 4]);
-    /// ```
-    ///
-    /// Because the elements are visited exactly once in the original order,
-    /// external state may be used to decide which elements to keep.
-    ///
-    /// ```
-    /// use heapless::Vec;
-    ///
-    /// let mut vec: Vec<_, 8> = Vec::from_slice(&[1, 2, 3, 4, 5]).unwrap();
-    /// let keep = [false, true, true, false, true];
-    /// let mut iter = keep.iter();
-    /// vec.retain(|_| *iter.next().unwrap());
-    /// assert_eq!(vec, [2, 3, 5]);
-    /// ```
-    pub fn retain<F>(&mut self, mut f: F)
-    where
-        F: FnMut(&T) -> bool,
-    {
-        self.retain_mut(|elem| f(elem));
-    }
-
-    /// Retains only the elements specified by the predicate, passing a mutable reference to it.
-    ///
-    /// In other words, remove all elements `e` such that `f(&mut e)` returns `false`.
-    /// This method operates in place, visiting each element exactly once in the
-    /// original order, and preserves the order of the retained elements.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use heapless::Vec;
-    ///
-    /// let mut vec: Vec<_, 8> = Vec::from_slice(&[1, 2, 3, 4]).unwrap();
-    /// vec.retain_mut(|x| if *x <= 3 {
-    ///     *x += 1;
-    ///     true
-    /// } else {
-    ///     false
-    /// });
-    /// assert_eq!(vec, [2, 3, 4]);
-    /// ```
-    pub fn retain_mut<F>(&mut self, mut f: F)
-    where
-        F: FnMut(&mut T) -> bool,
-    {
-        let original_len = self.len();
-        // Avoid double drop if the drop guard is not executed,
-        // since we may make some holes during the process.
-        unsafe { self.set_len(0) };
-
-        // Vec: [Kept, Kept, Hole, Hole, Hole, Hole, Unchecked, Unchecked]
-        //      |<-              processed len   ->| ^- next to check
-        //                  |<-  deleted cnt     ->|
-        //      |<-              original_len                          ->|
-        // Kept: Elements which predicate returns true on.
-        // Hole: Moved or dropped element slot.
-        // Unchecked: Unchecked valid elements.
-        //
-        // This drop guard will be invoked when predicate or `drop` of element panicked.
-        // It shifts unchecked elements to cover holes and `set_len` to the correct length.
-        // In cases when predicate and `drop` never panick, it will be optimized out.
-        struct BackshiftOnDrop<'a, T, const N: usize> {
-            v: &'a mut Vec<T, N>,
-            processed_len: usize,
-            deleted_cnt: usize,
-            original_len: usize,
-        }
-
-        impl<T, const N: usize> Drop for BackshiftOnDrop<'_, T, N> {
-            fn drop(&mut self) {
-                if self.deleted_cnt > 0 {
-                    // SAFETY: Trailing unchecked items must be valid since we never touch them.
-                    unsafe {
-                        ptr::copy(
-                            self.v.as_ptr().add(self.processed_len),
-                            self.v
-                                .as_mut_ptr()
-                                .add(self.processed_len - self.deleted_cnt),
-                            self.original_len - self.processed_len,
-                        );
-                    }
-                }
-                // SAFETY: After filling holes, all items are in contiguous memory.
-                unsafe {
-                    self.v.set_len(self.original_len - self.deleted_cnt);
-                }
-            }
-        }
-
-        let mut g = BackshiftOnDrop {
-            v: self,
-            processed_len: 0,
-            deleted_cnt: 0,
-            original_len,
-        };
-
-        fn process_loop<F, T, const N: usize, const DELETED: bool>(
-            original_len: usize,
-            f: &mut F,
-            g: &mut BackshiftOnDrop<'_, T, N>,
-        ) where
-            F: FnMut(&mut T) -> bool,
-        {
-            while g.processed_len != original_len {
-                let p = g.v.as_mut_ptr();
-                // SAFETY: Unchecked element must be valid.
-                let cur = unsafe { &mut *p.add(g.processed_len) };
-                if !f(cur) {
-                    // Advance early to avoid double drop if `drop_in_place` panicked.
-                    g.processed_len += 1;
-                    g.deleted_cnt += 1;
-                    // SAFETY: We never touch this element again after dropped.
-                    unsafe { ptr::drop_in_place(cur) };
-                    // We already advanced the counter.
-                    if DELETED {
-                        continue;
-                    } else {
-                        break;
-                    }
-                }
-                if DELETED {
-                    // SAFETY: `deleted_cnt` > 0, so the hole slot must not overlap with current element.
-                    // We use copy for move, and never touch this element again.
-                    unsafe {
-                        let hole_slot = p.add(g.processed_len - g.deleted_cnt);
-                        ptr::copy_nonoverlapping(cur, hole_slot, 1);
-                    }
-                }
-                g.processed_len += 1;
-            }
-        }
-
-        // Stage 1: Nothing was deleted.
-        process_loop::<F, T, N, false>(original_len, &mut f, &mut g);
-
-        // Stage 2: Some elements were deleted.
-        process_loop::<F, T, N, true>(original_len, &mut f, &mut g);
-
-        // All item are processed. This can be optimized to `set_len` by LLVM.
-        drop(g);
-    }
-}
-
-// Trait implementations
-
-impl<T, const N: usize> Default for Vec<T, N> {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-impl<T, const N: usize> fmt::Debug for Vec<T, N>
-where
-    T: fmt::Debug,
-{
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        <[T] as fmt::Debug>::fmt(self, f)
-    }
-}
-
-impl<const N: usize> fmt::Write for Vec<u8, N> {
-    fn write_str(&mut self, s: &str) -> fmt::Result {
-        match self.extend_from_slice(s.as_bytes()) {
-            Ok(()) => Ok(()),
-            Err(_) => Err(fmt::Error),
-        }
-    }
-}
-
-impl<T, const N: usize> Drop for Vec<T, N> {
-    fn drop(&mut self) {
-        // We drop each element used in the vector by turning into a &mut[T]
-        unsafe {
-            ptr::drop_in_place(self.as_mut_slice());
-        }
-    }
-}
-
-impl<'a, T: Clone, const N: usize> TryFrom<&'a [T]> for Vec<T, N> {
-    type Error = ();
-
-    fn try_from(slice: &'a [T]) -> Result<Self, Self::Error> {
-        Vec::from_slice(slice)
-    }
-}
-
-impl<T, const N: usize> Extend<T> for Vec<T, N> {
-    fn extend<I>(&mut self, iter: I)
-    where
-        I: IntoIterator<Item = T>,
-    {
-        self.extend(iter)
-    }
-}
-
-impl<'a, T, const N: usize> Extend<&'a T> for Vec<T, N>
-where
-    T: 'a + Copy,
-{
-    fn extend<I>(&mut self, iter: I)
-    where
-        I: IntoIterator<Item = &'a T>,
-    {
-        self.extend(iter.into_iter().cloned())
-    }
-}
-
-impl<T, const N: usize> hash::Hash for Vec<T, N>
-where
-    T: core::hash::Hash,
-{
-    fn hash<H: hash::Hasher>(&self, state: &mut H) {
-        <[T] as hash::Hash>::hash(self, state)
-    }
-}
-
-impl<T, const N: usize> hash32::Hash for Vec<T, N>
-where
-    T: hash32::Hash,
-{
-    fn hash<H: hash32::Hasher>(&self, state: &mut H) {
-        <[T] as hash32::Hash>::hash(self, state)
-    }
-}
-
-impl<'a, T, const N: usize> IntoIterator for &'a Vec<T, N> {
-    type Item = &'a T;
-    type IntoIter = slice::Iter<'a, T>;
-
-    fn into_iter(self) -> Self::IntoIter {
-        self.iter()
-    }
-}
-
-impl<'a, T, const N: usize> IntoIterator for &'a mut Vec<T, N> {
-    type Item = &'a mut T;
-    type IntoIter = slice::IterMut<'a, T>;
-
-    fn into_iter(self) -> Self::IntoIter {
-        self.iter_mut()
-    }
-}
-
-impl<T, const N: usize> FromIterator<T> for Vec<T, N> {
-    fn from_iter<I>(iter: I) -> Self
-    where
-        I: IntoIterator<Item = T>,
-    {
-        let mut vec = Vec::new();
-        for i in iter {
-            vec.push(i).ok().expect("Vec::from_iter overflow");
-        }
-        vec
-    }
-}
-
-/// An iterator that moves out of an [`Vec`][`Vec`].
-///
-/// This struct is created by calling the `into_iter` method on [`Vec`][`Vec`].
-///
-/// [`Vec`]: (https://doc.rust-lang.org/std/vec/struct.Vec.html)
-///
-pub struct IntoIter<T, const N: usize> {
-    vec: Vec<T, N>,
-    next: usize,
-}
-
-impl<T, const N: usize> Iterator for IntoIter<T, N> {
-    type Item = T;
-    fn next(&mut self) -> Option<Self::Item> {
-        if self.next < self.vec.len() {
-            let item = unsafe {
-                (self.vec.buffer.get_unchecked_mut(self.next).as_ptr() as *const T).read()
-            };
-            self.next += 1;
-            Some(item)
-        } else {
-            None
-        }
-    }
-}
-
-impl<T, const N: usize> Clone for IntoIter<T, N>
-where
-    T: Clone,
-{
-    fn clone(&self) -> Self {
-        let mut vec = Vec::new();
-
-        if self.next < self.vec.len() {
-            let s = unsafe {
-                slice::from_raw_parts(
-                    (self.vec.buffer.as_ptr() as *const T).add(self.next),
-                    self.vec.len() - self.next,
-                )
-            };
-            vec.extend_from_slice(s).ok();
-        }
-
-        Self { vec, next: 0 }
-    }
-}
-
-impl<T, const N: usize> Drop for IntoIter<T, N> {
-    fn drop(&mut self) {
-        unsafe {
-            // Drop all the elements that have not been moved out of vec
-            ptr::drop_in_place(&mut self.vec.as_mut_slice()[self.next..]);
-            // Prevent dropping of other elements
-            self.vec.len = 0;
-        }
-    }
-}
-
-impl<T, const N: usize> IntoIterator for Vec<T, N> {
-    type Item = T;
-    type IntoIter = IntoIter<T, N>;
-
-    fn into_iter(self) -> Self::IntoIter {
-        IntoIter { vec: self, next: 0 }
-    }
-}
-
-impl<A, B, const N1: usize, const N2: usize> PartialEq<Vec<B, N2>> for Vec<A, N1>
-where
-    A: PartialEq<B>,
-{
-    fn eq(&self, other: &Vec<B, N2>) -> bool {
-        <[A]>::eq(self, &**other)
-    }
-}
-
-// Vec<A, N> == [B]
-impl<A, B, const N: usize> PartialEq<[B]> for Vec<A, N>
-where
-    A: PartialEq<B>,
-{
-    fn eq(&self, other: &[B]) -> bool {
-        <[A]>::eq(self, &other[..])
-    }
-}
-
-// [B] == Vec<A, N>
-impl<A, B, const N: usize> PartialEq<Vec<A, N>> for [B]
-where
-    A: PartialEq<B>,
-{
-    fn eq(&self, other: &Vec<A, N>) -> bool {
-        <[A]>::eq(other, &self[..])
-    }
-}
-
-// Vec<A, N> == &[B]
-impl<A, B, const N: usize> PartialEq<&[B]> for Vec<A, N>
-where
-    A: PartialEq<B>,
-{
-    fn eq(&self, other: &&[B]) -> bool {
-        <[A]>::eq(self, &other[..])
-    }
-}
-
-// &[B] == Vec<A, N>
-impl<A, B, const N: usize> PartialEq<Vec<A, N>> for &[B]
-where
-    A: PartialEq<B>,
-{
-    fn eq(&self, other: &Vec<A, N>) -> bool {
-        <[A]>::eq(other, &self[..])
-    }
-}
-
-// Vec<A, N> == &mut [B]
-impl<A, B, const N: usize> PartialEq<&mut [B]> for Vec<A, N>
-where
-    A: PartialEq<B>,
-{
-    fn eq(&self, other: &&mut [B]) -> bool {
-        <[A]>::eq(self, &other[..])
-    }
-}
-
-// &mut [B] == Vec<A, N>
-impl<A, B, const N: usize> PartialEq<Vec<A, N>> for &mut [B]
-where
-    A: PartialEq<B>,
-{
-    fn eq(&self, other: &Vec<A, N>) -> bool {
-        <[A]>::eq(other, &self[..])
-    }
-}
-
-// Vec<A, N> == [B; M]
-// Equality does not require equal capacity
-impl<A, B, const N: usize, const M: usize> PartialEq<[B; M]> for Vec<A, N>
-where
-    A: PartialEq<B>,
-{
-    fn eq(&self, other: &[B; M]) -> bool {
-        <[A]>::eq(self, &other[..])
-    }
-}
-
-// [B; M] == Vec<A, N>
-// Equality does not require equal capacity
-impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for [B; M]
-where
-    A: PartialEq<B>,
-{
-    fn eq(&self, other: &Vec<A, N>) -> bool {
-        <[A]>::eq(other, &self[..])
-    }
-}
-
-// Vec<A, N> == &[B; M]
-// Equality does not require equal capacity
-impl<A, B, const N: usize, const M: usize> PartialEq<&[B; M]> for Vec<A, N>
-where
-    A: PartialEq<B>,
-{
-    fn eq(&self, other: &&[B; M]) -> bool {
-        <[A]>::eq(self, &other[..])
-    }
-}
-
-// &[B; M] == Vec<A, N>
-// Equality does not require equal capacity
-impl<A, B, const N: usize, const M: usize> PartialEq<Vec<A, N>> for &[B; M]
-where
-    A: PartialEq<B>,
-{
-    fn eq(&self, other: &Vec<A, N>) -> bool {
-        <[A]>::eq(other, &self[..])
-    }
-}
-
-// Implements Eq if underlying data is Eq
-impl<T, const N: usize> Eq for Vec<T, N> where T: Eq {}
-
-impl<T, const N1: usize, const N2: usize> PartialOrd<Vec<T, N2>> for Vec<T, N1>
-where
-    T: PartialOrd,
-{
-    fn partial_cmp(&self, other: &Vec<T, N2>) -> Option<Ordering> {
-        PartialOrd::partial_cmp(&**self, &**other)
-    }
-}
-
-impl<T, const N: usize> Ord for Vec<T, N>
-where
-    T: Ord,
-{
-    #[inline]
-    fn cmp(&self, other: &Self) -> Ordering {
-        Ord::cmp(&**self, &**other)
-    }
-}
-
-impl<T, const N: usize> ops::Deref for Vec<T, N> {
-    type Target = [T];
-
-    fn deref(&self) -> &[T] {
-        self.as_slice()
-    }
-}
-
-impl<T, const N: usize> ops::DerefMut for Vec<T, N> {
-    fn deref_mut(&mut self) -> &mut [T] {
-        self.as_mut_slice()
-    }
-}
-
-impl<T, const N: usize> AsRef<Vec<T, N>> for Vec<T, N> {
-    #[inline]
-    fn as_ref(&self) -> &Self {
-        self
-    }
-}
-
-impl<T, const N: usize> AsMut<Vec<T, N>> for Vec<T, N> {
-    #[inline]
-    fn as_mut(&mut self) -> &mut Self {
-        self
-    }
-}
-
-impl<T, const N: usize> AsRef<[T]> for Vec<T, N> {
-    #[inline]
-    fn as_ref(&self) -> &[T] {
-        self
-    }
-}
-
-impl<T, const N: usize> AsMut<[T]> for Vec<T, N> {
-    #[inline]
-    fn as_mut(&mut self) -> &mut [T] {
-        self
-    }
-}
-
-impl<T, const N: usize> Clone for Vec<T, N>
-where
-    T: Clone,
-{
-    fn clone(&self) -> Self {
-        self.clone()
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use crate::Vec;
-    use core::fmt::Write;
-
-    #[test]
-    fn static_new() {
-        static mut _V: Vec<i32, 4> = Vec::new();
-    }
-
-    #[test]
-    fn stack_new() {
-        let mut _v: Vec<i32, 4> = Vec::new();
-    }
-
-    #[test]
-    fn is_full_empty() {
-        let mut v: Vec<i32, 4> = Vec::new();
-
-        assert!(v.is_empty());
-        assert!(!v.is_full());
-
-        v.push(1).unwrap();
-        assert!(!v.is_empty());
-        assert!(!v.is_full());
-
-        v.push(1).unwrap();
-        assert!(!v.is_empty());
-        assert!(!v.is_full());
-
-        v.push(1).unwrap();
-        assert!(!v.is_empty());
-        assert!(!v.is_full());
-
-        v.push(1).unwrap();
-        assert!(!v.is_empty());
-        assert!(v.is_full());
-    }
-
-    #[test]
-    fn drop() {
-        droppable!();
-
-        {
-            let mut v: Vec<Droppable, 2> = Vec::new();
-            v.push(Droppable::new()).ok().unwrap();
-            v.push(Droppable::new()).ok().unwrap();
-            v.pop().unwrap();
-        }
-
-        assert_eq!(Droppable::count(), 0);
-
-        {
-            let mut v: Vec<Droppable, 2> = Vec::new();
-            v.push(Droppable::new()).ok().unwrap();
-            v.push(Droppable::new()).ok().unwrap();
-        }
-
-        assert_eq!(Droppable::count(), 0);
-    }
-
-    #[test]
-    fn eq() {
-        let mut xs: Vec<i32, 4> = Vec::new();
-        let mut ys: Vec<i32, 8> = Vec::new();
-
-        assert_eq!(xs, ys);
-
-        xs.push(1).unwrap();
-        ys.push(1).unwrap();
-
-        assert_eq!(xs, ys);
-    }
-
-    #[test]
-    fn cmp() {
-        let mut xs: Vec<i32, 4> = Vec::new();
-        let mut ys: Vec<i32, 4> = Vec::new();
-
-        assert_eq!(xs, ys);
-
-        xs.push(1).unwrap();
-        ys.push(2).unwrap();
-
-        assert!(xs < ys);
-    }
-
-    #[test]
-    fn cmp_heterogenous_size() {
-        let mut xs: Vec<i32, 4> = Vec::new();
-        let mut ys: Vec<i32, 8> = Vec::new();
-
-        assert_eq!(xs, ys);
-
-        xs.push(1).unwrap();
-        ys.push(2).unwrap();
-
-        assert!(xs < ys);
-    }
-
-    #[test]
-    fn cmp_with_arrays_and_slices() {
-        let mut xs: Vec<i32, 12> = Vec::new();
-        xs.push(1).unwrap();
-
-        let array = [1];
-
-        assert_eq!(xs, array);
-        assert_eq!(array, xs);
-
-        assert_eq!(xs, array.as_slice());
-        assert_eq!(array.as_slice(), xs);
-
-        assert_eq!(xs, &array);
-        assert_eq!(&array, xs);
-
-        let longer_array = [1; 20];
-
-        assert_ne!(xs, longer_array);
-        assert_ne!(longer_array, xs);
-    }
-
-    #[test]
-    fn full() {
-        let mut v: Vec<i32, 4> = Vec::new();
-
-        v.push(0).unwrap();
-        v.push(1).unwrap();
-        v.push(2).unwrap();
-        v.push(3).unwrap();
-
-        assert!(v.push(4).is_err());
-    }
-
-    #[test]
-    fn iter() {
-        let mut v: Vec<i32, 4> = Vec::new();
-
-        v.push(0).unwrap();
-        v.push(1).unwrap();
-        v.push(2).unwrap();
-        v.push(3).unwrap();
-
-        let mut items = v.iter();
-
-        assert_eq!(items.next(), Some(&0));
-        assert_eq!(items.next(), Some(&1));
-        assert_eq!(items.next(), Some(&2));
-        assert_eq!(items.next(), Some(&3));
-        assert_eq!(items.next(), None);
-    }
-
-    #[test]
-    fn iter_mut() {
-        let mut v: Vec<i32, 4> = Vec::new();
-
-        v.push(0).unwrap();
-        v.push(1).unwrap();
-        v.push(2).unwrap();
-        v.push(3).unwrap();
-
-        let mut items = v.iter_mut();
-
-        assert_eq!(items.next(), Some(&mut 0));
-        assert_eq!(items.next(), Some(&mut 1));
-        assert_eq!(items.next(), Some(&mut 2));
-        assert_eq!(items.next(), Some(&mut 3));
-        assert_eq!(items.next(), None);
-    }
-
-    #[test]
-    fn collect_from_iter() {
-        let slice = &[1, 2, 3];
-        let vec: Vec<i32, 4> = slice.iter().cloned().collect();
-        assert_eq!(&vec, slice);
-    }
-
-    #[test]
-    #[should_panic]
-    fn collect_from_iter_overfull() {
-        let slice = &[1, 2, 3];
-        let _vec = slice.iter().cloned().collect::<Vec<_, 2>>();
-    }
-
-    #[test]
-    fn iter_move() {
-        let mut v: Vec<i32, 4> = Vec::new();
-        v.push(0).unwrap();
-        v.push(1).unwrap();
-        v.push(2).unwrap();
-        v.push(3).unwrap();
-
-        let mut items = v.into_iter();
-
-        assert_eq!(items.next(), Some(0));
-        assert_eq!(items.next(), Some(1));
-        assert_eq!(items.next(), Some(2));
-        assert_eq!(items.next(), Some(3));
-        assert_eq!(items.next(), None);
-    }
-
-    #[test]
-    fn iter_move_drop() {
-        droppable!();
-
-        {
-            let mut vec: Vec<Droppable, 2> = Vec::new();
-            vec.push(Droppable::new()).ok().unwrap();
-            vec.push(Droppable::new()).ok().unwrap();
-            let mut items = vec.into_iter();
-            // Move all
-            let _ = items.next();
-            let _ = items.next();
-        }
-
-        assert_eq!(Droppable::count(), 0);
-
-        {
-            let mut vec: Vec<Droppable, 2> = Vec::new();
-            vec.push(Droppable::new()).ok().unwrap();
-            vec.push(Droppable::new()).ok().unwrap();
-            let _items = vec.into_iter();
-            // Move none
-        }
-
-        assert_eq!(Droppable::count(), 0);
-
-        {
-            let mut vec: Vec<Droppable, 2> = Vec::new();
-            vec.push(Droppable::new()).ok().unwrap();
-            vec.push(Droppable::new()).ok().unwrap();
-            let mut items = vec.into_iter();
-            let _ = items.next(); // Move partly
-        }
-
-        assert_eq!(Droppable::count(), 0);
-    }
-
-    #[test]
-    fn push_and_pop() {
-        let mut v: Vec<i32, 4> = Vec::new();
-        assert_eq!(v.len(), 0);
-
-        assert_eq!(v.pop(), None);
-        assert_eq!(v.len(), 0);
-
-        v.push(0).unwrap();
-        assert_eq!(v.len(), 1);
-
-        assert_eq!(v.pop(), Some(0));
-        assert_eq!(v.len(), 0);
-
-        assert_eq!(v.pop(), None);
-        assert_eq!(v.len(), 0);
-    }
-
-    #[test]
-    fn resize_size_limit() {
-        let mut v: Vec<u8, 4> = Vec::new();
-
-        v.resize(0, 0).unwrap();
-        v.resize(4, 0).unwrap();
-        v.resize(5, 0).err().expect("full");
-    }
-
-    #[test]
-    fn resize_length_cases() {
-        let mut v: Vec<u8, 4> = Vec::new();
-
-        assert_eq!(v.len(), 0);
-
-        // Grow by 1
-        v.resize(1, 0).unwrap();
-        assert_eq!(v.len(), 1);
-
-        // Grow by 2
-        v.resize(3, 0).unwrap();
-        assert_eq!(v.len(), 3);
-
-        // Resize to current size
-        v.resize(3, 0).unwrap();
-        assert_eq!(v.len(), 3);
-
-        // Shrink by 1
-        v.resize(2, 0).unwrap();
-        assert_eq!(v.len(), 2);
-
-        // Shrink by 2
-        v.resize(0, 0).unwrap();
-        assert_eq!(v.len(), 0);
-    }
-
-    #[test]
-    fn resize_contents() {
-        let mut v: Vec<u8, 4> = Vec::new();
-
-        // New entries take supplied value when growing
-        v.resize(1, 17).unwrap();
-        assert_eq!(v[0], 17);
-
-        // Old values aren't changed when growing
-        v.resize(2, 18).unwrap();
-        assert_eq!(v[0], 17);
-        assert_eq!(v[1], 18);
-
-        // Old values aren't changed when length unchanged
-        v.resize(2, 0).unwrap();
-        assert_eq!(v[0], 17);
-        assert_eq!(v[1], 18);
-
-        // Old values aren't changed when shrinking
-        v.resize(1, 0).unwrap();
-        assert_eq!(v[0], 17);
-    }
-
-    #[test]
-    fn resize_default() {
-        let mut v: Vec<u8, 4> = Vec::new();
-
-        // resize_default is implemented using resize, so just check the
-        // correct value is being written.
-        v.resize_default(1).unwrap();
-        assert_eq!(v[0], 0);
-    }
-
-    #[test]
-    fn write() {
-        let mut v: Vec<u8, 4> = Vec::new();
-        write!(v, "{:x}", 1234).unwrap();
-        assert_eq!(&v[..], b"4d2");
-    }
-
-    #[test]
-    fn extend_from_slice() {
-        let mut v: Vec<u8, 4> = Vec::new();
-        assert_eq!(v.len(), 0);
-        v.extend_from_slice(&[1, 2]).unwrap();
-        assert_eq!(v.len(), 2);
-        assert_eq!(v.as_slice(), &[1, 2]);
-        v.extend_from_slice(&[3]).unwrap();
-        assert_eq!(v.len(), 3);
-        assert_eq!(v.as_slice(), &[1, 2, 3]);
-        assert!(v.extend_from_slice(&[4, 5]).is_err());
-        assert_eq!(v.len(), 3);
-        assert_eq!(v.as_slice(), &[1, 2, 3]);
-    }
-
-    #[test]
-    fn from_slice() {
-        // Successful construction
-        let v: Vec<u8, 4> = Vec::from_slice(&[1, 2, 3]).unwrap();
-        assert_eq!(v.len(), 3);
-        assert_eq!(v.as_slice(), &[1, 2, 3]);
-
-        // Slice too large
-        assert!(Vec::<u8, 2>::from_slice(&[1, 2, 3]).is_err());
-    }
-
-    #[test]
-    fn starts_with() {
-        let v: Vec<_, 8> = Vec::from_slice(b"ab").unwrap();
-        assert!(v.starts_with(&[]));
-        assert!(v.starts_with(b""));
-        assert!(v.starts_with(b"a"));
-        assert!(v.starts_with(b"ab"));
-        assert!(!v.starts_with(b"abc"));
-        assert!(!v.starts_with(b"ba"));
-        assert!(!v.starts_with(b"b"));
-    }
-
-    #[test]
-    fn ends_with() {
-        let v: Vec<_, 8> = Vec::from_slice(b"ab").unwrap();
-        assert!(v.ends_with(&[]));
-        assert!(v.ends_with(b""));
-        assert!(v.ends_with(b"b"));
-        assert!(v.ends_with(b"ab"));
-        assert!(!v.ends_with(b"abc"));
-        assert!(!v.ends_with(b"ba"));
-        assert!(!v.ends_with(b"a"));
-    }
-
-    #[test]
-    fn zero_capacity() {
-        let mut v: Vec<u8, 0> = Vec::new();
-        // Validate capacity
-        assert_eq!(v.capacity(), 0);
-
-        // Make sure there is no capacity
-        assert!(v.push(1).is_err());
-
-        // Validate length
-        assert_eq!(v.len(), 0);
-
-        // Validate pop
-        assert_eq!(v.pop(), None);
-
-        // Validate slice
-        assert_eq!(v.as_slice(), &[]);
-
-        // Validate empty
-        assert!(v.is_empty());
-
-        // Validate full
-        assert!(v.is_full());
-    }
-}
-
\ No newline at end of file diff --git a/docs/doc/src/panic_halt/lib.rs.html b/docs/doc/src/panic_halt/lib.rs.html deleted file mode 100644 index 934e466..0000000 --- a/docs/doc/src/panic_halt/lib.rs.html +++ /dev/null @@ -1,71 +0,0 @@ -lib.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-
//! Set the panicking behavior to halt
-//!
-//! This crate contains an implementation of `panic_fmt` that simply halt in an infinite loop.
-//!
-//! # Usage
-//!
-//! ``` ignore
-//! #![no_std]
-//!
-//! extern crate panic_halt;
-//!
-//! fn main() {
-//!     panic!("argument is ignored");
-//! }
-//! ```
-//!
-//! # Breakable symbols
-//!
-//! With the panic handler being `#[inline(never)]` the symbol `rust_begin_unwind` will be
-//! available to place a breakpoint on to halt when a panic is happening.
-
-#![deny(missing_docs)]
-#![deny(warnings)]
-#![no_std]
-
-use core::panic::PanicInfo;
-use core::sync::atomic::{self, Ordering};
-
-#[inline(never)]
-#[panic_handler]
-fn panic(_info: &PanicInfo) -> ! {
-    loop {
-        atomic::compiler_fence(Ordering::SeqCst);
-    }
-}
-
\ No newline at end of file diff --git a/docs/doc/src/stable_deref_trait/lib.rs.html b/docs/doc/src/stable_deref_trait/lib.rs.html deleted file mode 100644 index 533d428..0000000 --- a/docs/doc/src/stable_deref_trait/lib.rs.html +++ /dev/null @@ -1,379 +0,0 @@ -lib.rs - source
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-
// Copyright 2017 Robert Grosse
-
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-/*!
-This module defines an unsafe marker trait, StableDeref, for container types that deref to a fixed address which is valid even when the containing type is moved. For example, Box, Vec, Rc, Arc and String implement this trait. Additionally, it defines CloneStableDeref for types like Rc where clones deref to the same address.
-
-It is intended to be used by crates such as [owning_ref](https://crates.io/crates/owning_ref) and [rental](https://crates.io/crates/rental), as well as library authors who wish to make their code interoperable with such crates. For example, if you write a custom Vec type, you can implement StableDeref, and then users will be able to use your custom type together with owning_ref and rental.
-
-no_std support can be enabled by disabling default features (specifically "std"). In this case, the trait will not be implemented for the std types mentioned above, but you can still use it for your own types.
-*/
-
-#![cfg_attr(not(feature = "std"), no_std)]
-
-#[cfg(feature = "std")]
-extern crate core;
-
-#[cfg(feature = "alloc")]
-extern crate alloc;
-
-use core::ops::Deref;
-
-
-/**
-An unsafe marker trait for types that deref to a stable address, even when moved. For example, this is implemented by Box, Vec, Rc, Arc and String, among others. Even when a Box is moved, the underlying storage remains at a fixed location.
-
-More specifically, implementors must ensure that the result of calling deref() is valid for the lifetime of the object, not just the lifetime of the borrow, and that the deref is valid even if the object is moved. Also, it must be valid even after invoking arbitrary &self methods or doing anything transitively accessible from &Self. If Self also implements DerefMut, the same restrictions apply to deref_mut() and it must remain valid if anything transitively accessible from the result of deref_mut() is mutated/called. Additionally, multiple calls to deref, (and deref_mut if implemented) must return the same address. No requirements are placed on &mut self methods other than deref_mut() and drop(), if applicable.
-
-Basically, it must be valid to convert the result of deref() to a pointer, and later dereference that pointer, as long as the original object is still live, even if it has been moved or &self methods have been called on it. If DerefMut is also implemented, it must be valid to get pointers from deref() and deref_mut() and dereference them while the object is live, as long as you don't simultaneously dereference both of them.
-
-Additionally, Deref and DerefMut implementations must not panic, but users of the trait are not allowed to rely on this fact (so that this restriction can be removed later without breaking backwards compatibility, should the need arise).
-
-Here are some examples to help illustrate the requirements for implementing this trait:
-
-```
-# use std::ops::Deref;
-struct Foo(u8);
-impl Deref for Foo {
-    type Target = u8;
-    fn deref(&self) -> &Self::Target { &self.0 }
-}
-```
-
-Foo cannot implement StableDeref because the int will move when Foo is moved, invalidating the result of deref().
-
-```
-# use std::ops::Deref;
-struct Foo(Box<u8>);
-impl Deref for Foo {
-    type Target = u8;
-    fn deref(&self) -> &Self::Target { &*self.0 }
-}
-```
-
-Foo can safely implement StableDeref, due to the use of Box.
-
-
-```
-# use std::ops::Deref;
-# use std::ops::DerefMut;
-# use std::rc::Rc;
-#[derive(Clone)]
-struct Foo(Rc<u8>);
-impl Deref for Foo {
-    type Target = u8;
-    fn deref(&self) -> &Self::Target { &*self.0 }
-}
-impl DerefMut for Foo {
-    fn deref_mut(&mut self) -> &mut Self::Target { Rc::make_mut(&mut self.0) }
-}
-```
-
-This is a simple implementation of copy-on-write: Foo's deref_mut will copy the underlying int if it is not uniquely owned, ensuring unique access at the point where deref_mut() returns. However, Foo cannot implement StableDeref because calling deref_mut(), followed by clone().deref() will result in mutable and immutable references to the same location. Note that if the DerefMut implementation were removed, Foo could safely implement StableDeref. Likewise, if the Clone implementation were removed, it would be safe to implement StableDeref, although Foo would not be very useful in that case, (without clones, the rc will always be uniquely owned).
-
-
-```
-# use std::ops::Deref;
-struct Foo;
-impl Deref for Foo {
-    type Target = str;
-    fn deref(&self) -> &Self::Target { &"Hello" }
-}
-```
-Foo can safely implement StableDeref. It doesn't own the data being derefed, but the data is gaurenteed to live long enough, due to it being 'static.
-
-```
-# use std::ops::Deref;
-# use std::cell::Cell;
-struct Foo(Cell<bool>);
-impl Deref for Foo {
-    type Target = str;
-    fn deref(&self) -> &Self::Target {
-        let b = self.0.get();
-        self.0.set(!b);
-        if b { &"Hello" } else { &"World" }
-    }
-}
-```
-Foo cannot safely implement StableDeref, even though every possible result of deref lives long enough. In order to safely implement StableAddress, multiple calls to deref must return the same result.
-
-```
-# use std::ops::Deref;
-# use std::ops::DerefMut;
-struct Foo(Box<(u8, u8)>);
-impl Deref for Foo {
-    type Target = u8;
-    fn deref(&self) -> &Self::Target { &self.0.deref().0 }
-}
-impl DerefMut for Foo {
-    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0.deref_mut().1 }
-}
-```
-
-Foo cannot implement StableDeref because deref and deref_mut return different addresses.
-
-
-*/
-pub unsafe trait StableDeref: Deref {}
-
-/**
-An unsafe marker trait for types where clones deref to the same address. This has all the requirements of StableDeref, and additionally requires that after calling clone(), both the old and new value deref to the same address. For example, Rc and Arc implement CloneStableDeref, but Box and Vec do not.
-
-Note that a single type should never implement both DerefMut and CloneStableDeref. If it did, this would let you get two mutable references to the same location, by cloning and then calling deref_mut() on both values.
-*/
-pub unsafe trait CloneStableDeref: StableDeref + Clone {}
-
-/////////////////////////////////////////////////////////////////////////////
-// std types integration
-/////////////////////////////////////////////////////////////////////////////
-
-#[cfg(feature = "alloc")]
-use alloc::boxed::Box;
-#[cfg(feature = "alloc")]
-use alloc::rc::Rc;
-#[cfg(feature = "alloc")]
-use alloc::sync::Arc;
-#[cfg(feature = "alloc")]
-use alloc::vec::Vec;
-#[cfg(feature = "alloc")]
-use alloc::string::String;
-
-#[cfg(feature = "std")]
-use std::ffi::{CString, OsString};
-#[cfg(feature = "std")]
-use std::path::PathBuf;
-#[cfg(feature = "std")]
-use std::sync::{MutexGuard, RwLockReadGuard, RwLockWriteGuard};
-
-use core::cell::{Ref, RefMut};
-
-
-#[cfg(feature = "alloc")]
-unsafe impl<T: ?Sized> StableDeref for Box<T> {}
-#[cfg(feature = "alloc")]
-unsafe impl<T> StableDeref for Vec<T> {}
-#[cfg(feature = "alloc")]
-unsafe impl StableDeref for String {}
-#[cfg(feature = "std")]
-unsafe impl StableDeref for CString {}
-#[cfg(feature = "std")]
-unsafe impl StableDeref for OsString {}
-#[cfg(feature = "std")]
-unsafe impl StableDeref for PathBuf {}
-
-#[cfg(feature = "alloc")]
-unsafe impl<T: ?Sized> StableDeref for Rc<T> {}
-#[cfg(feature = "alloc")]
-unsafe impl<T: ?Sized> CloneStableDeref for Rc<T> {}
-#[cfg(feature = "alloc")]
-unsafe impl<T: ?Sized> StableDeref for Arc<T> {}
-#[cfg(feature = "alloc")]
-unsafe impl<T: ?Sized> CloneStableDeref for Arc<T> {}
-
-unsafe impl<'a, T: ?Sized> StableDeref for Ref<'a, T> {}
-unsafe impl<'a, T: ?Sized> StableDeref for RefMut<'a, T> {}
-#[cfg(feature = "std")]
-unsafe impl<'a, T: ?Sized> StableDeref for MutexGuard<'a, T> {}
-#[cfg(feature = "std")]
-unsafe impl<'a, T: ?Sized> StableDeref for RwLockReadGuard<'a, T> {}
-#[cfg(feature = "std")]
-unsafe impl<'a, T: ?Sized> StableDeref for RwLockWriteGuard<'a, T> {}
-
-unsafe impl<'a, T: ?Sized> StableDeref for &'a T {}
-unsafe impl<'a, T: ?Sized> CloneStableDeref for &'a T {}
-unsafe impl<'a, T: ?Sized> StableDeref for &'a mut T {}
-
\ No newline at end of file diff --git a/docs/doc/stable_deref_trait/all.html b/docs/doc/stable_deref_trait/all.html deleted file mode 100644 index 6d04352..0000000 --- a/docs/doc/stable_deref_trait/all.html +++ /dev/null @@ -1 +0,0 @@ -List of all items in this crate

List of all items

Traits

\ No newline at end of file diff --git a/docs/doc/stable_deref_trait/index.html b/docs/doc/stable_deref_trait/index.html deleted file mode 100644 index 3bd3166..0000000 --- a/docs/doc/stable_deref_trait/index.html +++ /dev/null @@ -1,4 +0,0 @@ -stable_deref_trait - Rust
Expand description

This module defines an unsafe marker trait, StableDeref, for container types that deref to a fixed address which is valid even when the containing type is moved. For example, Box, Vec, Rc, Arc and String implement this trait. Additionally, it defines CloneStableDeref for types like Rc where clones deref to the same address.

-

It is intended to be used by crates such as owning_ref and rental, as well as library authors who wish to make their code interoperable with such crates. For example, if you write a custom Vec type, you can implement StableDeref, and then users will be able to use your custom type together with owning_ref and rental.

-

no_std support can be enabled by disabling default features (specifically “std”). In this case, the trait will not be implemented for the std types mentioned above, but you can still use it for your own types.

-

Traits

  • An unsafe marker trait for types where clones deref to the same address. This has all the requirements of StableDeref, and additionally requires that after calling clone(), both the old and new value deref to the same address. For example, Rc and Arc implement CloneStableDeref, but Box and Vec do not.
  • An unsafe marker trait for types that deref to a stable address, even when moved. For example, this is implemented by Box, Vec, Rc, Arc and String, among others. Even when a Box is moved, the underlying storage remains at a fixed location.
\ No newline at end of file diff --git a/docs/doc/stable_deref_trait/sidebar-items.js b/docs/doc/stable_deref_trait/sidebar-items.js deleted file mode 100644 index 0bb40f7..0000000 --- a/docs/doc/stable_deref_trait/sidebar-items.js +++ /dev/null @@ -1 +0,0 @@ -window.SIDEBAR_ITEMS = {"trait":["CloneStableDeref","StableDeref"]}; \ No newline at end of file diff --git a/docs/doc/stable_deref_trait/trait.CloneStableDeref.html b/docs/doc/stable_deref_trait/trait.CloneStableDeref.html deleted file mode 100644 index defa7ad..0000000 --- a/docs/doc/stable_deref_trait/trait.CloneStableDeref.html +++ /dev/null @@ -1,3 +0,0 @@ -CloneStableDeref in stable_deref_trait - Rust
pub unsafe trait CloneStableDeref: StableDeref + Clone { }
Expand description

An unsafe marker trait for types where clones deref to the same address. This has all the requirements of StableDeref, and additionally requires that after calling clone(), both the old and new value deref to the same address. For example, Rc and Arc implement CloneStableDeref, but Box and Vec do not.

-

Note that a single type should never implement both DerefMut and CloneStableDeref. If it did, this would let you get two mutable references to the same location, by cloning and then calling deref_mut() on both values.

-

Implementations on Foreign Types§

source§

impl<'a, T: ?Sized> CloneStableDeref for &'a T

Implementors§

\ No newline at end of file diff --git a/docs/doc/stable_deref_trait/trait.StableDeref.html b/docs/doc/stable_deref_trait/trait.StableDeref.html deleted file mode 100644 index 91c43f9..0000000 --- a/docs/doc/stable_deref_trait/trait.StableDeref.html +++ /dev/null @@ -1,59 +0,0 @@ -StableDeref in stable_deref_trait - Rust
pub unsafe trait StableDeref: Deref { }
Expand description

An unsafe marker trait for types that deref to a stable address, even when moved. For example, this is implemented by Box, Vec, Rc, Arc and String, among others. Even when a Box is moved, the underlying storage remains at a fixed location.

-

More specifically, implementors must ensure that the result of calling deref() is valid for the lifetime of the object, not just the lifetime of the borrow, and that the deref is valid even if the object is moved. Also, it must be valid even after invoking arbitrary &self methods or doing anything transitively accessible from &Self. If Self also implements DerefMut, the same restrictions apply to deref_mut() and it must remain valid if anything transitively accessible from the result of deref_mut() is mutated/called. Additionally, multiple calls to deref, (and deref_mut if implemented) must return the same address. No requirements are placed on &mut self methods other than deref_mut() and drop(), if applicable.

-

Basically, it must be valid to convert the result of deref() to a pointer, and later dereference that pointer, as long as the original object is still live, even if it has been moved or &self methods have been called on it. If DerefMut is also implemented, it must be valid to get pointers from deref() and deref_mut() and dereference them while the object is live, as long as you don’t simultaneously dereference both of them.

-

Additionally, Deref and DerefMut implementations must not panic, but users of the trait are not allowed to rely on this fact (so that this restriction can be removed later without breaking backwards compatibility, should the need arise).

-

Here are some examples to help illustrate the requirements for implementing this trait:

- -
struct Foo(u8);
-impl Deref for Foo {
-    type Target = u8;
-    fn deref(&self) -> &Self::Target { &self.0 }
-}
-

Foo cannot implement StableDeref because the int will move when Foo is moved, invalidating the result of deref().

- -
struct Foo(Box<u8>);
-impl Deref for Foo {
-    type Target = u8;
-    fn deref(&self) -> &Self::Target { &*self.0 }
-}
-

Foo can safely implement StableDeref, due to the use of Box.

- -
#[derive(Clone)]
-struct Foo(Rc<u8>);
-impl Deref for Foo {
-    type Target = u8;
-    fn deref(&self) -> &Self::Target { &*self.0 }
-}
-impl DerefMut for Foo {
-    fn deref_mut(&mut self) -> &mut Self::Target { Rc::make_mut(&mut self.0) }
-}
-

This is a simple implementation of copy-on-write: Foo’s deref_mut will copy the underlying int if it is not uniquely owned, ensuring unique access at the point where deref_mut() returns. However, Foo cannot implement StableDeref because calling deref_mut(), followed by clone().deref() will result in mutable and immutable references to the same location. Note that if the DerefMut implementation were removed, Foo could safely implement StableDeref. Likewise, if the Clone implementation were removed, it would be safe to implement StableDeref, although Foo would not be very useful in that case, (without clones, the rc will always be uniquely owned).

- -
struct Foo;
-impl Deref for Foo {
-    type Target = str;
-    fn deref(&self) -> &Self::Target { &"Hello" }
-}
-

Foo can safely implement StableDeref. It doesn’t own the data being derefed, but the data is gaurenteed to live long enough, due to it being ’static.

- -
struct Foo(Cell<bool>);
-impl Deref for Foo {
-    type Target = str;
-    fn deref(&self) -> &Self::Target {
-        let b = self.0.get();
-        self.0.set(!b);
-        if b { &"Hello" } else { &"World" }
-    }
-}
-

Foo cannot safely implement StableDeref, even though every possible result of deref lives long enough. In order to safely implement StableAddress, multiple calls to deref must return the same result.

- -
struct Foo(Box<(u8, u8)>);
-impl Deref for Foo {
-    type Target = u8;
-    fn deref(&self) -> &Self::Target { &self.0.deref().0 }
-}
-impl DerefMut for Foo {
-    fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0.deref_mut().1 }
-}
-

Foo cannot implement StableDeref because deref and deref_mut return different addresses.

-

Implementations on Foreign Types§

source§

impl<'a, T: ?Sized> StableDeref for RefMut<'a, T>

source§

impl<'a, T: ?Sized> StableDeref for Ref<'a, T>

source§

impl<'a, T: ?Sized> StableDeref for &'a mut T

source§

impl<'a, T: ?Sized> StableDeref for &'a T

Implementors§

\ No newline at end of file diff --git a/docs/doc/static.files/COPYRIGHT-23e9bde6c69aea69.txt b/docs/doc/static.files/COPYRIGHT-23e9bde6c69aea69.txt deleted file mode 100644 index 1447df7..0000000 --- a/docs/doc/static.files/COPYRIGHT-23e9bde6c69aea69.txt +++ /dev/null @@ -1,50 +0,0 @@ -# REUSE-IgnoreStart - -These documentation pages include resources by third parties. This copyright -file applies only to those resources. The following third party resources are -included, and carry their own copyright notices and license terms: - -* Fira Sans (FiraSans-Regular.woff2, FiraSans-Medium.woff2): - - Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ - with Reserved Font Name Fira Sans. - - Copyright (c) 2014, Telefonica S.A. - - Licensed under the SIL Open Font License, Version 1.1. - See FiraSans-LICENSE.txt. - -* rustdoc.css, main.js, and playpen.js: - - Copyright 2015 The Rust Developers. - Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or - the MIT license (LICENSE-MIT.txt) at your option. - -* normalize.css: - - Copyright (c) Nicolas Gallagher and Jonathan Neal. - Licensed under the MIT license (see LICENSE-MIT.txt). - -* Source Code Pro (SourceCodePro-Regular.ttf.woff2, - SourceCodePro-Semibold.ttf.woff2, SourceCodePro-It.ttf.woff2): - - Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), - with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark - of Adobe Systems Incorporated in the United States and/or other countries. - - Licensed under the SIL Open Font License, Version 1.1. - See SourceCodePro-LICENSE.txt. - -* Source Serif 4 (SourceSerif4-Regular.ttf.woff2, SourceSerif4-Bold.ttf.woff2, - SourceSerif4-It.ttf.woff2): - - Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name - 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United - States and/or other countries. - - Licensed under the SIL Open Font License, Version 1.1. - See SourceSerif4-LICENSE.md. - -This copyright file is intended to be distributed with rustdoc output. - -# REUSE-IgnoreEnd diff --git a/docs/doc/static.files/FiraSans-LICENSE-db4b642586e02d97.txt b/docs/doc/static.files/FiraSans-LICENSE-db4b642586e02d97.txt deleted file mode 100644 index d7e9c14..0000000 --- a/docs/doc/static.files/FiraSans-LICENSE-db4b642586e02d97.txt +++ /dev/null @@ -1,98 +0,0 @@ -// REUSE-IgnoreStart - -Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A. -with Reserved Font Name < Fira >, - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. - -// REUSE-IgnoreEnd diff --git a/docs/doc/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 b/docs/doc/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 deleted file mode 100644 index 7a1e5fc..0000000 Binary files a/docs/doc/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 and /dev/null differ diff --git a/docs/doc/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 b/docs/doc/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 deleted file mode 100644 index e766e06..0000000 Binary files a/docs/doc/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 and /dev/null differ diff --git a/docs/doc/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt b/docs/doc/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt deleted file mode 100644 index 16fe87b..0000000 --- a/docs/doc/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/docs/doc/static.files/LICENSE-MIT-65090b722b3f6c56.txt b/docs/doc/static.files/LICENSE-MIT-65090b722b3f6c56.txt deleted file mode 100644 index 31aa793..0000000 --- a/docs/doc/static.files/LICENSE-MIT-65090b722b3f6c56.txt +++ /dev/null @@ -1,23 +0,0 @@ -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/docs/doc/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 b/docs/doc/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 deleted file mode 100644 index 1866ad4..0000000 Binary files a/docs/doc/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 and /dev/null differ diff --git a/docs/doc/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt b/docs/doc/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt deleted file mode 100644 index 4b3edc2..0000000 --- a/docs/doc/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt +++ /dev/null @@ -1,103 +0,0 @@ -// REUSE-IgnoreStart - -Copyright (c) 2010, NAVER Corporation (https://www.navercorp.com/), - -with Reserved Font Name Nanum, Naver Nanum, NanumGothic, Naver NanumGothic, -NanumMyeongjo, Naver NanumMyeongjo, NanumBrush, Naver NanumBrush, NanumPen, -Naver NanumPen, Naver NanumGothicEco, NanumGothicEco, Naver NanumMyeongjoEco, -NanumMyeongjoEco, Naver NanumGothicLight, NanumGothicLight, NanumBarunGothic, -Naver NanumBarunGothic, NanumSquareRound, NanumBarunPen, MaruBuri - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. - -// REUSE-IgnoreEnd diff --git a/docs/doc/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 b/docs/doc/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 deleted file mode 100644 index 462c34e..0000000 Binary files a/docs/doc/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 and /dev/null differ diff --git a/docs/doc/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt b/docs/doc/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt deleted file mode 100644 index 0d2941e..0000000 --- a/docs/doc/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt +++ /dev/null @@ -1,97 +0,0 @@ -// REUSE-IgnoreStart - -Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. - -This Font Software is licensed under the SIL Open Font License, Version 1.1. - -This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. - -// REUSE-IgnoreEnd diff --git a/docs/doc/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 b/docs/doc/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 deleted file mode 100644 index 10b558e..0000000 Binary files a/docs/doc/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 and /dev/null differ diff --git a/docs/doc/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 b/docs/doc/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 deleted file mode 100644 index 5ec64ee..0000000 Binary files a/docs/doc/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 and /dev/null differ diff --git a/docs/doc/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 b/docs/doc/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 deleted file mode 100644 index 181a07f..0000000 Binary files a/docs/doc/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 and /dev/null differ diff --git a/docs/doc/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 b/docs/doc/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 deleted file mode 100644 index 2ae08a7..0000000 Binary files a/docs/doc/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 and /dev/null differ diff --git a/docs/doc/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md b/docs/doc/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md deleted file mode 100644 index 175fa4f..0000000 --- a/docs/doc/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md +++ /dev/null @@ -1,98 +0,0 @@ - - -Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. -Copyright 2014 - 2023 Adobe (http://www.adobe.com/), with Reserved Font Name ‘Source’. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. - -This Font Software is licensed under the SIL Open Font License, Version 1.1. - -This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. - - diff --git a/docs/doc/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 b/docs/doc/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 deleted file mode 100644 index 0263fc3..0000000 Binary files a/docs/doc/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 and /dev/null differ diff --git a/docs/doc/static.files/ayu-49e58d069f567085.css b/docs/doc/static.files/ayu-49e58d069f567085.css deleted file mode 100644 index 7a84c0b..0000000 --- a/docs/doc/static.files/ayu-49e58d069f567085.css +++ /dev/null @@ -1 +0,0 @@ - :root{--main-background-color:#0f1419;--main-color:#c5c5c5;--settings-input-color:#ffb454;--settings-input-border-color:#999;--settings-button-color:#fff;--settings-button-border-focus:#e0e0e0;--sidebar-background-color:#14191f;--sidebar-background-color-hover:rgba(70,70,70,0.33);--code-block-background-color:#191f26;--scrollbar-track-background-color:transparent;--scrollbar-thumb-background-color:#5c6773;--scrollbar-color:#5c6773 #24292f;--headings-border-bottom-color:#5c6773;--border-color:#5c6773;--button-background-color:#141920;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--search-input-focused-border-color:#5c6773;--copy-path-button-color:#fff;--copy-path-img-filter:invert(70%);--copy-path-img-hover-filter:invert(100%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ffa0a5;--trait-link-color:#39afd7;--assoc-item-link-color:#39afd7;--function-link-color:#fdd687;--macro-link-color:#a37acc;--keyword-link-color:#39afd7;--mod-link-color:#39afd7;--link-color:#39afd7;--sidebar-link-color:#53b1db;--sidebar-current-link-background-color:transparent;--search-result-link-focus-background-color:#3c3c3c;--search-result-border-color:#aaa3;--search-color:#fff;--search-error-code-background-color:#4f4c4c;--search-results-alias-color:#c5c5c5;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:none;--search-tab-button-not-selected-background:transparent !important;--search-tab-button-selected-border-top-color:none;--search-tab-button-selected-background:#141920 !important;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ff7733;--code-highlight-kw-2-color:#ff7733;--code-highlight-lifetime-color:#ff7733;--code-highlight-prelude-color:#69f2df;--code-highlight-prelude-val-color:#ff7733;--code-highlight-number-color:#b8cc52;--code-highlight-string-color:#b8cc52;--code-highlight-literal-color:#ff7733;--code-highlight-attribute-color:#e6e1cf;--code-highlight-self-color:#36a3d9;--code-highlight-macro-color:#a37acc;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#788797;--code-highlight-doc-comment-color:#a1ac88;--src-line-numbers-span-color:#5c6773;--src-line-number-highlighted-background-color:rgba(255,236,164,0.06);--test-arrow-color:#788797;--test-arrow-background-color:rgba(57,175,215,0.09);--test-arrow-hover-color:#c5c5c5;--test-arrow-hover-background-color:rgba(57,175,215,0.368);--target-background-color:rgba(255,236,164,0.06);--target-border-color:rgba(255,180,76,0.85);--kbd-color:#c5c5c5;--kbd-background:#314559;--kbd-box-shadow-color:#5c6773;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(41%) sepia(12%) saturate(487%) hue-rotate(171deg) brightness(94%) contrast(94%);--crate-search-div-hover-filter:invert(98%) sepia(12%) saturate(81%) hue-rotate(343deg) brightness(113%) contrast(76%);--crate-search-hover-border:#e0e0e0;--src-sidebar-background-selected:#14191f;--src-sidebar-background-hover:#14191f;--table-alt-row-background-color:#191f26;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(15,20,25,1);--scrape-example-code-wrapper-background-end:rgba(15,20,25,0);}h1,h2,h3,h4,h1 a,.sidebar h2 a,.sidebar h3 a,#src-sidebar>.title{color:#fff;}h4{border:none;}.docblock code{color:#ffb454;}.docblock a>code{color:#39AFD7 !important;}.code-header,.docblock pre>code,pre,pre>code,.item-info code,.rustdoc.src .example-wrap{color:#e6e1cf;}.sidebar .current,.sidebar a:hover,#src-sidebar div.files>a:hover,details.dir-entry summary:hover,#src-sidebar div.files>a:focus,details.dir-entry summary:focus,#src-sidebar div.files>a.selected{color:#ffb44c;}.sidebar-elems .location{color:#ff7733;}.src-line-numbers .line-highlighted{color:#708090;padding-right:7px;border-right:1px solid #ffb44c;}.search-results a:hover,.search-results a:focus{color:#fff !important;background-color:#3c3c3c;}.search-results a{color:#0096cf;}.search-results a div.desc{color:#c5c5c5;}.result-name .primitive>i,.result-name .keyword>i{color:#788797;}#search-tabs>button.selected{border-bottom:1px solid #ffb44c !important;border-top:none;}#search-tabs>button:not(.selected){border:none;background-color:transparent !important;}#search-tabs>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}#settings-menu>a img{filter:invert(100);} \ No newline at end of file diff --git a/docs/doc/static.files/clipboard-7571035ce49a181d.svg b/docs/doc/static.files/clipboard-7571035ce49a181d.svg deleted file mode 100644 index 8adbd99..0000000 --- a/docs/doc/static.files/clipboard-7571035ce49a181d.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/docs/doc/static.files/dark-1dd4d1ce031e15de.css b/docs/doc/static.files/dark-1dd4d1ce031e15de.css deleted file mode 100644 index a6623d9..0000000 --- a/docs/doc/static.files/dark-1dd4d1ce031e15de.css +++ /dev/null @@ -1 +0,0 @@ -:root{--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);} \ No newline at end of file diff --git a/docs/doc/static.files/favicon-16x16-8b506e7a72182f1c.png b/docs/doc/static.files/favicon-16x16-8b506e7a72182f1c.png deleted file mode 100644 index ea4b45c..0000000 Binary files a/docs/doc/static.files/favicon-16x16-8b506e7a72182f1c.png and /dev/null differ diff --git a/docs/doc/static.files/favicon-2c020d218678b618.svg b/docs/doc/static.files/favicon-2c020d218678b618.svg deleted file mode 100644 index 8b34b51..0000000 --- a/docs/doc/static.files/favicon-2c020d218678b618.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/docs/doc/static.files/favicon-32x32-422f7d1d52889060.png b/docs/doc/static.files/favicon-32x32-422f7d1d52889060.png deleted file mode 100644 index 69b8613..0000000 Binary files a/docs/doc/static.files/favicon-32x32-422f7d1d52889060.png and /dev/null differ diff --git a/docs/doc/static.files/light-f194925aa375ae96.css b/docs/doc/static.files/light-f194925aa375ae96.css deleted file mode 100644 index 61311db..0000000 --- a/docs/doc/static.files/light-f194925aa375ae96.css +++ /dev/null @@ -1 +0,0 @@ -:root{--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--sidebar-background-color:#f5f5f5;--sidebar-background-color-hover:#e0e0e0;--code-block-background-color:#f5f5f5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);} \ No newline at end of file diff --git a/docs/doc/static.files/main-8d035c8cea6edbc4.js b/docs/doc/static.files/main-8d035c8cea6edbc4.js deleted file mode 100644 index 1a1a752..0000000 --- a/docs/doc/static.files/main-8d035c8cea6edbc4.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict";window.RUSTDOC_TOOLTIP_HOVER_MS=300;window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS=450;function resourcePath(basename,extension){return getVar("root-path")+basename+getVar("resource-suffix")+extension}function hideMain(){addClass(document.getElementById(MAIN_ID),"hidden")}function showMain(){removeClass(document.getElementById(MAIN_ID),"hidden")}function elemIsInParent(elem,parent){while(elem&&elem!==document.body){if(elem===parent){return true}elem=elem.parentElement}return false}function blurHandler(event,parentElem,hideCallback){if(!elemIsInParent(document.activeElement,parentElem)&&!elemIsInParent(event.relatedTarget,parentElem)){hideCallback()}}window.rootPath=getVar("root-path");window.currentCrate=getVar("current-crate");function setMobileTopbar(){const mobileLocationTitle=document.querySelector(".mobile-topbar h2");const locationTitle=document.querySelector(".sidebar h2.location");if(mobileLocationTitle&&locationTitle){mobileLocationTitle.innerHTML=locationTitle.innerHTML}}function getVirtualKey(ev){if("key"in ev&&typeof ev.key!=="undefined"){return ev.key}const c=ev.charCode||ev.keyCode;if(c===27){return"Escape"}return String.fromCharCode(c)}const MAIN_ID="main-content";const SETTINGS_BUTTON_ID="settings-menu";const ALTERNATIVE_DISPLAY_ID="alternative-display";const NOT_DISPLAYED_ID="not-displayed";const HELP_BUTTON_ID="help-button";function getSettingsButton(){return document.getElementById(SETTINGS_BUTTON_ID)}function getHelpButton(){return document.getElementById(HELP_BUTTON_ID)}function getNakedUrl(){return window.location.href.split("?")[0].split("#")[0]}function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}function getOrCreateSection(id,classes){let el=document.getElementById(id);if(!el){el=document.createElement("section");el.id=id;el.className=classes;insertAfter(el,document.getElementById(MAIN_ID))}return el}function getAlternativeDisplayElem(){return getOrCreateSection(ALTERNATIVE_DISPLAY_ID,"content hidden")}function getNotDisplayedElem(){return getOrCreateSection(NOT_DISPLAYED_ID,"hidden")}function switchDisplayedElement(elemToDisplay){const el=getAlternativeDisplayElem();if(el.children.length>0){getNotDisplayedElem().appendChild(el.firstElementChild)}if(elemToDisplay===null){addClass(el,"hidden");showMain();return}el.appendChild(elemToDisplay);hideMain();removeClass(el,"hidden")}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function loadCss(cssUrl){const link=document.createElement("link");link.href=cssUrl;link.rel="stylesheet";document.getElementsByTagName("head")[0].appendChild(link)}function preLoadCss(cssUrl){const link=document.createElement("link");link.href=cssUrl;link.rel="preload";link.as="style";document.getElementsByTagName("head")[0].appendChild(link)}(function(){const isHelpPage=window.location.pathname.endsWith("/help.html");function loadScript(url){const script=document.createElement("script");script.src=url;document.head.append(script)}getSettingsButton().onclick=event=>{if(event.ctrlKey||event.altKey||event.metaKey){return}window.hideAllModals(false);addClass(getSettingsButton(),"rotate");event.preventDefault();loadCss(getVar("static-root-path")+getVar("settings-css"));loadScript(getVar("static-root-path")+getVar("settings-js"));preLoadCss(getVar("static-root-path")+getVar("theme-light-css"));preLoadCss(getVar("static-root-path")+getVar("theme-dark-css"));preLoadCss(getVar("static-root-path")+getVar("theme-ayu-css"));setTimeout(()=>{const themes=getVar("themes").split(",");for(const theme of themes){if(theme!==""){preLoadCss(getVar("root-path")+theme+".css")}}},0)};window.searchState={loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:()=>{let el=document.getElementById("search");if(!el){el=document.createElement("section");el.id="search";getNotDisplayedElem().appendChild(el)}return el},title:document.title,titleBeforeSearch:document.title,timeout:null,currentTab:0,focusedByTab:[null,null,null],clearInputTimeout:()=>{if(searchState.timeout!==null){clearTimeout(searchState.timeout);searchState.timeout=null}},isDisplayed:()=>searchState.outputElement().parentElement.id===ALTERNATIVE_DISPLAY_ID,focus:()=>{searchState.input.focus()},defocus:()=>{searchState.input.blur()},showResults:search=>{if(search===null||typeof search==="undefined"){search=searchState.outputElement()}switchDisplayedElement(search);searchState.mouseMovedAfterSearch=false;document.title=searchState.title},removeQueryParameters:()=>{document.title=searchState.titleBeforeSearch;if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.hash)}},hideResults:()=>{switchDisplayedElement(null);searchState.removeQueryParameters()},getQueryStringParams:()=>{const params={};window.location.search.substring(1).split("&").map(s=>{const pair=s.split("=");params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},setup:()=>{const search_input=searchState.input;if(!searchState.input){return}let searchLoaded=false;function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(getVar("static-root-path")+getVar("search-js"));loadScript(resourcePath("search-index",".js"))}}search_input.addEventListener("focus",()=>{search_input.origPlaceholder=search_input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});if(search_input.value!==""){loadSearch()}const params=searchState.getQueryStringParams();if(params.search!==undefined){searchState.setLoadingSearch();loadSearch()}},setLoadingSearch:()=>{const search=searchState.outputElement();search.innerHTML="

"+searchState.loadingText+"

";searchState.showResults(search)},};const toggleAllDocsId="toggle-all-docs";let savedHash="";function handleHashes(ev){if(ev!==null&&searchState.isDisplayed()&&ev.newURL){switchDisplayedElement(null);const hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.search+"#"+hash)}const elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}const pageId=window.location.hash.replace(/^#/,"");if(savedHash!==pageId){savedHash=pageId;if(pageId!==""){expandSection(pageId)}}}function onHashChange(ev){hideSidebar();handleHashes(ev)}function openParentDetails(elem){while(elem){if(elem.tagName==="DETAILS"){elem.open=true}elem=elem.parentNode}}function expandSection(id){openParentDetails(document.getElementById(id))}function handleEscape(ev){searchState.clearInputTimeout();searchState.hideResults();ev.preventDefault();searchState.defocus();window.hideAllModals(true)}function handleShortcut(ev){const disableShortcuts=getSettingValue("disable-shortcuts")==="true";if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts){return}if(document.activeElement.tagName==="INPUT"&&document.activeElement.type!=="checkbox"&&document.activeElement.type!=="radio"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":ev.preventDefault();searchState.focus();break;case"+":ev.preventDefault();expandAllDocs();break;case"-":ev.preventDefault();collapseAllDocs();break;case"?":showHelp();break;default:break}}}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);function addSidebarItems(){if(!window.SIDEBAR_ITEMS){return}const sidebar=document.getElementsByClassName("sidebar-elems")[0];function block(shortty,id,longty){const filtered=window.SIDEBAR_ITEMS[shortty];if(!filtered){return}const h3=document.createElement("h3");h3.innerHTML=`${longty}`;const ul=document.createElement("ul");ul.className="block "+shortty;for(const name of filtered){let path;if(shortty==="mod"){path=name+"/index.html"}else{path=shortty+"."+name+".html"}const current_page=document.location.href.split("/").pop();const link=document.createElement("a");link.href=path;if(path===current_page){link.className="current"}link.textContent=name;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebar.appendChild(h3);sidebar.appendChild(ul)}if(sidebar){block("primitive","primitives","Primitive Types");block("mod","modules","Modules");block("macro","macros","Macros");block("struct","structs","Structs");block("enum","enums","Enums");block("union","unions","Unions");block("constant","constants","Constants");block("static","static","Statics");block("trait","traits","Traits");block("fn","functions","Functions");block("type","types","Type Aliases");block("foreigntype","foreign-types","Foreign Types");block("keyword","keywords","Keywords");block("traitalias","trait-aliases","Trait Aliases")}}window.register_implementors=imp=>{const implementors=document.getElementById("implementors-list");const synthetic_implementors=document.getElementById("synthetic-implementors-list");const inlined_types=new Set();const TEXT_IDX=0;const SYNTHETIC_IDX=1;const TYPES_IDX=2;if(synthetic_implementors){onEachLazy(synthetic_implementors.getElementsByClassName("impl"),el=>{const aliases=el.getAttribute("data-aliases");if(!aliases){return}aliases.split(",").forEach(alias=>{inlined_types.add(alias)})})}let currentNbImpls=implementors.getElementsByClassName("impl").length;const traitName=document.querySelector(".main-heading h1 > .trait").textContent;const baseIdName="impl-"+traitName+"-";const libs=Object.getOwnPropertyNames(imp);const script=document.querySelector("script[data-ignore-extern-crates]");const ignoreExternCrates=new Set((script?script.getAttribute("data-ignore-extern-crates"):"").split(","));for(const lib of libs){if(lib===window.currentCrate||ignoreExternCrates.has(lib)){continue}const structs=imp[lib];struct_loop:for(const struct of structs){const list=struct[SYNTHETIC_IDX]?synthetic_implementors:implementors;if(struct[SYNTHETIC_IDX]){for(const struct_type of struct[TYPES_IDX]){if(inlined_types.has(struct_type)){continue struct_loop}inlined_types.add(struct_type)}}const code=document.createElement("h3");code.innerHTML=struct[TEXT_IDX];addClass(code,"code-header");onEachLazy(code.getElementsByTagName("a"),elem=>{const href=elem.getAttribute("href");if(href&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});const currentId=baseIdName+currentNbImpls;const anchor=document.createElement("a");anchor.href="#"+currentId;addClass(anchor,"anchor");const display=document.createElement("div");display.id=currentId;addClass(display,"impl");display.appendChild(anchor);display.appendChild(code);list.appendChild(display);currentNbImpls+=1}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}function addSidebarCrates(){if(!window.ALL_CRATES){return}const sidebarElems=document.getElementsByClassName("sidebar-elems")[0];if(!sidebarElems){return}const h3=document.createElement("h3");h3.innerHTML="Crates";const ul=document.createElement("ul");ul.className="block crate";for(const crate of window.ALL_CRATES){const link=document.createElement("a");link.href=window.rootPath+crate+"/index.html";if(window.rootPath!=="./"&&crate===window.currentCrate){link.className="current"}link.textContent=crate;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebarElems.appendChild(h3);sidebarElems.appendChild(ul)}function expandAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);removeClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hasClass(e,"type-contents-toggle")&&!hasClass(e,"more-examples-toggle")){e.open=true}});innerToggle.title="collapse all docs";innerToggle.children[0].innerText="\u2212"}function collapseAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);addClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(e.parentNode.id!=="implementations-list"||(!hasClass(e,"implementors-toggle")&&!hasClass(e,"type-contents-toggle"))){e.open=false}});innerToggle.title="expand all docs";innerToggle.children[0].innerText="+"}function toggleAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);if(!innerToggle){return}if(hasClass(innerToggle,"will-expand")){expandAllDocs()}else{collapseAllDocs()}}(function(){const toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}const hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";const hideImplementations=getSettingValue("auto-hide-trait-implementations")==="true";const hideLargeItemContents=getSettingValue("auto-hide-large-items")!=="false";function setImplementorsTogglesOpen(id,open){const list=document.getElementById(id);if(list!==null){onEachLazy(list.getElementsByClassName("implementors-toggle"),e=>{e.open=open})}}if(hideImplementations){setImplementorsTogglesOpen("trait-implementations-list",false);setImplementorsTogglesOpen("blanket-implementations-list",false)}onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hideLargeItemContents&&hasClass(e,"type-contents-toggle")){e.open=true}if(hideMethodDocs&&hasClass(e,"method-toggle")){e.open=false}})}());window.rustdoc_add_line_numbers_to_examples=()=>{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");if(line_numbers.length>0){return}const count=x.textContent.split("\n").length;const elems=[];for(let i=0;i{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");for(const node of line_numbers){parent.removeChild(node)}})};if(getSettingValue("line-numbers")==="true"){window.rustdoc_add_line_numbers_to_examples()}function showSidebar(){window.hideAllModals(false);const sidebar=document.getElementsByClassName("sidebar")[0];addClass(sidebar,"shown")}function hideSidebar(){const sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"shown")}window.addEventListener("resize",()=>{if(window.CURRENT_TOOLTIP_ELEMENT){const base=window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE;const force_visible=base.TOOLTIP_FORCE_VISIBLE;hideTooltip(false);if(force_visible){showTooltip(base);base.TOOLTIP_FORCE_VISIBLE=true}}});const mainElem=document.getElementById(MAIN_ID);if(mainElem){mainElem.addEventListener("click",hideSidebar)}onEachLazy(document.querySelectorAll("a[href^='#']"),el=>{el.addEventListener("click",()=>{expandSection(el.hash.slice(1));hideSidebar()})});onEachLazy(document.querySelectorAll(".toggle > summary:not(.hideme)"),el=>{el.addEventListener("click",e=>{if(e.target.tagName!=="SUMMARY"&&e.target.tagName!=="A"){e.preventDefault()}})});function showTooltip(e){const notable_ty=e.getAttribute("data-notable-ty");if(!window.NOTABLE_TRAITS&¬able_ty){const data=document.getElementById("notable-traits-data");if(data){window.NOTABLE_TRAITS=JSON.parse(data.innerText)}else{throw new Error("showTooltip() called with notable without any notable traits!")}}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE===e){clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);return}window.hideAllModals(false);const wrapper=document.createElement("div");if(notable_ty){wrapper.innerHTML="
"+window.NOTABLE_TRAITS[notable_ty]+"
"}else{if(e.getAttribute("title")!==null){e.setAttribute("data-title",e.getAttribute("title"));e.removeAttribute("title")}if(e.getAttribute("data-title")!==null){const titleContent=document.createElement("div");titleContent.className="content";titleContent.appendChild(document.createTextNode(e.getAttribute("data-title")));wrapper.appendChild(titleContent)}}wrapper.className="tooltip popover";const focusCatcher=document.createElement("div");focusCatcher.setAttribute("tabindex","0");focusCatcher.onfocus=hideTooltip;wrapper.appendChild(focusCatcher);const pos=e.getBoundingClientRect();wrapper.style.top=(pos.top+window.scrollY+pos.height)+"px";wrapper.style.left=0;wrapper.style.right="auto";wrapper.style.visibility="hidden";const body=document.getElementsByTagName("body")[0];body.appendChild(wrapper);const wrapperPos=wrapper.getBoundingClientRect();const finalPos=pos.left+window.scrollX-wrapperPos.width+24;if(finalPos>0){wrapper.style.left=finalPos+"px"}else{wrapper.style.setProperty("--popover-arrow-offset",(wrapperPos.right-pos.right+4)+"px")}wrapper.style.visibility="";window.CURRENT_TOOLTIP_ELEMENT=wrapper;window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE=e;clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);wrapper.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}clearTooltipHoverTimeout(e)};wrapper.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&!elemIsInParent(ev.relatedTarget,e)){setTooltipHoverTimeout(e,false);addClass(wrapper,"fade-out")}}}function setTooltipHoverTimeout(element,show){clearTooltipHoverTimeout(element);if(!show&&!window.CURRENT_TOOLTIP_ELEMENT){return}if(show&&window.CURRENT_TOOLTIP_ELEMENT){return}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE!==element){return}element.TOOLTIP_HOVER_TIMEOUT=setTimeout(()=>{if(show){showTooltip(element)}else if(!element.TOOLTIP_FORCE_VISIBLE){hideTooltip(false)}},show?window.RUSTDOC_TOOLTIP_HOVER_MS:window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS)}function clearTooltipHoverTimeout(element){if(element.TOOLTIP_HOVER_TIMEOUT!==undefined){removeClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out");clearTimeout(element.TOOLTIP_HOVER_TIMEOUT);delete element.TOOLTIP_HOVER_TIMEOUT}}function tooltipBlurHandler(event){if(window.CURRENT_TOOLTIP_ELEMENT&&!elemIsInParent(document.activeElement,window.CURRENT_TOOLTIP_ELEMENT)&&!elemIsInParent(event.relatedTarget,window.CURRENT_TOOLTIP_ELEMENT)&&!elemIsInParent(document.activeElement,window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE)&&!elemIsInParent(event.relatedTarget,window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE)){setTimeout(()=>hideTooltip(false),0)}}function hideTooltip(focus){if(window.CURRENT_TOOLTIP_ELEMENT){if(window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE){if(focus){window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.focus()}window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE=false}const body=document.getElementsByTagName("body")[0];body.removeChild(window.CURRENT_TOOLTIP_ELEMENT);clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);window.CURRENT_TOOLTIP_ELEMENT=null}}onEachLazy(document.getElementsByClassName("tooltip"),e=>{e.onclick=()=>{e.TOOLTIP_FORCE_VISIBLE=e.TOOLTIP_FORCE_VISIBLE?false:true;if(window.CURRENT_TOOLTIP_ELEMENT&&!e.TOOLTIP_FORCE_VISIBLE){hideTooltip(true)}else{showTooltip(e);window.CURRENT_TOOLTIP_ELEMENT.setAttribute("tabindex","0");window.CURRENT_TOOLTIP_ELEMENT.focus();window.CURRENT_TOOLTIP_ELEMENT.onblur=tooltipBlurHandler}return false};e.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointermove=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&!elemIsInParent(ev.relatedTarget,window.CURRENT_TOOLTIP_ELEMENT)){setTooltipHoverTimeout(e,false);addClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out")}}});const sidebar_menu_toggle=document.getElementsByClassName("sidebar-menu-toggle")[0];if(sidebar_menu_toggle){sidebar_menu_toggle.addEventListener("click",()=>{const sidebar=document.getElementsByClassName("sidebar")[0];if(!hasClass(sidebar,"shown")){showSidebar()}else{hideSidebar()}})}function helpBlurHandler(event){blurHandler(event,getHelpButton(),window.hidePopoverMenus)}function buildHelpMenu(){const book_info=document.createElement("span");const channel=getVar("channel");book_info.className="top";book_info.innerHTML=`You can find more information in \ -the rustdoc book.`;const shortcuts=[["?","Show this help dialog"],["S","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"
"+x[0].split(" ").map((y,index)=>((index&1)===0?""+y+"":" "+y+" ")).join("")+"
"+x[1]+"
").join("");const div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";const infos=[`For a full list of all search features, take a look here.`,"Prefix searches with a type followed by a colon (e.g., fn:) to \ - restrict the search to a given item kind.","Accepted kinds are: fn, mod, struct, \ - enum, trait, type, macro, \ - and const.","Search functions by type signature (e.g., vec -> usize or \ - -> vec or String, enum:Cow -> bool)","You can look for items with an exact name by putting double quotes around \ - your request: \"string\"","Look for functions that accept or return \ - slices and \ - arrays by writing \ - square brackets (e.g., -> [u8] or [] -> Option)","Look for items inside another one by searching for a path: vec::Vec",].map(x=>"

"+x+"

").join("");const div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;const rustdoc_version=document.createElement("span");rustdoc_version.className="bottom";const rustdoc_version_code=document.createElement("code");rustdoc_version_code.innerText="rustdoc "+getVar("rustdoc-version");rustdoc_version.appendChild(rustdoc_version_code);const container=document.createElement("div");if(!isHelpPage){container.className="popover"}container.id="help";container.style.display="none";const side_by_side=document.createElement("div");side_by_side.className="side-by-side";side_by_side.appendChild(div_shortcuts);side_by_side.appendChild(div_infos);container.appendChild(book_info);container.appendChild(side_by_side);container.appendChild(rustdoc_version);if(isHelpPage){const help_section=document.createElement("section");help_section.appendChild(container);document.getElementById("main-content").appendChild(help_section);container.style.display="block"}else{const help_button=getHelpButton();help_button.appendChild(container);container.onblur=helpBlurHandler;help_button.onblur=helpBlurHandler;help_button.children[0].onblur=helpBlurHandler}return container}window.hideAllModals=switchFocus=>{hideSidebar();window.hidePopoverMenus();hideTooltip(switchFocus)};window.hidePopoverMenus=()=>{onEachLazy(document.querySelectorAll(".search-form .popover"),elem=>{elem.style.display="none"})};function getHelpMenu(buildNeeded){let menu=getHelpButton().querySelector(".popover");if(!menu&&buildNeeded){menu=buildHelpMenu()}return menu}function showHelp(){getHelpButton().querySelector("a").focus();const menu=getHelpMenu(true);if(menu.style.display==="none"){window.hideAllModals();menu.style.display=""}}if(isHelpPage){showHelp();document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault()})}else{document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault();const menu=getHelpMenu(true);const shouldShowHelp=menu.style.display==="none";if(shouldShowHelp){showHelp()}else{window.hidePopoverMenus()}})}setMobileTopbar();addSidebarItems();addSidebarCrates();onHashChange(null);window.addEventListener("hashchange",onHashChange);searchState.setup()}());(function(){let reset_button_timeout=null;const but=document.getElementById("copy-path");if(!but){return}but.onclick=()=>{const parent=but.parentElement;const path=[];onEach(parent.childNodes,child=>{if(child.tagName==="A"){path.push(child.textContent)}});const el=document.createElement("textarea");el.value=path.join("::");el.setAttribute("readonly","");el.style.position="absolute";el.style.left="-9999px";document.body.appendChild(el);el.select();document.execCommand("copy");document.body.removeChild(el);but.children[0].style.display="none";let tmp;if(but.childNodes.length<2){tmp=document.createTextNode("✓");but.appendChild(tmp)}else{onEachLazy(but.childNodes,e=>{if(e.nodeType===Node.TEXT_NODE){tmp=e;return true}});tmp.textContent="✓"}if(reset_button_timeout!==null){window.clearTimeout(reset_button_timeout)}function reset_button(){tmp.textContent="";reset_button_timeout=null;but.children[0].style.display=""}reset_button_timeout=window.setTimeout(reset_button,1000)}}()) \ No newline at end of file diff --git a/docs/doc/static.files/normalize-76eba96aa4d2e634.css b/docs/doc/static.files/normalize-76eba96aa4d2e634.css deleted file mode 100644 index 469959f..0000000 --- a/docs/doc/static.files/normalize-76eba96aa4d2e634.css +++ /dev/null @@ -1,2 +0,0 @@ - /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ -html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type="button"],[type="reset"],[type="submit"],button{-webkit-appearance:button}[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} \ No newline at end of file diff --git a/docs/doc/static.files/noscript-cffde32267a19fd6.css b/docs/doc/static.files/noscript-cffde32267a19fd6.css deleted file mode 100644 index 12d3f6d..0000000 --- a/docs/doc/static.files/noscript-cffde32267a19fd6.css +++ /dev/null @@ -1 +0,0 @@ - #main-content .attributes{margin-left:0 !important;}#copy-path{display:none;}nav.sub{display:none;}.src .sidebar{display:none;}.notable-traits{display:none;} \ No newline at end of file diff --git a/docs/doc/static.files/rust-logo-151179464ae7ed46.svg b/docs/doc/static.files/rust-logo-151179464ae7ed46.svg deleted file mode 100644 index 62424d8..0000000 --- a/docs/doc/static.files/rust-logo-151179464ae7ed46.svg +++ /dev/null @@ -1,61 +0,0 @@ - - - diff --git a/docs/doc/static.files/rustdoc-47e7ab555ef2818a.css b/docs/doc/static.files/rustdoc-47e7ab555ef2818a.css deleted file mode 100644 index b6a585f..0000000 --- a/docs/doc/static.files/rustdoc-47e7ab555ef2818a.css +++ /dev/null @@ -1,8 +0,0 @@ - :root{--nav-sub-mobile-padding:8px;--search-typename-width:6.75rem;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular-018c141bf0843ffd.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium-8f9a781e4970d388.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:400;src:local('Source Serif 4'),url("SourceSerif4-Regular-46f98efaafac5295.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:italic;font-weight:400;src:local('Source Serif 4 Italic'),url("SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:700;src:local('Source Serif 4 Bold'),url("SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:italic;font-weight:400;src:url("SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'NanumBarunGothic';src:url("NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2") format("woff2");font-display:swap;unicode-range:U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF;}*{box-sizing:border-box;}body{font:1rem/1.5 "Source Serif 4",NanumBarunGothic,serif;margin:0;position:relative;overflow-wrap:break-word;overflow-wrap:anywhere;font-feature-settings:"kern","liga";background-color:var(--main-background-color);color:var(--main-color);}h1{font-size:1.5rem;}h2{font-size:1.375rem;}h3{font-size:1.25rem;}h1,h2,h3,h4,h5,h6{font-weight:500;}h1,h2,h3,h4{margin:25px 0 15px 0;padding-bottom:6px;}.docblock h3,.docblock h4,h5,h6{margin:15px 0 5px 0;}.docblock>h2:first-child,.docblock>h3:first-child,.docblock>h4:first-child,.docblock>h5:first-child,.docblock>h6:first-child{margin-top:0;}.main-heading h1{margin:0;padding:0;flex-grow:1;overflow-wrap:break-word;overflow-wrap:anywhere;}.main-heading{display:flex;flex-wrap:wrap;padding-bottom:6px;margin-bottom:15px;}.content h2,.top-doc .docblock>h3,.top-doc .docblock>h4{border-bottom:1px solid var(--headings-border-bottom-color);}h1,h2{line-height:1.25;padding-top:3px;padding-bottom:9px;}h3.code-header{font-size:1.125rem;}h4.code-header{font-size:1rem;}.code-header{font-weight:600;margin:0;padding:0;white-space:pre-wrap;}#crate-search,h1,h2,h3,h4,h5,h6,.sidebar,.mobile-topbar,.search-input,.search-results .result-name,.item-name>a,.out-of-band,span.since,a.src,#help-button>a,summary.hideme,.scraped-example-list,ul.all-items{font-family:"Fira Sans",Arial,NanumBarunGothic,sans-serif;}#toggle-all-docs,a.anchor,.small-section-header a,#src-sidebar a,.rust a,.sidebar h2 a,.sidebar h3 a,.mobile-topbar h2 a,h1 a,.search-results a,.stab,.result-name i{color:var(--main-color);}span.enum,a.enum,span.struct,a.struct,span.union,a.union,span.primitive,a.primitive,span.type,a.type,span.foreigntype,a.foreigntype{color:var(--type-link-color);}span.trait,a.trait,span.traitalias,a.traitalias{color:var(--trait-link-color);}span.associatedtype,a.associatedtype,span.constant,a.constant,span.static,a.static{color:var(--assoc-item-link-color);}span.fn,a.fn,span.method,a.method,span.tymethod,a.tymethod{color:var(--function-link-color);}span.attr,a.attr,span.derive,a.derive,span.macro,a.macro{color:var(--macro-link-color);}span.mod,a.mod{color:var(--mod-link-color);}span.keyword,a.keyword{color:var(--keyword-link-color);}a{color:var(--link-color);text-decoration:none;}ol,ul{padding-left:24px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.625em;}p,.docblock>.warning{margin:0 0 .75em 0;}p:last-child,.docblock>.warning:last-child{margin:0;}button{padding:1px 6px;cursor:pointer;}button#toggle-all-docs{padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.rustdoc{display:flex;flex-direction:row;flex-wrap:nowrap;}main{position:relative;flex-grow:1;padding:10px 15px 40px 45px;min-width:0;}.src main{padding:15px;}.width-limiter{max-width:960px;margin-right:auto;}details:not(.toggle) summary{margin-bottom:.6em;}code,pre,a.test-arrow,.code-header{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.125em;}.docblock pre code,.docblock-short pre code{padding:0;}pre{padding:14px;line-height:1.5;}pre.item-decl{overflow-x:auto;}.item-decl .type-contents-toggle{contain:initial;}.src .content pre{padding:20px;}.rustdoc.src .example-wrap pre.src-line-numbers{padding:20px 0 20px 4px;}img{max-width:100%;}.sub-logo-container,.logo-container{line-height:0;display:block;}.sub-logo-container{margin-right:32px;}.sub-logo-container>img{height:60px;width:60px;object-fit:contain;}.rust-logo{filter:var(--rust-logo-filter);}.sidebar{font-size:0.875rem;flex:0 0 200px;overflow-y:scroll;overscroll-behavior:contain;position:sticky;height:100vh;top:0;left:0;}.rustdoc.src .sidebar{flex-basis:50px;border-right:1px solid;overflow-x:hidden;overflow-y:hidden;z-index:1;}.sidebar,.mobile-topbar,.sidebar-menu-toggle,#src-sidebar-toggle,#src-sidebar{background-color:var(--sidebar-background-color);}#src-sidebar-toggle>button:hover,#src-sidebar-toggle>button:focus{background-color:var(--sidebar-background-color-hover);}.src .sidebar>*:not(#src-sidebar-toggle){visibility:hidden;}.src-sidebar-expanded .src .sidebar{overflow-y:auto;flex-basis:300px;}.src-sidebar-expanded .src .sidebar>*:not(#src-sidebar-toggle){visibility:visible;}#all-types{margin-top:1em;}*{scrollbar-width:initial;scrollbar-color:var(--scrollbar-color);}.sidebar{scrollbar-width:thin;scrollbar-color:var(--scrollbar-color);}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;background-color:var(--scrollbar-track-background-color);}.sidebar::-webkit-scrollbar-track{background-color:var(--scrollbar-track-background-color);}::-webkit-scrollbar-thumb,.sidebar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-background-color);}.hidden{display:none !important;}.sidebar .logo-container{margin-top:10px;margin-bottom:10px;text-align:center;}.version{overflow-wrap:break-word;}.logo-container>img{height:100px;width:100px;}ul.block,.block li{padding:0;margin:0;list-style:none;}.sidebar-elems a,.sidebar>h2 a{display:block;padding:0.25rem;margin-left:-0.25rem;}.sidebar h2{overflow-wrap:anywhere;padding:0;margin:0.7rem 0;}.sidebar h3{font-size:1.125rem;padding:0;margin:0;}.sidebar-elems,.sidebar>h2{padding-left:24px;}.sidebar a{color:var(--sidebar-link-color);}.sidebar .current,.sidebar a:hover:not(.logo-container){background-color:var(--sidebar-current-link-background-color);}.sidebar-elems .block{margin-bottom:2em;}.sidebar-elems .block li a{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}.mobile-topbar{display:none;}.rustdoc .example-wrap{display:flex;position:relative;margin-bottom:10px;}.rustdoc .example-wrap:last-child{margin-bottom:0px;}.rustdoc .example-wrap pre{margin:0;flex-grow:1;}.rustdoc:not(.src) .example-wrap pre{overflow:auto hidden;}.rustdoc .example-wrap pre.example-line-numbers,.rustdoc .example-wrap pre.src-line-numbers{flex-grow:0;min-width:fit-content;overflow:initial;text-align:right;-webkit-user-select:none;user-select:none;padding:14px 8px;color:var(--src-line-numbers-span-color);}.rustdoc .example-wrap pre.src-line-numbers{padding:14px 0;}.src-line-numbers a,.src-line-numbers span{color:var(--src-line-numbers-span-color);padding:0 8px;}.src-line-numbers :target{background-color:transparent;border-right:none;padding:0 8px;}.src-line-numbers .line-highlighted{background-color:var(--src-line-number-highlighted-background-color);}.search-loading{text-align:center;}.docblock-short{overflow-wrap:break-word;overflow-wrap:anywhere;}.docblock :not(pre)>code,.docblock-short code{white-space:pre-wrap;}.top-doc .docblock h2{font-size:1.375rem;}.top-doc .docblock h3{font-size:1.25rem;}.top-doc .docblock h4,.top-doc .docblock h5{font-size:1.125rem;}.top-doc .docblock h6{font-size:1rem;}.docblock h5{font-size:1rem;}.docblock h6{font-size:0.875rem;}.docblock{margin-left:24px;position:relative;}.docblock>:not(.more-examples-toggle):not(.example-wrap){max-width:100%;overflow-x:auto;}.out-of-band{flex-grow:0;font-size:1.125rem;}.docblock code,.docblock-short code,pre,.rustdoc.src .example-wrap{background-color:var(--code-block-background-color);}#main-content{position:relative;}.docblock table{margin:.5em 0;border-collapse:collapse;}.docblock table td,.docblock table th{padding:.5em;border:1px solid var(--border-color);}.docblock table tbody tr:nth-child(2n){background:var(--table-alt-row-background-color);}.method .where,.fn .where,.where.fmt-newline{display:block;white-space:pre-wrap;font-size:0.875rem;}.item-info{display:block;margin-left:24px;}.item-info code{font-size:0.875rem;}#main-content>.item-info{margin-left:0;}nav.sub{flex-grow:1;flex-flow:row nowrap;margin:4px 0 25px 0;display:flex;align-items:center;}.search-form{position:relative;display:flex;height:34px;flex-grow:1;}.src nav.sub{margin:0 0 15px 0;}.small-section-header{display:block;position:relative;}.small-section-header:hover>.anchor,.impl:hover>.anchor,.trait-impl:hover>.anchor,.variant:hover>.anchor{display:initial;}.anchor{display:none;position:absolute;left:-0.5em;background:none !important;}.anchor.field{left:-5px;}.small-section-header>.anchor{left:-15px;padding-right:8px;}h2.small-section-header>.anchor{padding-right:6px;}.main-heading a:hover,.example-wrap .rust a:hover,.all-items a:hover,.docblock a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,.docblock-short a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,.item-info a{text-decoration:underline;}.crate.block a.current{font-weight:500;}table,.item-table{overflow-wrap:break-word;}.item-table{display:table;padding:0;margin:0;}.item-table>li{display:table-row;}.item-table>li>div{display:table-cell;}.item-table>li>.item-name{padding-right:1.25rem;}.search-results-title{margin-top:0;white-space:nowrap;display:flex;align-items:baseline;}#crate-search-div{position:relative;min-width:5em;}#crate-search{min-width:115px;padding:0 23px 0 4px;max-width:100%;text-overflow:ellipsis;border:1px solid var(--border-color);border-radius:4px;outline:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;background-color:var(--main-background-color);color:inherit;line-height:1.5;font-weight:500;}#crate-search:hover,#crate-search:focus{border-color:var(--crate-search-hover-border);}#crate-search-div::after{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0;content:"";background-repeat:no-repeat;background-size:20px;background-position:calc(100% - 2px) 56%;background-image:url('data:image/svg+xml, \ - ');filter:var(--crate-search-div-filter);}#crate-search-div:hover::after,#crate-search-div:focus-within::after{filter:var(--crate-search-div-hover-filter);}#crate-search>option{font-size:1rem;}.search-input{-webkit-appearance:none;outline:none;border:1px solid var(--border-color);border-radius:2px;padding:8px;font-size:1rem;flex-grow:1;background-color:var(--button-background-color);color:var(--search-color);}.search-input:focus{border-color:var(--search-input-focused-border-color);}.search-results{display:none;}.search-results.active{display:block;}.search-results>a{display:flex;margin-left:2px;margin-right:2px;border-bottom:1px solid var(--search-result-border-color);gap:1em;}.search-results>a>div.desc{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex:2;}.search-results a:hover,.search-results a:focus{background-color:var(--search-result-link-focus-background-color);}.search-results .result-name{display:flex;align-items:center;justify-content:start;flex:3;}.search-results .result-name .alias{color:var(--search-results-alias-color);}.search-results .result-name .grey{color:var(--search-results-grey-color);}.search-results .result-name .typename{color:var(--search-results-grey-color);font-size:0.875rem;width:var(--search-typename-width);}.search-results .result-name .path{word-break:break-all;max-width:calc(100% - var(--search-typename-width));display:inline-block;}.search-results .result-name .path>*{display:inline;}.popover{position:absolute;top:100%;right:0;z-index:2;margin-top:7px;border-radius:3px;border:1px solid var(--border-color);background-color:var(--main-background-color);color:var(--main-color);--popover-arrow-offset:11px;}.popover::before{content:'';position:absolute;right:var(--popover-arrow-offset);border:solid var(--border-color);border-width:1px 1px 0 0;background-color:var(--main-background-color);padding:4px;transform:rotate(-45deg);top:-5px;}#help.popover{max-width:600px;--popover-arrow-offset:48px;}#help dt{float:left;clear:left;margin-right:0.5rem;}#help span.top,#help span.bottom{text-align:center;display:block;font-size:1.125rem;}#help span.top{margin:10px 0;border-bottom:1px solid var(--border-color);padding-bottom:4px;margin-bottom:6px;}#help span.bottom{clear:both;border-top:1px solid var(--border-color);}.side-by-side>div{width:50%;float:left;padding:0 20px 20px 17px;}.item-info .stab{min-height:36px;display:flex;padding:3px;margin-bottom:5px;align-items:center;vertical-align:text-bottom;}.item-name .stab{margin-left:0.3125em;}.stab{padding:0 2px;font-size:0.875rem;font-weight:normal;color:var(--main-color);background-color:var(--stab-background-color);width:fit-content;white-space:pre-wrap;border-radius:3px;display:inline;}.stab.portability>code{background:none;color:var(--stab-code-color);}.stab .emoji{font-size:1.25rem;margin-right:0.3rem;}.emoji{text-shadow:1px 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black;}.since{font-weight:normal;font-size:initial;}.rightside{padding-left:12px;float:right;}.rightside:not(a),.out-of-band{color:var(--right-side-color);}pre.rust{tab-size:4;-moz-tab-size:4;}pre.rust .kw{color:var(--code-highlight-kw-color);}pre.rust .kw-2{color:var(--code-highlight-kw-2-color);}pre.rust .lifetime{color:var(--code-highlight-lifetime-color);}pre.rust .prelude-ty{color:var(--code-highlight-prelude-color);}pre.rust .prelude-val{color:var(--code-highlight-prelude-val-color);}pre.rust .string{color:var(--code-highlight-string-color);}pre.rust .number{color:var(--code-highlight-number-color);}pre.rust .bool-val{color:var(--code-highlight-literal-color);}pre.rust .self{color:var(--code-highlight-self-color);}pre.rust .attr{color:var(--code-highlight-attribute-color);}pre.rust .macro,pre.rust .macro-nonterminal{color:var(--code-highlight-macro-color);}pre.rust .question-mark{font-weight:bold;color:var(--code-highlight-question-mark-color);}pre.rust .comment{color:var(--code-highlight-comment-color);}pre.rust .doccomment{color:var(--code-highlight-doc-comment-color);}.rustdoc.src .example-wrap pre.rust a{background:var(--codeblock-link-background);}.example-wrap.compile_fail,.example-wrap.should_panic{border-left:2px solid var(--codeblock-error-color);}.ignore.example-wrap{border-left:2px solid var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover,.example-wrap.should_panic:hover{border-left:2px solid var(--codeblock-error-hover-color);}.example-wrap.ignore:hover{border-left:2px solid var(--codeblock-ignore-hover-color);}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip{color:var(--codeblock-error-color);}.example-wrap.ignore .tooltip{color:var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover .tooltip,.example-wrap.should_panic:hover .tooltip{color:var(--codeblock-error-hover-color);}.example-wrap.ignore:hover .tooltip{color:var(--codeblock-ignore-hover-color);}.example-wrap .tooltip{position:absolute;display:block;left:-25px;top:5px;margin:0;line-height:1;}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip,.example-wrap.ignore .tooltip{font-weight:bold;font-size:1.25rem;}.content .docblock .warning{border-left:2px solid var(--warning-border-color);padding:14px;position:relative;overflow-x:visible !important;}.content .docblock .warning::before{color:var(--warning-border-color);content:"ⓘ";position:absolute;left:-25px;top:5px;font-weight:bold;font-size:1.25rem;}a.test-arrow{visibility:hidden;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:1.375rem;top:5px;right:5px;z-index:1;color:var(--test-arrow-color);background-color:var(--test-arrow-background-color);}a.test-arrow:hover{color:var(--test-arrow-hover-color);background-color:var(--test-arrow-hover-background-color);}.example-wrap:hover .test-arrow{visibility:visible;}.code-attribute{font-weight:300;color:var(--code-attribute-color);}.item-spacer{width:100%;height:12px;display:block;}.out-of-band>span.since{font-size:1.25rem;}.sub-variant h4{font-size:1rem;font-weight:400;margin-top:0;margin-bottom:0;}.sub-variant{margin-left:24px;margin-bottom:40px;}.sub-variant>.sub-variant-field{margin-left:24px;}:target{padding-right:3px;background-color:var(--target-background-color);border-right:3px solid var(--target-border-color);}.code-header a.tooltip{color:inherit;margin-right:15px;position:relative;}.code-header a.tooltip:hover{color:var(--link-color);}a.tooltip:hover::after{position:absolute;top:calc(100% - 10px);left:-15px;right:-15px;height:20px;content:"\00a0";}.fade-out{opacity:0;transition:opacity 0.45s cubic-bezier(0,0,0.1,1.0);}.popover.tooltip .content{margin:0.25em 0.5em;}.popover.tooltip .content pre,.popover.tooltip .content code{background:transparent;margin:0;padding:0;font-size:1.25rem;white-space:pre-wrap;}.popover.tooltip .content>h3:first-child{margin:0 0 5px 0;}.search-failed{text-align:center;margin-top:20px;display:none;}.search-failed.active{display:block;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#search-tabs{display:flex;flex-direction:row;gap:1px;margin-bottom:4px;}#search-tabs button{text-align:center;font-size:1.125rem;border:0;border-top:2px solid;flex:1;line-height:1.5;color:inherit;}#search-tabs button:not(.selected){background-color:var(--search-tab-button-not-selected-background);border-top-color:var(--search-tab-button-not-selected-border-top-color);}#search-tabs button:hover,#search-tabs button.selected{background-color:var(--search-tab-button-selected-background);border-top-color:var(--search-tab-button-selected-border-top-color);}#search-tabs .count{font-size:1rem;color:var(--search-tab-title-count-color);}#search .error code{border-radius:3px;background-color:var(--search-error-code-background-color);}.search-corrections{font-weight:normal;}#src-sidebar-toggle{position:sticky;top:0;left:0;font-size:1.25rem;border-bottom:1px solid;display:flex;height:40px;justify-content:stretch;align-items:stretch;z-index:10;}#src-sidebar{width:100%;overflow:auto;}#src-sidebar>.title{font-size:1.5rem;text-align:center;border-bottom:1px solid var(--border-color);margin-bottom:6px;}#src-sidebar div.files>a:hover,details.dir-entry summary:hover,#src-sidebar div.files>a:focus,details.dir-entry summary:focus{background-color:var(--src-sidebar-background-hover);}#src-sidebar div.files>a.selected{background-color:var(--src-sidebar-background-selected);}#src-sidebar-toggle>button{font-size:inherit;font-weight:bold;background:none;color:inherit;text-align:center;border:none;outline:none;flex:1 1;-webkit-appearance:none;opacity:1;}#settings-menu,#help-button{margin-left:4px;display:flex;}#settings-menu>a,#help-button>a{display:flex;align-items:center;justify-content:center;background-color:var(--button-background-color);border:1px solid var(--border-color);border-radius:2px;color:var(--settings-button-color);font-size:20px;width:33px;}#settings-menu>a:hover,#settings-menu>a:focus,#help-button>a:hover,#help-button>a:focus{border-color:var(--settings-button-border-focus);}#copy-path{color:var(--copy-path-button-color);background:var(--main-background-color);height:34px;margin-left:10px;padding:0;padding-left:2px;border:0;width:33px;}#copy-path>img{filter:var(--copy-path-img-filter);}#copy-path:hover>img{filter:var(--copy-path-img-hover-filter);}@keyframes rotating{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}#settings-menu.rotate>a img{animation:rotating 2s linear infinite;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px var(--border-color);border-radius:3px;color:var(--kbd-color);background-color:var(--kbd-background);box-shadow:inset 0 -1px 0 var(--kbd-box-shadow-color);}ul.all-items>li{list-style:none;}details.dir-entry{padding-left:4px;}details.dir-entry>summary{margin:0 0 0 -4px;padding:0 0 0 4px;cursor:pointer;}details.dir-entry div.folders,details.dir-entry div.files{padding-left:23px;}details.dir-entry a{display:block;}details.toggle{contain:layout;position:relative;}details.toggle>summary.hideme{cursor:pointer;font-size:1rem;}details.toggle>summary{list-style:none;outline:none;}details.toggle>summary::-webkit-details-marker,details.toggle>summary::marker{display:none;}details.toggle>summary.hideme>span{margin-left:9px;}details.toggle>summary::before{background:url('data:image/svg+xml,') no-repeat top left;content:"";cursor:pointer;width:16px;height:16px;display:inline-block;vertical-align:middle;opacity:.5;filter:var(--toggle-filter);}details.toggle>summary.hideme>span,.more-examples-toggle summary,.more-examples-toggle .hide-more{color:var(--toggles-color);}details.toggle>summary::after{content:"Expand";overflow:hidden;width:0;height:0;position:absolute;}details.toggle>summary.hideme::after{content:"";}details.toggle>summary:focus::before,details.toggle>summary:hover::before{opacity:1;}details.toggle>summary:focus-visible::before{outline:1px dotted #000;outline-offset:1px;}details.non-exhaustive{margin-bottom:8px;}details.toggle>summary.hideme::before{position:relative;}details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;top:4px;}.impl-items>details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;}details.toggle[open] >summary.hideme{position:absolute;}details.toggle[open] >summary.hideme>span{display:none;}details.toggle[open] >summary::before{background:url('data:image/svg+xml,') no-repeat top left;}details.toggle[open] >summary::after{content:"Collapse";}.docblock summary>*{display:inline-block;}.docblock>.example-wrap:first-child .tooltip{margin-top:16px;}@media (max-width:700px){*[id]{scroll-margin-top:45px;}.rustdoc{display:block;}main{padding-left:15px;padding-top:0px;}.main-heading{flex-direction:column;}.out-of-band{text-align:left;margin-left:initial;padding:initial;}.out-of-band .since::before{content:"Since ";}.sidebar .logo-container,.sidebar .location{display:none;}.sidebar{position:fixed;top:45px;left:-1000px;z-index:11;height:calc(100vh - 45px);width:200px;}.src main,.rustdoc.src .sidebar{top:0;padding:0;height:100vh;border:0;}.sidebar.shown,.src-sidebar-expanded .src .sidebar,.rustdoc:not(.src) .sidebar:focus-within{left:0;}.mobile-topbar h2{padding-bottom:0;margin:auto 0.5em auto auto;overflow:hidden;font-size:24px;}.mobile-topbar h2 a{display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;}.mobile-topbar .logo-container>img{max-width:35px;max-height:35px;margin:5px 0 5px 20px;}.mobile-topbar{display:flex;flex-direction:row;position:sticky;z-index:10;font-size:2rem;height:45px;width:100%;left:0;top:0;}.sidebar-menu-toggle{width:45px;font-size:32px;border:none;color:var(--main-color);}.sidebar-elems{margin-top:1em;}.anchor{display:none !important;}#search-tabs .count{display:block;}#main-content>details.toggle>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}#src-sidebar-toggle{position:fixed;left:1px;top:100px;width:30px;font-size:1.5rem;padding:0;z-index:10;border-top-right-radius:3px;border-bottom-right-radius:3px;border:1px solid;border-left:0;}.src-sidebar-expanded #src-sidebar-toggle{left:unset;top:unset;width:unset;border-top-right-radius:unset;border-bottom-right-radius:unset;position:sticky;border:0;border-bottom:1px solid;}#copy-path,#help-button{display:none;}.item-table,.item-row,.item-table>li,.item-table>li>div,.search-results>a,.search-results>a>div{display:block;}.search-results>a{padding:5px 0px;}.search-results>a>div.desc,.item-table>li>div.desc{padding-left:2em;}.search-results .result-name{display:block;}.search-results .result-name .typename{width:initial;margin-right:0;}.search-results .result-name .typename,.search-results .result-name .path{display:inline;}.src-sidebar-expanded .src .sidebar{max-width:100vw;width:100vw;}details.toggle:not(.top-doc)>summary{margin-left:10px;}.impl-items>details.toggle>summary:not(.hideme)::before,#main-content>details.toggle:not(.top-doc)>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}.impl-items>.item-info{margin-left:34px;}.src nav.sub{margin:0;padding:var(--nav-sub-mobile-padding);}}@media (min-width:701px){.scraped-example-title{position:absolute;z-index:10;background:var(--main-background-color);bottom:8px;right:5px;padding:2px 4px;box-shadow:0 0 4px var(--main-background-color);}}@media print{nav.sidebar,nav.sub,.out-of-band,a.src,#copy-path,details.toggle[open] >summary::before,details.toggle>summary::before,details.toggle.top-doc>summary{display:none;}.docblock{margin-left:0;}main{padding:10px;}}@media (max-width:464px){.docblock{margin-left:12px;}.docblock code{overflow-wrap:break-word;overflow-wrap:anywhere;}nav.sub{flex-direction:column;}.search-form{align-self:stretch;}.sub-logo-container>img{height:35px;width:35px;margin-bottom:var(--nav-sub-mobile-padding);}}.variant,.implementors-toggle>summary,.impl,#implementors-list>.docblock,.impl-items>section,.impl-items>.toggle>summary,.methods>section,.methods>.toggle>summary{margin-bottom:0.75em;}.variants>.docblock,.implementors-toggle>.docblock,.impl-items>.toggle[open]:not(:last-child),.methods>.toggle[open]:not(:last-child),.implementors-toggle[open]:not(:last-child){margin-bottom:2em;}#trait-implementations-list .impl-items>.toggle:not(:last-child),#synthetic-implementations-list .impl-items>.toggle:not(:last-child),#blanket-implementations-list .impl-items>.toggle:not(:last-child){margin-bottom:1em;}.scraped-example-list .scrape-help{margin-left:10px;padding:0 4px;font-weight:normal;font-size:12px;position:relative;bottom:1px;border:1px solid var(--scrape-example-help-border-color);border-radius:50px;color:var(--scrape-example-help-color);}.scraped-example-list .scrape-help:hover{border-color:var(--scrape-example-help-hover-border-color);color:var(--scrape-example-help-hover-color);}.scraped-example{position:relative;}.scraped-example .code-wrapper{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;}.scraped-example:not(.expanded) .code-wrapper{max-height:calc(1.5em * 5 + 10px);}.scraped-example:not(.expanded) .code-wrapper pre{overflow-y:hidden;padding-bottom:0;max-height:calc(1.5em * 5 + 10px);}.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper,.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper pre{max-height:calc(1.5em * 10 + 10px);}.scraped-example .code-wrapper .next,.scraped-example .code-wrapper .prev,.scraped-example .code-wrapper .expand{color:var(--main-color);position:absolute;top:0.25em;z-index:1;padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.scraped-example .code-wrapper .prev{right:2.25em;}.scraped-example .code-wrapper .next{right:1.25em;}.scraped-example .code-wrapper .expand{right:0.25em;}.scraped-example:not(.expanded) .code-wrapper::before,.scraped-example:not(.expanded) .code-wrapper::after{content:" ";width:100%;height:5px;position:absolute;z-index:1;}.scraped-example:not(.expanded) .code-wrapper::before{top:0;background:linear-gradient(to bottom,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example:not(.expanded) .code-wrapper::after{bottom:0;background:linear-gradient(to top,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example .code-wrapper .example-wrap{width:100%;overflow-y:hidden;margin-bottom:0;}.scraped-example:not(.expanded) .code-wrapper .example-wrap{overflow-x:hidden;}.scraped-example .example-wrap .rust span.highlight{background:var(--scrape-example-code-line-highlight);}.scraped-example .example-wrap .rust span.highlight.focus{background:var(--scrape-example-code-line-highlight-focus);}.more-examples-toggle{max-width:calc(100% + 25px);margin-top:10px;margin-left:-25px;}.more-examples-toggle .hide-more{margin-left:25px;cursor:pointer;}.more-scraped-examples{margin-left:25px;position:relative;}.toggle-line{position:absolute;top:5px;bottom:0;right:calc(100% + 10px);padding:0 4px;cursor:pointer;}.toggle-line-inner{min-width:2px;height:100%;background:var(--scrape-example-toggle-line-background);}.toggle-line:hover .toggle-line-inner{background:var(--scrape-example-toggle-line-hover-background);}.more-scraped-examples .scraped-example,.example-links{margin-top:20px;}.more-scraped-examples .scraped-example:first-child{margin-top:5px;}.example-links ul{margin-bottom:0;} \ No newline at end of file diff --git a/docs/doc/static.files/scrape-examples-ef1e698c1d417c0c.js b/docs/doc/static.files/scrape-examples-ef1e698c1d417c0c.js deleted file mode 100644 index ba830e3..0000000 --- a/docs/doc/static.files/scrape-examples-ef1e698c1d417c0c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(function(){const DEFAULT_MAX_LINES=5;const HIDDEN_MAX_LINES=10;function scrollToLoc(elt,loc,isHidden){const lines=elt.querySelector(".src-line-numbers");let scrollOffset;const maxLines=isHidden?HIDDEN_MAX_LINES:DEFAULT_MAX_LINES;if(loc[1]-loc[0]>maxLines){const line=Math.max(0,loc[0]-1);scrollOffset=lines.children[line].offsetTop}else{const wrapper=elt.querySelector(".code-wrapper");const halfHeight=wrapper.offsetHeight/2;const offsetTop=lines.children[loc[0]].offsetTop;const lastLine=lines.children[loc[1]];const offsetBot=lastLine.offsetTop+lastLine.offsetHeight;const offsetMid=(offsetTop+offsetBot)/2;scrollOffset=offsetMid-halfHeight}lines.scrollTo(0,scrollOffset);elt.querySelector(".rust").scrollTo(0,scrollOffset)}function updateScrapedExample(example,isHidden){const locs=JSON.parse(example.attributes.getNamedItem("data-locs").textContent);let locIndex=0;const highlights=Array.prototype.slice.call(example.querySelectorAll(".highlight"));const link=example.querySelector(".scraped-example-title a");if(locs.length>1){const onChangeLoc=changeIndex=>{removeClass(highlights[locIndex],"focus");changeIndex();scrollToLoc(example,locs[locIndex][0],isHidden);addClass(highlights[locIndex],"focus");const url=locs[locIndex][1];const title=locs[locIndex][2];link.href=url;link.innerHTML=title};example.querySelector(".prev").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex-1+locs.length)%locs.length})});example.querySelector(".next").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex+1)%locs.length})})}const expandButton=example.querySelector(".expand");if(expandButton){expandButton.addEventListener("click",()=>{if(hasClass(example,"expanded")){removeClass(example,"expanded");scrollToLoc(example,locs[0][0],isHidden)}else{addClass(example,"expanded")}})}scrollToLoc(example,locs[0][0],isHidden)}const firstExamples=document.querySelectorAll(".scraped-example-list > .scraped-example");onEachLazy(firstExamples,el=>updateScrapedExample(el,false));onEachLazy(document.querySelectorAll(".more-examples-toggle"),toggle=>{onEachLazy(toggle.querySelectorAll(".toggle-line, .hide-more"),button=>{button.addEventListener("click",()=>{toggle.open=false})});const moreExamples=toggle.querySelectorAll(".scraped-example");toggle.querySelector("summary").addEventListener("click",()=>{setTimeout(()=>{onEachLazy(moreExamples,el=>updateScrapedExample(el,true))})},{once:true})})})() \ No newline at end of file diff --git a/docs/doc/static.files/search-5d3eaacf19ebf04f.js b/docs/doc/static.files/search-5d3eaacf19ebf04f.js deleted file mode 100644 index db532c0..0000000 --- a/docs/doc/static.files/search-5d3eaacf19ebf04f.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";(function(){const itemTypes=["mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","primitive","associatedtype","constant","associatedconstant","union","foreigntype","keyword","existential","attr","derive","traitalias",];const longItemTypes=["module","extern crate","re-export","struct","enum","function","type alias","static","trait","","trait method","method","struct field","enum variant","macro","primitive type","assoc type","constant","assoc const","union","foreign type","keyword","existential type","attribute macro","derive macro","trait alias",];const TY_PRIMITIVE=itemTypes.indexOf("primitive");const TY_KEYWORD=itemTypes.indexOf("keyword");const ROOT_PATH=typeof window!=="undefined"?window.rootPath:"../";function hasOwnPropertyRustdoc(obj,property){return Object.prototype.hasOwnProperty.call(obj,property)}function printTab(nb){let iter=0;let foundCurrentTab=false;let foundCurrentResultSet=false;onEachLazy(document.getElementById("search-tabs").childNodes,elem=>{if(nb===iter){addClass(elem,"selected");foundCurrentTab=true}else{removeClass(elem,"selected")}iter+=1});const isTypeSearch=(nb>0||iter===1);iter=0;onEachLazy(document.getElementById("results").childNodes,elem=>{if(nb===iter){addClass(elem,"active");foundCurrentResultSet=true}else{removeClass(elem,"active")}iter+=1});if(foundCurrentTab&&foundCurrentResultSet){searchState.currentTab=nb;const correctionsElem=document.getElementsByClassName("search-corrections");if(isTypeSearch){removeClass(correctionsElem[0],"hidden")}else{addClass(correctionsElem[0],"hidden")}}else if(nb!==0){printTab(0)}}const editDistanceState={current:[],prev:[],prevPrev:[],calculate:function calculate(a,b,limit){if(a.lengthlimit){return limit+1}while(b.length>0&&b[0]===a[0]){a=a.substring(1);b=b.substring(1)}while(b.length>0&&b[b.length-1]===a[a.length-1]){a=a.substring(0,a.length-1);b=b.substring(0,b.length-1)}if(b.length===0){return minDist}const aLength=a.length;const bLength=b.length;for(let i=0;i<=bLength;++i){this.current[i]=0;this.prev[i]=i;this.prevPrev[i]=Number.MAX_VALUE}for(let i=1;i<=aLength;++i){this.current[0]=i;const aIdx=i-1;for(let j=1;j<=bLength;++j){const bIdx=j-1;const substitutionCost=a[aIdx]===b[bIdx]?0:1;this.current[j]=Math.min(this.prev[j]+1,this.current[j-1]+1,this.prev[j-1]+substitutionCost);if((i>1)&&(j>1)&&(a[aIdx]===b[bIdx-1])&&(a[aIdx-1]===b[bIdx])){this.current[j]=Math.min(this.current[j],this.prevPrev[j-2]+1)}}const prevPrevTmp=this.prevPrev;this.prevPrev=this.prev;this.prev=this.current;this.current=prevPrevTmp}const distance=this.prev[bLength];return distance<=limit?distance:(limit+1)},};function editDistance(a,b,limit){return editDistanceState.calculate(a,b,limit)}function initSearch(rawSearchIndex){const MAX_RESULTS=200;const NO_TYPE_FILTER=-1;let searchIndex;let currentResults;let typeNameIdMap;const ALIASES=new Map();let typeNameIdOfArray;let typeNameIdOfSlice;let typeNameIdOfArrayOrSlice;function buildTypeMapIndex(name){if(name===""||name===null){return-1}if(typeNameIdMap.has(name)){return typeNameIdMap.get(name)}else{const id=typeNameIdMap.size;typeNameIdMap.set(name,id);return id}}function isWhitespace(c){return" \t\n\r".indexOf(c)!==-1}function isSpecialStartCharacter(c){return"<\"".indexOf(c)!==-1}function isEndCharacter(c){return",>-]".indexOf(c)!==-1}function isStopCharacter(c){return isEndCharacter(c)}function isErrorCharacter(c){return"()".indexOf(c)!==-1}function itemTypeFromName(typename){const index=itemTypes.findIndex(i=>i===typename);if(index<0){throw["Unknown type filter ",typename]}return index}function getStringElem(query,parserState,isInGenerics){if(isInGenerics){throw["Unexpected ","\""," in generics"]}else if(query.literalSearch){throw["Cannot have more than one literal search element"]}else if(parserState.totalElems-parserState.genericsElems>0){throw["Cannot use literal search when there is more than one element"]}parserState.pos+=1;const start=parserState.pos;const end=getIdentEndPosition(parserState);if(parserState.pos>=parserState.length){throw["Unclosed ","\""]}else if(parserState.userQuery[end]!=="\""){throw["Unexpected ",parserState.userQuery[end]," in a string element"]}else if(start===end){throw["Cannot have empty string element"]}parserState.pos+=1;query.literalSearch=true}function isPathStart(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="::"}function isReturnArrow(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="->"}function isIdentCharacter(c){return(c==="_"||(c>="0"&&c<="9")||(c>="a"&&c<="z")||(c>="A"&&c<="Z"))}function isSeparatorCharacter(c){return c===","}function isPathSeparator(c){return c===":"||isWhitespace(c)}function prevIs(parserState,lookingFor){let pos=parserState.pos;while(pos>0){const c=parserState.userQuery[pos-1];if(c===lookingFor){return true}else if(!isWhitespace(c)){break}pos-=1}return false}function isLastElemGeneric(elems,parserState){return(elems.length>0&&elems[elems.length-1].generics.length>0)||prevIs(parserState,">")}function skipWhitespace(parserState){while(parserState.pos0){throw["Cannot have more than one element if you use quotes"]}const typeFilter=parserState.typeFilter;parserState.typeFilter=null;if(name==="!"){if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive never type ","!"," and ",typeFilter," both specified",]}if(generics.length!==0){throw["Never type ","!"," does not accept generic parameters",]}return{name:"never",id:-1,fullPath:["never"],pathWithoutLast:[],pathLast:"never",generics:[],typeFilter:"primitive",}}if(path.startsWith("::")){throw["Paths cannot start with ","::"]}else if(path.endsWith("::")){throw["Paths cannot end with ","::"]}else if(path.includes("::::")){throw["Unexpected ","::::"]}else if(path.includes(" ::")){throw["Unexpected "," ::"]}else if(path.includes(":: ")){throw["Unexpected ",":: "]}const pathSegments=path.split(/::|\s+/);if(pathSegments.length===0||(pathSegments.length===1&&pathSegments[0]==="")){if(generics.length>0||prevIs(parserState,">")){throw["Found generics without a path"]}else{throw["Unexpected ",parserState.userQuery[parserState.pos]]}}for(const[i,pathSegment]of pathSegments.entries()){if(pathSegment==="!"){if(i!==0){throw["Never type ","!"," is not associated item"]}pathSegments[i]="never"}}parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}return{name:name.trim(),id:-1,fullPath:pathSegments,pathWithoutLast:pathSegments.slice(0,pathSegments.length-1),pathLast:pathSegments[pathSegments.length-1],generics:generics,typeFilter,}}function getIdentEndPosition(parserState){const start=parserState.pos;let end=parserState.pos;let foundExclamation=-1;while(parserState.pos=end){throw["Found generics without a path"]}parserState.pos+=1;getItemsBefore(query,parserState,generics,">")}if(isStringElem){skipWhitespace(parserState)}if(start>=end&&generics.length===0){return}elems.push(createQueryElement(query,parserState,parserState.userQuery.slice(start,end),generics,isInGenerics))}}function getItemsBefore(query,parserState,elems,endChar){let foundStopChar=true;let start=parserState.pos;const oldTypeFilter=parserState.typeFilter;parserState.typeFilter=null;let extra="";if(endChar===">"){extra="<"}else if(endChar==="]"){extra="["}else if(endChar===""){extra="->"}else{extra=endChar}while(parserState.pos"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(endChar!==""){throw["Expected ",","," or ",endChar,...extra,", found ",c,]}throw["Expected ",",",...extra,", found ",c,]}const posBefore=parserState.pos;start=parserState.pos;getNextElem(query,parserState,elems,endChar!=="");if(endChar!==""&&parserState.pos>=parserState.length){throw["Unclosed ",extra]}if(posBefore===parserState.pos){parserState.pos+=1}foundStopChar=false}if(parserState.pos>=parserState.length&&endChar!==""){throw["Unclosed ",extra]}parserState.pos+=1;parserState.typeFilter=oldTypeFilter}function checkExtraTypeFilterCharacters(start,parserState){const query=parserState.userQuery.slice(start,parserState.pos).trim();for(const c in query){if(!isIdentCharacter(query[c])){throw["Unexpected ",query[c]," in type filter (before ",":",")",]}}}function parseInput(query,parserState){let foundStopChar=true;let start=parserState.pos;while(parserState.pos"){if(isReturnArrow(parserState)){break}throw["Unexpected ",c," (did you mean ","->","?)"]}throw["Unexpected ",c]}else if(c===":"&&!isPathStart(parserState)){if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}else if(query.elems.length===0){throw["Expected type filter before ",":"]}else if(query.literalSearch){throw["Cannot use quotes on type filter"]}const typeFilterElem=query.elems.pop();checkExtraTypeFilterCharacters(start,parserState);parserState.typeFilter=typeFilterElem.name;parserState.pos+=1;parserState.totalElems-=1;query.literalSearch=false;foundStopChar=true;continue}else if(isWhitespace(c)){skipWhitespace(parserState);continue}if(!foundStopChar){let extra="";if(isLastElemGeneric(query.elems,parserState)){extra=[" after ",">"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(parserState.typeFilter!==null){throw["Expected ",","," or ","->",...extra,", found ",c,]}throw["Expected ",",",", ",":"," or ","->",...extra,", found ",c,]}const before=query.elems.length;start=parserState.pos;getNextElem(query,parserState,query.elems,false);if(query.elems.length===before){parserState.pos+=1}foundStopChar=false}if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}while(parserState.pos"]}break}else{parserState.pos+=1}}}function newParsedQuery(userQuery){return{original:userQuery,userQuery:userQuery.toLowerCase(),elems:[],returned:[],foundElems:0,literalSearch:false,error:null,correction:null,}}function buildUrl(search,filterCrates){let extra="?search="+encodeURIComponent(search);if(filterCrates!==null){extra+="&filter-crate="+encodeURIComponent(filterCrates)}return getNakedUrl()+extra+window.location.hash}function getFilterCrates(){const elem=document.getElementById("crate-search");if(elem&&elem.value!=="all crates"&&hasOwnPropertyRustdoc(rawSearchIndex,elem.value)){return elem.value}return null}function parseQuery(userQuery){function convertTypeFilterOnElem(elem){if(elem.typeFilter!==null){let typeFilter=elem.typeFilter;if(typeFilter==="const"){typeFilter="constant"}elem.typeFilter=itemTypeFromName(typeFilter)}else{elem.typeFilter=NO_TYPE_FILTER}for(const elem2 of elem.generics){convertTypeFilterOnElem(elem2)}}userQuery=userQuery.trim();const parserState={length:userQuery.length,pos:0,totalElems:0,genericsElems:0,typeFilter:null,userQuery:userQuery.toLowerCase(),};let query=newParsedQuery(userQuery);try{parseInput(query,parserState);for(const elem of query.elems){convertTypeFilterOnElem(elem)}for(const elem of query.returned){convertTypeFilterOnElem(elem)}}catch(err){query=newParsedQuery(userQuery);query.error=err;return query}if(!query.literalSearch){query.literalSearch=parserState.totalElems>1}query.foundElems=query.elems.length+query.returned.length;return query}function createQueryResults(results_in_args,results_returned,results_others,parsedQuery){return{"in_args":results_in_args,"returned":results_returned,"others":results_others,"query":parsedQuery,}}function execQuery(parsedQuery,searchWords,filterCrates,currentCrate){const results_others=new Map(),results_in_args=new Map(),results_returned=new Map();function transformResults(results){const duplicates=new Set();const out=[];for(const result of results){if(result.id>-1){const obj=searchIndex[result.id];obj.dist=result.dist;const res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;if(duplicates.has(obj.fullPath)){continue}duplicates.add(obj.fullPath);obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out}function sortResults(results,isType,preferredCrate){if(results.size===0){return[]}const userQuery=parsedQuery.userQuery;const result_list=[];for(const result of results.values()){result.word=searchWords[result.id];result.item=searchIndex[result.id]||{};result_list.push(result)}result_list.sort((aaa,bbb)=>{let a,b;a=(aaa.word!==userQuery);b=(bbb.word!==userQuery);if(a!==b){return a-b}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.path_dist;b=bbb.path_dist;if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}a=(aaa.dist);b=(bbb.dist);if(a!==b){return a-b}a=aaa.item.deprecated;b=bbb.item.deprecated;if(a!==b){return a-b}a=(aaa.item.crate!==preferredCrate);b=(bbb.item.crate!==preferredCrate);if(a!==b){return a-b}a=aaa.word.length;b=bbb.word.length;if(a!==b){return a-b}a=aaa.word;b=bbb.word;if(a!==b){return(a>b?+1:-1)}if((aaa.item.ty===TY_PRIMITIVE&&bbb.item.ty!==TY_KEYWORD)||(aaa.item.ty===TY_KEYWORD&&bbb.item.ty!==TY_PRIMITIVE)){return-1}if((bbb.item.ty===TY_PRIMITIVE&&aaa.item.ty!==TY_PRIMITIVE)||(bbb.item.ty===TY_KEYWORD&&aaa.item.ty!==TY_KEYWORD)){return 1}a=(aaa.item.desc==="");b=(bbb.item.desc==="");if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});let nameSplit=null;if(parsedQuery.elems.length===1){const hasPath=typeof parsedQuery.elems[0].path==="undefined";nameSplit=hasPath?null:parsedQuery.elems[0].path}for(const result of result_list){if(result.dontValidate){continue}const name=result.item.name.toLowerCase(),path=result.item.path.toLowerCase(),parent=result.item.parent;if(!isType&&!validateResult(name,path,nameSplit,parent)){result.id=-1}}return transformResults(result_list)}function checkGenerics(fnType,queryElem){return unifyFunctionTypes(fnType.generics,queryElem.generics)}function unifyFunctionTypes(fnTypes,queryElems){if(queryElems.length===0){return true}if(!fnTypes||fnTypes.length===0){return false}const queryElemSet=new Map();const addQueryElemToQueryElemSet=queryElem=>{let currentQueryElemList;if(queryElemSet.has(queryElem.id)){currentQueryElemList=queryElemSet.get(queryElem.id)}else{currentQueryElemList=[];queryElemSet.set(queryElem.id,currentQueryElemList)}currentQueryElemList.push(queryElem)};for(const queryElem of queryElems){addQueryElemToQueryElemSet(queryElem)}const fnTypeSet=new Map();const addFnTypeToFnTypeSet=fnType=>{const queryContainsArrayOrSliceElem=queryElemSet.has(typeNameIdOfArrayOrSlice);if(fnType.id===-1||!(queryElemSet.has(fnType.id)||(fnType.id===typeNameIdOfSlice&&queryContainsArrayOrSliceElem)||(fnType.id===typeNameIdOfArray&&queryContainsArrayOrSliceElem))){for(const innerFnType of fnType.generics){addFnTypeToFnTypeSet(innerFnType)}return}let currentQueryElemList=queryElemSet.get(fnType.id)||[];let matchIdx=currentQueryElemList.findIndex(queryElem=>{return typePassesFilter(queryElem.typeFilter,fnType.ty)&&checkGenerics(fnType,queryElem)});if(matchIdx===-1&&(fnType.id===typeNameIdOfSlice||fnType.id===typeNameIdOfArray)&&queryContainsArrayOrSliceElem){currentQueryElemList=queryElemSet.get(typeNameIdOfArrayOrSlice)||[];matchIdx=currentQueryElemList.findIndex(queryElem=>{return typePassesFilter(queryElem.typeFilter,fnType.ty)&&checkGenerics(fnType,queryElem)})}if(matchIdx===-1){for(const innerFnType of fnType.generics){addFnTypeToFnTypeSet(innerFnType)}return}let currentFnTypeList;if(fnTypeSet.has(fnType.id)){currentFnTypeList=fnTypeSet.get(fnType.id)}else{currentFnTypeList=[];fnTypeSet.set(fnType.id,currentFnTypeList)}currentFnTypeList.push(fnType)};for(const fnType of fnTypes){addFnTypeToFnTypeSet(fnType)}const doHandleQueryElemList=(currentFnTypeList,queryElemList)=>{if(queryElemList.length===0){return true}const queryElem=queryElemList.pop();const l=currentFnTypeList.length;for(let i=0;i0){const fnTypePath=fnType.path!==undefined&&fnType.path!==null?fnType.path.split("::"):[];if(queryElemPathLength>fnTypePath.length){continue}let i=0;for(const path of fnTypePath){if(path===queryElem.pathWithoutLast[i]){i+=1;if(i>=queryElemPathLength){break}}}if(i{if(!fnTypeSet.has(id)){if(id===typeNameIdOfArrayOrSlice){return handleQueryElemList(typeNameIdOfSlice,queryElemList)||handleQueryElemList(typeNameIdOfArray,queryElemList)}return false}const currentFnTypeList=fnTypeSet.get(id);if(currentFnTypeList.length0?checkIfInList(row.generics,elem):false}const matchesExact=row.id===elem.id;const matchesArrayOrSlice=elem.id===typeNameIdOfArrayOrSlice&&(row.id===typeNameIdOfSlice||row.id===typeNameIdOfArray);if((matchesExact||matchesArrayOrSlice)&&typePassesFilter(elem.typeFilter,row.ty)){if(elem.generics.length>0){return checkGenerics(row,elem)}return true}return checkIfInList(row.generics,elem)}function checkPath(contains,ty,maxEditDistance){if(contains.length===0){return 0}let ret_dist=maxEditDistance+1;const path=ty.path.split("::");if(ty.parent&&ty.parent.name){path.push(ty.parent.name.toLowerCase())}const length=path.length;const clength=contains.length;if(clength>length){return maxEditDistance+1}for(let i=0;ilength){break}let dist_total=0;let aborted=false;for(let x=0;xmaxEditDistance){aborted=true;break}dist_total+=dist}if(!aborted){ret_dist=Math.min(ret_dist,Math.round(dist_total/clength))}}return ret_dist}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER||filter===type)return true;const name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,desc:item.desc,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,deprecated:item.deprecated,}}function handleAliases(ret,query,filterCrates,currentCrate){const lowerQuery=query.toLowerCase();const aliases=[];const crateAliases=[];if(filterCrates!==null){if(ALIASES.has(filterCrates)&&ALIASES.get(filterCrates).has(lowerQuery)){const query_aliases=ALIASES.get(filterCrates).get(lowerQuery);for(const alias of query_aliases){aliases.push(createAliasFromItem(searchIndex[alias]))}}}else{for(const[crate,crateAliasesIndex]of ALIASES){if(crateAliasesIndex.has(lowerQuery)){const pushTo=crate===currentCrate?crateAliases:aliases;const query_aliases=crateAliasesIndex.get(lowerQuery);for(const alias of query_aliases){pushTo.push(createAliasFromItem(searchIndex[alias]))}}}}const sortFunc=(aaa,bbb)=>{if(aaa.path{alias.alias=query;const res=buildHrefAndPath(alias);alias.displayPath=pathSplitter(res[0]);alias.fullPath=alias.displayPath+alias.name;alias.href=res[1];ret.others.unshift(alias);if(ret.others.length>MAX_RESULTS){ret.others.pop()}};aliases.forEach(pushFunc);crateAliases.forEach(pushFunc)}function addIntoResults(results,fullId,id,index,dist,path_dist,maxEditDistance){const inBounds=dist<=maxEditDistance||index!==-1;if(dist===0||(!parsedQuery.literalSearch&&inBounds)){if(results.has(fullId)){const result=results.get(fullId);if(result.dontValidate||result.dist<=dist){return}}results.set(fullId,{id:id,index:index,dontValidate:parsedQuery.literalSearch,dist:dist,path_dist:path_dist,})}}function handleSingleArg(row,pos,elem,results_others,results_in_args,results_returned,maxEditDistance){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let index=-1,path_dist=0;const fullId=row.id;const searchWord=searchWords[pos];const in_args=row.type&&row.type.inputs&&checkIfInList(row.type.inputs,elem);if(in_args){addIntoResults(results_in_args,fullId,pos,-1,0,0,maxEditDistance)}const returned=row.type&&row.type.output&&checkIfInList(row.type.output,elem);if(returned){addIntoResults(results_returned,fullId,pos,-1,0,0,maxEditDistance)}if(!typePassesFilter(elem.typeFilter,row.ty)){return}const row_index=row.normalizedName.indexOf(elem.pathLast);const word_index=searchWord.indexOf(elem.pathLast);if(row_index===-1){index=word_index}else if(word_index===-1){index=row_index}else if(word_index1){path_dist=checkPath(elem.pathWithoutLast,row,maxEditDistance);if(path_dist>maxEditDistance){return}}if(parsedQuery.literalSearch){if(searchWord===elem.name){addIntoResults(results_others,fullId,pos,index,0,path_dist)}return}const dist=editDistance(searchWord,elem.pathLast,maxEditDistance);if(index===-1&&dist+path_dist>maxEditDistance){return}addIntoResults(results_others,fullId,pos,index,dist,path_dist,maxEditDistance)}function handleArgs(row,pos,results){if(!row||(filterCrates!==null&&row.crate!==filterCrates)||!row.type){return}if(!unifyFunctionTypes(row.type.inputs,parsedQuery.elems)){return}if(!unifyFunctionTypes(row.type.output,parsedQuery.returned)){return}addIntoResults(results,row.id,pos,0,0,0,Number.MAX_VALUE)}function innerRunQuery(){let elem,i,nSearchWords,in_returned,row;let queryLen=0;for(const elem of parsedQuery.elems){queryLen+=elem.name.length}for(const elem of parsedQuery.returned){queryLen+=elem.name.length}const maxEditDistance=Math.floor(queryLen/3);function convertNameToId(elem){if(typeNameIdMap.has(elem.pathLast)){elem.id=typeNameIdMap.get(elem.pathLast)}else if(!parsedQuery.literalSearch){let match=-1;let matchDist=maxEditDistance+1;let matchName="";for(const[name,id]of typeNameIdMap){const dist=editDistance(name,elem.pathLast,maxEditDistance);if(dist<=matchDist&&dist<=maxEditDistance){if(dist===matchDist&&matchName>name){continue}match=id;matchDist=dist;matchName=name}}if(match!==-1){parsedQuery.correction=matchName}elem.id=match}for(const elem2 of elem.generics){convertNameToId(elem2)}}for(const elem of parsedQuery.elems){convertNameToId(elem)}for(const elem of parsedQuery.returned){convertNameToId(elem)}if(parsedQuery.foundElems===1){if(parsedQuery.elems.length===1){elem=parsedQuery.elems[0];for(i=0,nSearchWords=searchWords.length;i0){for(i=0,nSearchWords=searchWords.length;i-1||path.indexOf(key)>-1||(parent!==undefined&&parent.name!==undefined&&parent.name.toLowerCase().indexOf(key)>-1)||editDistance(name,key,maxEditDistance)<=maxEditDistance)){return false}}return true}function nextTab(direction){const next=(searchState.currentTab+direction+3)%searchState.focusedByTab.length;searchState.focusedByTab[searchState.currentTab]=document.activeElement;printTab(next);focusSearchResult()}function focusSearchResult(){const target=searchState.focusedByTab[searchState.currentTab]||document.querySelectorAll(".search-results.active a").item(0)||document.querySelectorAll("#search-tabs button").item(searchState.currentTab);searchState.focusedByTab[searchState.currentTab]=null;if(target){target.focus()}}function buildHrefAndPath(item){let displayPath;let href;const type=itemTypes[item.ty];const name=item.name;let path=item.path;if(type==="mod"){displayPath=path+"::";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="import"){displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/index.html#reexport."+name}else if(type==="primitive"||type==="keyword"){displayPath="";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=ROOT_PATH+name+"/index.html"}else if(item.parent!==undefined){const myparent=item.parent;let anchor="#"+type+"."+name;const parentType=itemTypes[myparent.ty];let pageType=parentType;let pageName=myparent.name;if(parentType==="primitive"){displayPath=myparent.name+"::"}else if(type==="structfield"&&parentType==="variant"){const enumNameIdx=item.path.lastIndexOf("::");const enumName=item.path.substr(enumNameIdx+2);path=item.path.substr(0,enumNameIdx);displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="#variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}href=ROOT_PATH+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html"+anchor}else{displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href]}function pathSplitter(path){const tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}function addTab(array,query,display){let extraClass="";if(display===true){extraClass=" active"}const output=document.createElement("div");let length=0;if(array.length>0){output.className="search-results "+extraClass;array.forEach(item=>{const name=item.name;const type=itemTypes[item.ty];const longType=longItemTypes[item.ty];const typeName=longType.length!==0?`${longType}`:"?";length+=1;const link=document.createElement("a");link.className="result-"+type;link.href=item.href;const resultName=document.createElement("div");resultName.className="result-name";resultName.insertAdjacentHTML("beforeend",`${typeName}`);link.appendChild(resultName);let alias=" ";if(item.is_alias){alias=`
\ -${item.alias} - see \ -
`}resultName.insertAdjacentHTML("beforeend",`
${alias}\ -${item.displayPath}${name}\ -
`);const description=document.createElement("div");description.className="desc";description.insertAdjacentHTML("beforeend",item.desc);link.appendChild(description);output.appendChild(link)})}else if(query.error===null){output.className="search-failed"+extraClass;output.innerHTML="No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:"}return[output,length]}function makeTabHeader(tabNb,text,nbElems){if(searchState.currentTab===tabNb){return""}return""}function showResults(results,go_to_first,filterCrates){const search=searchState.outputElement();if(go_to_first||(results.others.length===1&&getSettingValue("go-to-only-result")==="true")){window.onunload=()=>{};searchState.removeQueryParameters();const elem=document.createElement("a");elem.href=results.others[0].href;removeClass(elem,"active");document.body.appendChild(elem);elem.click();return}if(results.query===undefined){results.query=parseQuery(searchState.input.value)}currentResults=results.query.userQuery;const ret_others=addTab(results.others,results.query,true);const ret_in_args=addTab(results.in_args,results.query,false);const ret_returned=addTab(results.returned,results.query,false);let currentTab=searchState.currentTab;if((currentTab===0&&ret_others[1]===0)||(currentTab===1&&ret_in_args[1]===0)||(currentTab===2&&ret_returned[1]===0)){if(ret_others[1]!==0){currentTab=0}else if(ret_in_args[1]!==0){currentTab=1}else if(ret_returned[1]!==0){currentTab=2}}let crates="";const crates_list=Object.keys(rawSearchIndex);if(crates_list.length>1){crates=" in 
"}let output=`

Results${crates}

`;if(results.query.error!==null){const error=results.query.error;error.forEach((value,index)=>{value=value.split("<").join("<").split(">").join(">");if(index%2!==0){error[index]=`${value.replaceAll(" ", " ")}`}else{error[index]=value}});output+=`

Query parser error: "${error.join("")}".

`;output+="
"+makeTabHeader(0,"In Names",ret_others[1])+"
";currentTab=0}else if(results.query.foundElems<=1&&results.query.returned.length===0){output+="
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
"}else{const signatureTabTitle=results.query.elems.length===0?"In Function Return Types":results.query.returned.length===0?"In Function Parameters":"In Function Signatures";output+="
"+makeTabHeader(0,signatureTabTitle,ret_others[1])+"
";currentTab=0}if(results.query.correction!==null){const orig=results.query.returned.length>0?results.query.returned[0].name:results.query.elems[0].name;output+="

"+`Type "${orig}" not found. `+"Showing results for closest type name "+`"${results.query.correction}" instead.

`}const resultsElem=document.createElement("div");resultsElem.id="results";resultsElem.appendChild(ret_others[0]);resultsElem.appendChild(ret_in_args[0]);resultsElem.appendChild(ret_returned[0]);search.innerHTML=output;const crateSearch=document.getElementById("crate-search");if(crateSearch){crateSearch.addEventListener("input",updateCrate)}search.appendChild(resultsElem);searchState.showResults(search);const elems=document.getElementById("search-tabs").childNodes;searchState.focusedByTab=[];let i=0;for(const elem of elems){const j=i;elem.onclick=()=>printTab(j);searchState.focusedByTab.push(null);i+=1}printTab(currentTab)}function updateSearchHistory(url){if(!browserSupportsHistoryApi()){return}const params=searchState.getQueryStringParams();if(!history.state&&!params.search){history.pushState(null,"",url)}else{history.replaceState(null,"",url)}}function search(e,forced){if(e){e.preventDefault()}const query=parseQuery(searchState.input.value.trim());let filterCrates=getFilterCrates();if(!forced&&query.userQuery===currentResults){if(query.userQuery.length>0){putBackSearch()}return}searchState.setLoadingSearch();const params=searchState.getQueryStringParams();if(filterCrates===null&¶ms["filter-crate"]!==undefined){filterCrates=params["filter-crate"]}searchState.title="Results for "+query.original+" - Rust";updateSearchHistory(buildUrl(query.original,filterCrates));showResults(execQuery(query,searchWords,filterCrates,window.currentCrate),params.go_to_first,filterCrates)}function buildItemSearchTypeAll(types,lowercasePaths){const PATH_INDEX_DATA=0;const GENERICS_DATA=1;return types.map(type=>{let pathIndex,generics;if(typeof type==="number"){pathIndex=type;generics=[]}else{pathIndex=type[PATH_INDEX_DATA];generics=buildItemSearchTypeAll(type[GENERICS_DATA],lowercasePaths)}if(pathIndex===0){return{id:-1,ty:null,path:null,generics:generics,}}const item=lowercasePaths[pathIndex-1];return{id:buildTypeMapIndex(item.name),ty:item.ty,path:item.path,generics:generics,}})}function buildFunctionSearchType(functionSearchType,lowercasePaths){const INPUTS_DATA=0;const OUTPUT_DATA=1;if(functionSearchType===0){return null}let inputs,output;if(typeof functionSearchType[INPUTS_DATA]==="number"){const pathIndex=functionSearchType[INPUTS_DATA];if(pathIndex===0){inputs=[{id:-1,ty:null,path:null,generics:[],}]}else{const item=lowercasePaths[pathIndex-1];inputs=[{id:buildTypeMapIndex(item.name),ty:item.ty,path:item.path,generics:[],}]}}else{inputs=buildItemSearchTypeAll(functionSearchType[INPUTS_DATA],lowercasePaths)}if(functionSearchType.length>1){if(typeof functionSearchType[OUTPUT_DATA]==="number"){const pathIndex=functionSearchType[OUTPUT_DATA];if(pathIndex===0){output=[{id:-1,ty:null,path:null,generics:[],}]}else{const item=lowercasePaths[pathIndex-1];output=[{id:buildTypeMapIndex(item.name),ty:item.ty,path:item.path,generics:[],}]}}else{output=buildItemSearchTypeAll(functionSearchType[OUTPUT_DATA],lowercasePaths)}}else{output=[]}return{inputs,output,}}function buildIndex(rawSearchIndex){searchIndex=[];const searchWords=[];typeNameIdMap=new Map();const charA="A".charCodeAt(0);let currentIndex=0;let id=0;typeNameIdOfArray=buildTypeMapIndex("array");typeNameIdOfSlice=buildTypeMapIndex("slice");typeNameIdOfArrayOrSlice=buildTypeMapIndex("[]");for(const crate in rawSearchIndex){if(!hasOwnPropertyRustdoc(rawSearchIndex,crate)){continue}let crateSize=0;const crateCorpus=rawSearchIndex[crate];searchWords.push(crate);const crateRow={crate:crate,ty:1,name:crate,path:"",desc:crateCorpus.doc,parent:undefined,type:null,id:id,normalizedName:crate.indexOf("_")===-1?crate:crate.replace(/_/g,""),deprecated:null,};id+=1;searchIndex.push(crateRow);currentIndex+=1;const itemTypes=crateCorpus.t;const itemNames=crateCorpus.n;const itemPaths=new Map(crateCorpus.q);const itemDescs=crateCorpus.d;const itemParentIdxs=crateCorpus.i;const itemFunctionSearchTypes=crateCorpus.f;const deprecatedItems=new Set(crateCorpus.c);const paths=crateCorpus.p;const aliases=crateCorpus.a;const lowercasePaths=[];let len=paths.length;let lastPath=itemPaths.get(0);for(let i=0;i2){path=itemPaths.has(elem[2])?itemPaths.get(elem[2]):lastPath;lastPath=path}lowercasePaths.push({ty:ty,name:name.toLowerCase(),path:path});paths[i]={ty:ty,name:name,path:path}}lastPath="";len=itemTypes.length;for(let i=0;i0?paths[itemParentIdxs[i]-1]:undefined,type:buildFunctionSearchType(itemFunctionSearchTypes[i],lowercasePaths),id:id,normalizedName:word.indexOf("_")===-1?word:word.replace(/_/g,""),deprecated:deprecatedItems.has(i),};id+=1;searchIndex.push(row);lastPath=row.path;crateSize+=1}if(aliases){const currentCrateAliases=new Map();ALIASES.set(crate,currentCrateAliases);for(const alias_name in aliases){if(!hasOwnPropertyRustdoc(aliases,alias_name)){continue}let currentNameAliases;if(currentCrateAliases.has(alias_name)){currentNameAliases=currentCrateAliases.get(alias_name)}else{currentNameAliases=[];currentCrateAliases.set(alias_name,currentNameAliases)}for(const local_alias of aliases[alias_name]){currentNameAliases.push(local_alias+currentIndex)}}}currentIndex+=crateSize}return searchWords}function onSearchSubmit(e){e.preventDefault();searchState.clearInputTimeout();search()}function putBackSearch(){const search_input=searchState.input;if(!searchState.input){return}if(search_input.value!==""&&!searchState.isDisplayed()){searchState.showResults();if(browserSupportsHistoryApi()){history.replaceState(null,"",buildUrl(search_input.value,getFilterCrates()))}document.title=searchState.title}}function registerSearchEvents(){const params=searchState.getQueryStringParams();if(searchState.input.value===""){searchState.input.value=params.search||""}const searchAfter500ms=()=>{searchState.clearInputTimeout();if(searchState.input.value.length===0){searchState.hideResults()}else{searchState.timeout=setTimeout(search,500)}};searchState.input.onkeyup=searchAfter500ms;searchState.input.oninput=searchAfter500ms;document.getElementsByClassName("search-form")[0].onsubmit=onSearchSubmit;searchState.input.onchange=e=>{if(e.target!==document.activeElement){return}searchState.clearInputTimeout();setTimeout(search,0)};searchState.input.onpaste=searchState.input.onchange;searchState.outputElement().addEventListener("keydown",e=>{if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey){return}if(e.which===38){const previous=document.activeElement.previousElementSibling;if(previous){previous.focus()}else{searchState.focus()}e.preventDefault()}else if(e.which===40){const next=document.activeElement.nextElementSibling;if(next){next.focus()}const rect=document.activeElement.getBoundingClientRect();if(window.innerHeight-rect.bottom{if(e.which===40){focusSearchResult();e.preventDefault()}});searchState.input.addEventListener("focus",()=>{putBackSearch()});searchState.input.addEventListener("blur",()=>{searchState.input.placeholder=searchState.input.origPlaceholder});if(browserSupportsHistoryApi()){const previousTitle=document.title;window.addEventListener("popstate",e=>{const params=searchState.getQueryStringParams();document.title=previousTitle;currentResults=null;if(params.search&¶ms.search.length>0){searchState.input.value=params.search;search(e)}else{searchState.input.value="";searchState.hideResults()}})}window.onpageshow=()=>{const qSearch=searchState.getQueryStringParams().search;if(searchState.input.value===""&&qSearch){searchState.input.value=qSearch}search()}}function updateCrate(ev){if(ev.target.value==="all crates"){const query=searchState.input.value.trim();updateSearchHistory(buildUrl(query,null))}currentResults=null;search(undefined,true)}const searchWords=buildIndex(rawSearchIndex);if(typeof window!=="undefined"){registerSearchEvents();if(window.searchState.getQueryStringParams().search){search()}}if(typeof exports!=="undefined"){exports.initSearch=initSearch;exports.execQuery=execQuery;exports.parseQuery=parseQuery}return searchWords}if(typeof window!=="undefined"){window.initSearch=initSearch;if(window.searchIndex!==undefined){initSearch(window.searchIndex)}}else{initSearch({})}})() \ No newline at end of file diff --git a/docs/doc/static.files/settings-74424d7eec62a23e.js b/docs/doc/static.files/settings-74424d7eec62a23e.js deleted file mode 100644 index 3014f75..0000000 --- a/docs/doc/static.files/settings-74424d7eec62a23e.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict";(function(){const isSettingsPage=window.location.pathname.endsWith("/settings.html");function changeSetting(settingName,value){if(settingName==="theme"){const useSystem=value==="system preference"?"true":"false";updateLocalStorage("use-system-theme",useSystem)}updateLocalStorage(settingName,value);switch(settingName){case"theme":case"preferred-dark-theme":case"preferred-light-theme":updateTheme();updateLightAndDark();break;case"line-numbers":if(value===true){window.rustdoc_add_line_numbers_to_examples()}else{window.rustdoc_remove_line_numbers_from_examples()}break}}function showLightAndDark(){removeClass(document.getElementById("preferred-light-theme"),"hidden");removeClass(document.getElementById("preferred-dark-theme"),"hidden")}function hideLightAndDark(){addClass(document.getElementById("preferred-light-theme"),"hidden");addClass(document.getElementById("preferred-dark-theme"),"hidden")}function updateLightAndDark(){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||(useSystem===null&&getSettingValue("theme")===null)){showLightAndDark()}else{hideLightAndDark()}}function setEvents(settingsElement){updateLightAndDark();onEachLazy(settingsElement.querySelectorAll("input[type=\"checkbox\"]"),toggle=>{const settingId=toggle.id;const settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true"}toggle.onchange=()=>{changeSetting(toggle.id,toggle.checked)}});onEachLazy(settingsElement.querySelectorAll("input[type=\"radio\"]"),elem=>{const settingId=elem.name;let settingValue=getSettingValue(settingId);if(settingId==="theme"){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||settingValue===null){settingValue=useSystem==="false"?"light":"system preference"}}if(settingValue!==null&&settingValue!=="null"){elem.checked=settingValue===elem.value}elem.addEventListener("change",ev=>{changeSetting(ev.target.name,ev.target.value)})})}function buildSettingsPageSections(settings){let output="";for(const setting of settings){const js_data_name=setting["js_name"];const setting_name=setting["name"];if(setting["options"]!==undefined){output+=`\ -
-
${setting_name}
-
`;onEach(setting["options"],option=>{const checked=option===setting["default"]?" checked":"";const full=`${js_data_name}-${option.replace(/ /g,"-")}`;output+=`\ - `});output+=`\ -
-
`}else{const checked=setting["default"]===true?" checked":"";output+=`\ -
\ - \ -
`}}return output}function buildSettingsPage(){const theme_names=getVar("themes").split(",").filter(t=>t);theme_names.push("light","dark","ayu");const settings=[{"name":"Theme","js_name":"theme","default":"system preference","options":theme_names.concat("system preference"),},{"name":"Preferred light theme","js_name":"preferred-light-theme","default":"light","options":theme_names,},{"name":"Preferred dark theme","js_name":"preferred-dark-theme","default":"dark","options":theme_names,},{"name":"Auto-hide item contents for large items","js_name":"auto-hide-large-items","default":true,},{"name":"Auto-hide item methods' documentation","js_name":"auto-hide-method-docs","default":false,},{"name":"Auto-hide trait implementation documentation","js_name":"auto-hide-trait-implementations","default":false,},{"name":"Directly go to item in search if there is only one result","js_name":"go-to-only-result","default":false,},{"name":"Show line numbers on code examples","js_name":"line-numbers","default":false,},{"name":"Disable keyboard shortcuts","js_name":"disable-shortcuts","default":false,},];const elementKind=isSettingsPage?"section":"div";const innerHTML=`
${buildSettingsPageSections(settings)}
`;const el=document.createElement(elementKind);el.id="settings";if(!isSettingsPage){el.className="popover"}el.innerHTML=innerHTML;if(isSettingsPage){document.getElementById(MAIN_ID).appendChild(el)}else{el.setAttribute("tabindex","-1");getSettingsButton().appendChild(el)}return el}const settingsMenu=buildSettingsPage();function displaySettings(){settingsMenu.style.display=""}function settingsBlurHandler(event){blurHandler(event,getSettingsButton(),window.hidePopoverMenus)}if(isSettingsPage){getSettingsButton().onclick=event=>{event.preventDefault()}}else{const settingsButton=getSettingsButton();const settingsMenu=document.getElementById("settings");settingsButton.onclick=event=>{if(elemIsInParent(event.target,settingsMenu)){return}event.preventDefault();const shouldDisplaySettings=settingsMenu.style.display==="none";window.hideAllModals();if(shouldDisplaySettings){displaySettings()}};settingsButton.onblur=settingsBlurHandler;settingsButton.querySelector("a").onblur=settingsBlurHandler;onEachLazy(settingsMenu.querySelectorAll("input"),el=>{el.onblur=settingsBlurHandler});settingsMenu.onblur=settingsBlurHandler}setTimeout(()=>{setEvents(settingsMenu);if(!isSettingsPage){displaySettings()}removeClass(getSettingsButton(),"rotate")},0)})() \ No newline at end of file diff --git a/docs/doc/static.files/settings-8c76f75bfb6bd192.css b/docs/doc/static.files/settings-8c76f75bfb6bd192.css deleted file mode 100644 index 5241bb8..0000000 --- a/docs/doc/static.files/settings-8c76f75bfb6bd192.css +++ /dev/null @@ -1,3 +0,0 @@ -.setting-line{margin:1.2em 0.6em;}.setting-radio input,.setting-check input{margin-right:0.3em;height:1.2rem;width:1.2rem;border:2px solid var(--settings-input-border-color);outline:none;-webkit-appearance:none;cursor:pointer;}.setting-radio input{border-radius:50%;}.setting-radio span,.setting-check span{padding-bottom:1px;}.setting-radio{margin-top:0.1em;margin-bottom:0.1em;min-width:3.8em;padding:0.3em;display:inline-flex;align-items:center;cursor:pointer;}.setting-radio+.setting-radio{margin-left:0.5em;}.setting-check{margin-right:20px;display:flex;align-items:center;cursor:pointer;}.setting-radio input:checked{box-shadow:inset 0 0 0 3px var(--main-background-color);background-color:var(--settings-input-color);}.setting-check input:checked{background-color:var(--settings-input-color);border-width:1px;content:url('data:image/svg+xml,\ - \ - ');}.setting-radio input:focus,.setting-check input:focus{box-shadow:0 0 1px 1px var(--settings-input-color);}.setting-radio input:checked:focus{box-shadow:inset 0 0 0 3px var(--main-background-color),0 0 2px 2px var(--settings-input-color);}.setting-radio input:hover,.setting-check input:hover{border-color:var(--settings-input-color) !important;} \ No newline at end of file diff --git a/docs/doc/static.files/src-script-3280b574d94e47b4.js b/docs/doc/static.files/src-script-3280b574d94e47b4.js deleted file mode 100644 index 9ea8892..0000000 --- a/docs/doc/static.files/src-script-3280b574d94e47b4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(function(){const rootPath=getVar("root-path");const NAME_OFFSET=0;const DIRS_OFFSET=1;const FILES_OFFSET=2;const RUSTDOC_MOBILE_BREAKPOINT=700;function closeSidebarIfMobile(){if(window.innerWidth"){addClass(document.documentElement,"src-sidebar-expanded");child.innerText="<";updateLocalStorage("source-sidebar-show","true")}else{removeClass(document.documentElement,"src-sidebar-expanded");child.innerText=">";updateLocalStorage("source-sidebar-show","false")}}function createSidebarToggle(){const sidebarToggle=document.createElement("div");sidebarToggle.id="src-sidebar-toggle";const inner=document.createElement("button");if(getCurrentValue("source-sidebar-show")==="true"){inner.innerText="<"}else{inner.innerText=">"}inner.onclick=toggleSidebar;sidebarToggle.appendChild(inner);return sidebarToggle}function createSrcSidebar(){const container=document.querySelector("nav.sidebar");const sidebarToggle=createSidebarToggle();container.insertBefore(sidebarToggle,container.firstChild);const sidebar=document.createElement("div");sidebar.id="src-sidebar";let hasFoundFile=false;const title=document.createElement("div");title.className="title";title.innerText="Files";sidebar.appendChild(title);Object.keys(srcIndex).forEach(key=>{srcIndex[key][NAME_OFFSET]=key;hasFoundFile=createDirEntry(srcIndex[key],sidebar,"",hasFoundFile)});container.appendChild(sidebar);const selected_elem=sidebar.getElementsByClassName("selected")[0];if(typeof selected_elem!=="undefined"){selected_elem.focus()}}const lineNumbersRegex=/^#?(\d+)(?:-(\d+))?$/;function highlightSrcLines(match){if(typeof match==="undefined"){match=window.location.hash.match(lineNumbersRegex)}if(!match){return}let from=parseInt(match[1],10);let to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to{onEachLazy(e.getElementsByTagName("a"),i_e=>{removeClass(i_e,"line-highlighted")})});for(let i=from;i<=to;++i){elem=document.getElementById(i);if(!elem){break}addClass(elem,"line-highlighted")}}const handleSrcHighlight=(function(){let prev_line_id=0;const set_fragment=name=>{const x=window.scrollX,y=window.scrollY;if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSrcLines()}else{location.replace("#"+name)}window.scrollTo(x,y)};return ev=>{let cur_line_id=parseInt(ev.target.id,10);if(isNaN(cur_line_id)||ev.ctrlKey||ev.altKey||ev.metaKey){return}ev.preventDefault();if(ev.shiftKey&&prev_line_id){if(prev_line_id>cur_line_id){const tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());window.addEventListener("hashchange",()=>{const match=window.location.hash.match(lineNumbersRegex);if(match){return highlightSrcLines(match)}});onEachLazy(document.getElementsByClassName("src-line-numbers"),el=>{el.addEventListener("click",handleSrcHighlight)});highlightSrcLines();window.createSrcSidebar=createSrcSidebar})() \ No newline at end of file diff --git a/docs/doc/static.files/storage-db41da1a38ea3cb8.js b/docs/doc/static.files/storage-db41da1a38ea3cb8.js deleted file mode 100644 index b872813..0000000 --- a/docs/doc/static.files/storage-db41da1a38ea3cb8.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";const darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");const settingsDataset=(function(){const settingsElement=document.getElementById("default-settings");return settingsElement&&settingsElement.dataset?settingsElement.dataset:null})();function getSettingValue(settingName){const current=getCurrentValue(settingName);if(current===null&&settingsDataset!==null){const def=settingsDataset[settingName.replace(/-/g,"_")];if(def!==undefined){return def}}return current}const localStoredTheme=getSettingValue("theme");function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(elem&&elem.classList){elem.classList.add(className)}}function removeClass(elem,className){if(elem&&elem.classList){elem.classList.remove(className)}}function onEach(arr,func,reversed){if(arr&&arr.length>0){if(reversed){for(let i=arr.length-1;i>=0;--i){if(func(arr[i])){return true}}}else{for(const elem of arr){if(func(elem)){return true}}}}return false}function onEachLazy(lazyArray,func,reversed){return onEach(Array.prototype.slice.call(lazyArray),func,reversed)}function updateLocalStorage(name,value){try{window.localStorage.setItem("rustdoc-"+name,value)}catch(e){}}function getCurrentValue(name){try{return window.localStorage.getItem("rustdoc-"+name)}catch(e){return null}}const getVar=(function getVar(name){const el=document.querySelector("head > meta[name='rustdoc-vars']");return el?el.attributes["data-"+name].value:null});function switchTheme(newThemeName,saveTheme){if(saveTheme){updateLocalStorage("theme",newThemeName)}let newHref;if(newThemeName==="light"||newThemeName==="dark"||newThemeName==="ayu"){newHref=getVar("static-root-path")+getVar("theme-"+newThemeName+"-css")}else{newHref=getVar("root-path")+newThemeName+getVar("resource-suffix")+".css"}if(!window.currentTheme){document.write(``);window.currentTheme=document.getElementById("themeStyle")}else if(newHref!==window.currentTheme.href){window.currentTheme.href=newHref}}const updateTheme=(function(){const mql=window.matchMedia("(prefers-color-scheme: dark)");function updateTheme(){if(getSettingValue("use-system-theme")!=="false"){const lightTheme=getSettingValue("preferred-light-theme")||"light";const darkTheme=getSettingValue("preferred-dark-theme")||"dark";updateLocalStorage("use-system-theme","true");switchTheme(mql.matches?darkTheme:lightTheme,true)}else{switchTheme(getSettingValue("theme"),false)}}mql.addEventListener("change",updateTheme);return updateTheme})();if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("preferred-dark-theme",localStoredTheme)}}updateTheme();if(getSettingValue("source-sidebar-show")==="true"){addClass(document.documentElement,"src-sidebar-expanded")}window.addEventListener("pageshow",ev=>{if(ev.persisted){setTimeout(updateTheme,0)}}) \ No newline at end of file diff --git a/docs/doc/static.files/wheel-7b819b6101059cd0.svg b/docs/doc/static.files/wheel-7b819b6101059cd0.svg deleted file mode 100644 index 83c07f6..0000000 --- a/docs/doc/static.files/wheel-7b819b6101059cd0.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file