Module cargo_auto_lib::public_api_mod
source ·
Expand description
§public_api_mod
The Public API of a library is a pain in the a…
Every time I modify something I have to think how it will affect the users of the library.
They could have tens or hundreds of places where they use the library. Breaking changes are terrible things.
The developers are not willing to change their code every time a library changes slightly.
Yes, there is the semver to show if the new library is API compatible. That helps a lot.
It is dreaded if the first version of a function does not return a Result<>.
Then later we will surely come to the point, that we need to return a Result<>. This is a terrible breaking change.
It is wise to return a Result always. Even when that is not needed right now. It will surely be needed in the future.
Another tactic is to make new functions with a different name and mark the old functions as Obsolete.
This library is used by the automation_tasks_rs executable.
I want to have here the complete and exact definition of the public API.
Therefore I will not use reexports like pub use
or pub mod
.
This way I can always know easily if my public API has changed.
Just compare the public_api_mod.rs
file in git diff.
Adding functions, structs, methods and enums is ok, it does not break the Public API.
But modifying existing functions, methods or enums will break the compatibility.
Re-exports§
-
pub use crate::error_mod::ResultWithLibError;
-
pub use crate::auto_shell_mod::ShellOutput;
-
pub use crate::auto_cargo_toml_mod::CargoToml;
-
pub use crate::auto_shell_mod::ShellCommandLimitedDoubleQuotesSanitizer;
Constants§
-
ANSI color
-
ANSI color
-
ANSI color
-
ANSI color
-
ANSI color
Traits§
-
Trait with methods to read data from Cargo.toml
-
Trait with methods for ShellCommandLimitedDoubleQuotesSanitizer
Functions§
-
Add commit message to Unreleased in RELEASES.md
-
This function includes data from Cargo.toml to markdown files.
-
I want html pages to be correct microXML when I use them for single page application.
-
deletes old js snippets when working with wasm-pack
-
Pretty HTML for docs
-
This function inserts shield badges with lines_of_code into README.rs.
-
Finds rs files with markers and include segments from md files as doc comments
-
process plantuml in current directory
-
Process plantuml for all md files
-
Include the link to run code in Rust playground
-
Increment the minor version in Cargo.toml file only if files are changed
-
Increment the minor version in Cargo.toml file even if files are not changed
-
Increment the patch version in Cargo.toml file only if files are changed
-
Increment the patch version in Cargo.toml file even if files are not changed
-
New version from date is written to Cargo.toml and service_worker.js
-
Just like auto_version_from_date(), but force the new version even if no files are changed.
-
Increment the version in Cargo.toml
-
Increment the version in Cargo.toml
-
Get release text from RELEASES.md
-
println one, more or all sub_commands
-
The original
concat()
function does not have a delimiter -
Copy all files from the folder into a module as strings (static &str)
-
Create a new Version title in RELEASES.md
-
Check if the code was run inside the Rust project root directory.
-
find from_pos
-
return the position of end of the delimited data before the delimiter
-
return the position of start of the delimited data after the delimiter
-
Has git remote
-
Check if this folder is a local Git repository
-
sync, check, create, push git tag
-
Hash text
-
home_dir() using the home crate.
-
Interactive ask to create a new local git repository
-
UTC date in iso standard like 2024-12-31
-
Run one shell command
-
Run one shell command and return ShellOutput {exit_status, stdout, stderr}
-
Run one shell command with static str
-
Run one shell command and return true if success
-
Traverse dir and its sub-dir, but avoid excluded dirs.