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
… with ascent v0.7.0 generates (and in the case of ascent! { … } exposes!) a program type with the following signature (as obtained by use of cargo expand):
Other than edge and path none of these fields should be marked pub as all other fields are implementation details, turning AscentProgram into what effectively is a massively leaky abstraction and a violation of encapsulation.
None of those fields should actually have to be declared pub for AscentProgram to work, afaict.
As such rather than exposing most of its internal fields as pub only the fields corresponding to user-defined relations should be exposed via pub:
This change would prevent the user from messing with the wrong parts of AscentProgram and significantly reduce the type's API surface (in the case of the fields of this particular dummy program the surface shrinks from 13 mostly irrelevant to just 2 actually relevant fields), while guiding the user to the appropriate fields much more clearly.
The text was updated successfully, but these errors were encountered:
Compiling an
ascent! { … }
program with relationsedge
andpath
…Program's full code snippet
… with ascent v0.7.0 generates (and in the case of
ascent! { … }
exposes!) a program type with the following signature (as obtained by use ofcargo expand
):Other than
edge
andpath
none of these fields should be markedpub
as all other fields are implementation details, turningAscentProgram
into what effectively is a massively leaky abstraction and a violation of encapsulation.None of those fields should actually have to be declared
pub
forAscentProgram
to work, afaict.As such rather than exposing most of its internal fields as
pub
only the fields corresponding to user-defined relations should be exposed viapub
:This change would prevent the user from messing with the wrong parts of
AscentProgram
and significantly reduce the type's API surface (in the case of the fields of this particular dummy program the surface shrinks from 13 mostly irrelevant to just 2 actually relevant fields), while guiding the user to the appropriate fields much more clearly.The text was updated successfully, but these errors were encountered: