🪞 Powerful reflection library for Rust

Overview

🪞 mirror-mirror

Powerful reflection library for Rust

Embark Embark Crates.io Docs Git Docs dependency status Build status

🚨 Warning 🚨

This library is still experimental and should not be used for anything serious, yet. It is also not yet published to crates.io.

Contributing

Contributor Covenant

We welcome community contributions to this project.

Please read our Contributor Guide for more information on how to get started. Please also read our Contributor Terms before you make any contributions.

Any contribution intentionally submitted for inclusion in an Embark Studios project, shall comply with the Rust standard licensing model (MIT OR Apache 2.0) and therefore be dual licensed as described below, without any additional terms or conditions:

License

This contribution is dual licensed under EITHER OF

at your option.

For clarity, "your" refers to Embark or any other licensee/user of the contribution.

Comments
  • `#![no_std]` Support

    `#![no_std]` Support

    I was scrolling through the org github and just happened to see this. 😄 I was interested in trying it out in one of my project, and I was wondering if you'd consider adding #![no_std] support? As far as I can tell nearly all of the crate is implemented with types in core and alloc, having it available without std would allow this to be used by a lot more lower level libraries such as codec/serialisation frameworks.

    enhancement 
    opened by XAMPPRocky 2
  • Add basic deny.toml file

    Add basic deny.toml file

    Checklist

    • [x] I have read the Contributor Guide
    • [x] I have read and agree to the Code of Conduct
    • [x] I have added a description of my changes and why I'd like them included in the section below

    Description of Changes

    Adds a basic cargo-deny configuration as well as a CI step to run it on every run.

    opened by bnjbvr 1
  • Add docs to all top level items

    Add docs to all top level items

    This adds high level docs to all top level items. The most relevant sections are on the root module and #[derive(Reflect)].

    Part of https://github.com/EmbarkStudios/mirror-mirror/issues/4

    opened by davidpdrsn 1
  • Add `as_reflect`, `as_reflect_mut`, and `into_reflect` methods

    Add `as_reflect`, `as_reflect_mut`, and `into_reflect` methods

    Checklist

    • [x] I have read the Contributor Guide
    • [x] I have read and agree to the Code of Conduct
    • [x] I have added a description of my changes and why I'd like them included in the section below

    Description of Changes

    I've found these to be useful.

    opened by davidpdrsn 0
  • Misc key path improvements

    Misc key path improvements

    Checklist

    • [x] I have read the Contributor Guide
    • [x] I have read and agree to the Code of Conduct
    • [x] I have added a description of my changes and why I'd like them included in the section below

    Description of Changes

    • Rename some things
    • Iterators
    • Public Key constructors
    opened by davidpdrsn 0
  • Add `default_value` method to all type nodes

    Add `default_value` method to all type nodes

    Checklist

    • [x] I have read the Contributor Guide
    • [x] I have read and agree to the Code of Conduct
    • [x] I have added a description of my changes and why I'd like them included in the section below

    Description of Changes

    Its more consistent when you can call .default_value() on anything.

    opened by davidpdrsn 0
  • Add useful trait impls

    Add useful trait impls

    Checklist

    • [x] I have read the Contributor Guide
    • [x] I have read and agree to the Code of Conduct
    • [x] I have added a description of my changes and why I'd like them included in the section below

    Description of Changes

    Adds

    • impl From<&dyn Reflect> for Value
    • impl ToOwned for dyn Reflect

    which I've found to be useful.

    opened by davidpdrsn 0
  • A way to pass

    A way to pass "context" to `FromReflect`

    We have a use case where it would be useful to pass data into FromReflect which is needed to perform the conversion: We have entity ids encoded as opaque u32s. Before converting a u32 back into an entity id we'd need to check that it actually points to a valid entity, or perhaps do additional checks. Doing that check would require a handle to the system that manages entities. It is currently not possible to pass that into from_reflect and we only get the raw u32.

    We can't simply add a new argument for from_reflect...

    pub trait FromReflect<C: ?Sized>: Reflect + Sized {
        fn from_reflect(reflect: &dyn Reflect, context: &C) -> Option<Self>;
    }
    

    ...since from_reflect called from:

    • Generated code for patching enums
    • [T; N]::clone_reflect
    • EnumValue::patch
    • BTreeMap::insert
    • BTreeMap::remove
    • BTreeMap::clone_reflect
    • Vec::clone_reflect
    • Vec::push
    • "Via scalar" patch

    So we'd have to also pass the new arg to those functions. We also cannot add generic parameters to those functions since Reflect needs to be object safe. Could make Reflect itself generic over the context but thats a large change that'd cause other changes pretty much everywhere.

    Perhaps there is a more elegant solution that wouldn't require changing everything 🤔

    enhancement 
    opened by davidpdrsn 0
  • Investigate making the stack size of `Value` smaller

    Investigate making the stack size of `Value` smaller

    Currently Value has a size of 32 bytes on the stack. Would be worth exploring if there are ways to make it smaller. Perhaps by keeping the larges variants in a separate type that is always boxed, something like Value::BigValue(Box<BigValue>).

    enhancement 
    opened by davidpdrsn 0
  • Support more std types

    Support more std types

    These are the types from std that bevy_reflect supports that we don't. Not sure we have to support all of them but at least worth considering.

    • [ ] Cow<'static, str>
    • [x] Duration
    • [ ] BTreeSet<T>
    • [ ] Instant
    • [x] NonZero*
    • [ ] OsString
    • [ ] PathBuf
    • [x] Range<T>
    • [x] RangeFrom
    • [x] RangeFull
    • [ ] RangeInclusive<T>
    • [x] RangeTo<T>
    • [x] RangeToInclusive<T>
    • [x] Result<T, E>
    • [x] [T; N] - this'll require a new Array trait since List supports pushing elements which [T; N] doesn't.
    opened by davidpdrsn 0
