dynamic_reload | Dynamic reloading of shared libraries

 by   emoon Rust Version: v0.2.0 License: Apache-2.0

kandi X-RAY | dynamic_reload Summary

kandi X-RAY | dynamic_reload Summary

dynamic_reload is a Rust library. dynamic_reload has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

dynamic_reload is a cross platform library written in Rust that makes it easier to do reloading of shared libraries (dll:s on windows, .so on *nix, .dylib on Mac, etc). The intended use is to allow applications to reload code on the fly without closing down the application when some code changes. This can be seen as a lite version of "live" coding for Rust. It's worth to mention here that reloading of shared libraries isn't limited to libraries written in Rust but can be done in any language that can target shared libraries. A typical scenario can look like this:. dynamic_reload library will not try to solve any stale data hanging around in Foo from Bar. It is up to Foo to make sure all data has been cleaned up before Foo is reloaded. Foo will be getting a callback from dynamic_reload before Bar is reloaded and that allows Foo to take needed action. Then another call will be made after Bar has been reloaded to allow Foo to restore state for Bar if needed.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              dynamic_reload has a low active ecosystem.
              It has 343 star(s) with 21 fork(s). There are 8 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 5 open issues and 8 have been closed. On average issues are closed in 498 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of dynamic_reload is v0.2.0

            kandi-Quality Quality

              dynamic_reload has no bugs reported.

            kandi-Security Security

              dynamic_reload has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              dynamic_reload is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              dynamic_reload releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of dynamic_reload
            Get all kandi verified functions for this library.

            dynamic_reload Key Features

            No Key Features are available at this moment for dynamic_reload.

            dynamic_reload Examples and Code Snippets

            No Code Snippets are available at this moment for dynamic_reload.

            Community Discussions

            QUESTION

            How to store a reference without having to deal with lifetimes?
            Asked 2018-Mar-15 at 15:43

            As suggested by the dynamic_reload crate's example, I collected Symbols instead of extracting them every time, but Symbol requires a lifetime. Using a lifetime changes method signatures and breaks the compatibility with method DynamicReload::update.

            Is it a valid workaround to use std::mem::transmute to change Symbol's lifetime to 'static?

            ...

            ANSWER

            Answered 2018-Mar-15 at 15:43

            How to store a reference without having to deal with lifetimes?

            The answer in 98% of the cases is: you don't. Lifetimes are one of the biggest reasons to use Rust. Lifetimes enforce, at compile time, that your references will always refer to something that is valid. If you wish to "ignore" lifetimes, then perhaps Rust may not the best language to realize a particular design. You may need to pick a different language or design.

            Is it a valid workaround to use std::mem::transmute to change Symbol's lifetime to 'static?

            transmute is The Big Hammer, suitable for all sorts of good and bad ideas and implementations. I would encourage never using it directly, but instead wrapping it in a layer of abstraction that somehow helps you enforce the appropriate restrictions that make that particular transmute correct.

            If you choose to use transmute, you are assuming the full responsibility that the compiler previously had. It will be up to you to ensure that the reference is always valid, otherwise you are invoking undefined behavior and your program is allowed to do any number of Very Bad things.

            For your specific case, you may be able to use the Rental crate to keep around "the library" and "references into the library" in a single struct that hides the lifetimes of the Symbols. In fact, Rental uses libloading as the motivating example and libloading powers dynamic_reload. See Why can't I store a value and a reference to that value in the same struct? for more details and pitfalls.

            I'm not optimistic that this will work because DynamicReload::update requires a &mut self. During that method call, it could easily invalidate all of the existing references.

            See also:

            Source https://stackoverflow.com/questions/49300618

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install dynamic_reload

            You can download it from GitHub.
            Rust is installed and managed by the rustup tool. Rust has a 6-week rapid release process and supports a great number of platforms, so there are many builds of Rust available at any time. Please refer rust-lang.org for more information.

            Support

            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.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/emoon/dynamic_reload.git

          • CLI

            gh repo clone emoon/dynamic_reload

          • sshUrl

            git@github.com:emoon/dynamic_reload.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link