07-private-methods
Directory actions
More options
Directory actions
More options
07-private-methods
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
example-07-private-methods
==========================
Defines `Speak` twice: once on `AnimalClass` (the inherited fall-back)
and once on `DogClass` (the override). When the program asks the runtime
to send `Speak` to a dog, the dog's override wins; sending it to a cat
falls through to the inherited animal sound.
Build / run / clean
-------------------
Run any of these from this directory:
make build
make run
make clean
Equivalent cargo commands from the workspace root (Dynace-RS/):
cargo build -p example-07-private-methods
cargo run -p example-07-private-methods
cargo clean -p example-07-private-methods
The built executable
--------------------
After a build, the standalone binary lives at:
<workspace-root>/target/debug/example-07-private-methods
(or `target/release/...` if built with `cargo build --release`). It's a
normal native executable that links only to libc and libgcc_s, so you can
copy or move it anywhere on a compatible system and run it directly.
Using this as a starter project
-------------------------------
This directory is self-contained — you can copy it anywhere on your
machine and use it as the seed for your own application:
cp -r <Dynace-RS>/examples/07-private-methods ~/my-app
Then open the copied `Cargo.toml` and adjust the `dynace` dependency
path to point at wherever Dynace-RS lives on your system, e.g.:
dynace = { path = "/abs/path/to/Dynace-RS/crates/dynace" }
dynace = { git = "https://github.com/your-user/Dynace-RS.git" }
After that, `make build` / `make run` / `make clean` work as usual,
and the resulting binary lands in `target/debug/...` of your copied
project.