You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was looking into this crate, primarily because i'm working with an API that is under some amount of tension due to crate boundaries.
We have what I will call a "tool_api", and a "user_api". Where the user api contains 99% of the things that a user actually needs to call,
and the tool api contains the other 501% of the code. The user api, is generally built on top of and calls into the tool API using default values, low-level constructors that the high-level constructors need to call even if the feature is disabled. None the less these API's overlap in both types, and impls. If that wasn't a concern with crate separation most of the tool API wouldn't actually need or want to be pub. That we currently don't separate these via features makes it difficult for end-users to find the calls they should be aiming to use, making the user_api seem much more complex than it actually is.
I was thinking about using something like 'mod { pub ... }' which seemed like it would work, but make everything ugly regarding Self. But found this crate instead, which looks like a much nicer alternative.
Before I jump into this kind of large breaking change/refactor I wanted to ask, if anyone had experience reports regarding what worked or didn't work out.
Unforseen problems they ran into/limitations they had to work around. There are a few things that I assume, like I probably want to set up CI/Docs to be built both ways with the feature enabled/disabled. But the instability of https://doc.rust-lang.org/beta/unstable-book/language-features/doc-cfg.html makes it seem like it could be difficult to keep code-snippets from commingling.
Anyhow, this is long enough, but I'm curious how everybody's general experience has been using this crate.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I was looking into this crate, primarily because i'm working with an API that is under some amount of tension due to crate boundaries.
We have what I will call a "tool_api", and a "user_api". Where the user api contains 99% of the things that a user actually needs to call,
and the tool api contains the other 501% of the code. The user api, is generally built on top of and calls into the tool API using default values, low-level constructors that the high-level constructors need to call even if the feature is disabled. None the less these API's overlap in both types, and impls. If that wasn't a concern with crate separation most of the tool API wouldn't actually need or want to be
pub
. That we currently don't separate these via features makes it difficult for end-users to find the calls they should be aiming to use, making the user_api seem much more complex than it actually is.I was thinking about using something like 'mod { pub ... }' which seemed like it would work, but make everything ugly regarding
Self
. But found this crate instead, which looks like a much nicer alternative.Before I jump into this kind of large breaking change/refactor I wanted to ask, if anyone had experience reports regarding what worked or didn't work out.
Unforseen problems they ran into/limitations they had to work around. There are a few things that I assume, like I probably want to set up CI/Docs to be built both ways with the feature enabled/disabled. But the instability of https://doc.rust-lang.org/beta/unstable-book/language-features/doc-cfg.html makes it seem like it could be difficult to keep code-snippets from commingling.
Anyhow, this is long enough, but I'm curious how everybody's general experience has been using this crate.
Beta Was this translation helpful? Give feedback.
All reactions