Owner
Embark
The future belongs to the curious
Embark
Estratto is a powerful and user-friendly Rust library designed for extracting rich audio features from digital audio signals.

estratto 〜 An Audio Feature Extraction Library estratto is a powerful and user-friendly Rust library designed for extracting rich audio features from

Amber J Blue 5 Aug 25, 2023
RustVulnsScan is a powerful system vulnerability scanner written in Rust

RustVulnsScan is a powerful system vulnerability scanner written in Rust. It allows you to perform comprehensive scans of your system to identify potential vulnerabilities and security risks.

null 2 Jul 2, 2023
Rustle: a powerful download manager and accelerator written in Rust

Rustle Rustle: a powerful download manager and accelerator written in Rust. Preview Features Resumable Downloads: Allow interrupted downloads to be re

Bishoy Roufael 4 Aug 19, 2023
A fast, powerful, and safe interpreter written in rust!

Kraber A fast, powerful, and safe programming language written in rust! About It packs a punch like the Kraber .50-Cal. Kraber is designed to be minim

Int Fract 3 Mar 24, 2024
⚡️ A blazing fast way of maintaining powerful notes with connections between them.

Zettl ⚡️ A blazing fast way of maintaining powerful notes with connections between them. Installing Zettl To install Zettl, you will need the Rust too

Tirth Jain 26 Dec 2, 2022
A lightweight but incredibly powerful and feature-rich BitTorrent tracker. Supports UDP + HTTP(S) and a private tracker mode.

Torrust Tracker Project Description Torrust Tracker is a lightweight but incredibly powerful and feature-rich BitTorrent tracker made using Rust. Feat

Torrust 162 Dec 31, 2022
Simpler and more powerful replacement for `find`

FindFile (FF) An simple, ergonomic, and powerful replacement for find. Note: this repo is under active development The syntax is (mostly) figured out,

Sam Westerman 4 Jun 20, 2023
Simple yet powerful multi-line text editor widget for tui-rs and ratatui

tui-textarea tui-textarea is a simple yet powerful text editor widget like <textarea> in HTML for tui-rs and ratatui. Multi-line text editor can be ea

Linda_pp 126 Jul 12, 2023
🚀 Blazing fast and Powerful Discord Token Grabber, no popo made with python

Rusty-Grabber ?? a blazing fast Discord Token Grabber, no popo made with python Fastest Token Grabber ever : Rusty-Grabber> time ./target/release/grab

bishop 5 Sep 1, 2023
Rust Imaging Library's Python binding: A performant and high-level image processing library for Python written in Rust

ril-py Rust Imaging Library for Python: Python bindings for ril, a performant and high-level image processing library written in Rust. What's this? Th

Cryptex 13 Dec 6, 2022
This library provides a convenient derive macro for the standard library's std::error::Error trait.

derive(Error) This library provides a convenient derive macro for the standard library's std::error::Error trait. [dependencies] therror = "1.0" Compi

Sebastian Thiel 5 Oct 23, 2023
A readline-like library in Rust.

liner A Rust library offering readline-like functionality. CONTRIBUTING.md Featues Autosuggestions Emacs and Vi keybindings Multi-line editing History

Liam 70 Jun 19, 2022
a Rust library for running child processes

duct.rs Duct is a library for running child processes. Duct makes it easy to build pipelines and redirect IO like a shell. At the same time, Duct help

Jack O'Connor 633 Dec 30, 2022
A command line progress reporting library for Rust

indicatif Documentation A Rust library for indicating progress in command line applications to users. This currently primarily provides progress bars

Armin Ronacher 3.2k Dec 30, 2022
Low-level Rust library for implementing terminal command line interface, like in embedded systems.

Terminal CLI Need to build an interactive command prompt, with commands, properties and with full autocomplete? This is for you. Example, output only

HashMismatch 47 Nov 25, 2022
Rust library for ANSI terminal colours and styles (bold, underline)

rust-ansi-term This is a library for controlling colours and formatting, such as red bold text or blue underlined text, on ANSI terminals. View the Ru

Benjamin Sago 407 Jan 2, 2023
Cross-platform Rust library for coloring and formatting terminal output

Coloring terminal output Documentation term-painter is a cross-platform (i.e. also non-ANSI terminals) Rust library for coloring and formatting termin

Lukas Kalbertodt 75 Jul 28, 2022
A dead simple ANSI terminal color painting library for Rust.

yansi A dead simple ANSI terminal color painting library for Rust. use yansi::Paint; print!("{} light, {} light!", Paint::green("Green"), Paint::red(

Sergio Benitez 169 Dec 25, 2022
Cross platform terminal library rust

Cross-platform Terminal Manipulation Library Crossterm is a pure-rust, terminal manipulation library that makes it possible to write cross-platform te

crossterm-rs 2.1k Jan 2, 2023