pub trait Access {
// Required methods
fn immut_access(&self) -> ImmutAccess<'_>;
fn mut_access(&mut self) -> MutAccess<'_>;
// Provided methods
fn immut_call<'a>(
&self,
_func_name: &'static str,
_climber: &mut Climber<'a>,
_retcall: RetValCallback<'a>,
) -> Result<(), CallError> { ... }
fn mut_call<'a>(
&mut self,
_func_name: &'static str,
_climber: &mut Climber<'a>,
_retcall: RetValCallback<'a>,
) -> Result<(), CallError> { ... }
fn mut_assign<'a, 'b>(
&mut self,
_tokens: &mut Tracker<'a, 'b>,
_probe_only: bool,
) -> Result<(), AssignError> { ... }
}Expand description
The Access trait, meant to be used as a trait object, provides methods that
dynamically expose read&write access to the underlying objects.
Required Methods§
Sourcefn immut_access(&self) -> ImmutAccess<'_>
fn immut_access(&self) -> ImmutAccess<'_>
Expose an immmutable accessor, used when Access is immutable or mutable.
Sourcefn mut_access(&mut self) -> MutAccess<'_>
fn mut_access(&mut self) -> MutAccess<'_>
Expose a mutable accessor, used when Access is mutable.
Provided Methods§
Sourcefn immut_call<'a>(
&self,
_func_name: &'static str,
_climber: &mut Climber<'a>,
_retcall: RetValCallback<'a>,
) -> Result<(), CallError>
fn immut_call<'a>( &self, _func_name: &'static str, _climber: &mut Climber<'a>, _retcall: RetValCallback<'a>, ) -> Result<(), CallError>
Perform an optional method call for a certain function, with the return value provided to the callback. The arguments are parsed from the Token tracker in the Climber parameter.
Depending on the state of the Climber, we may just parsing the arguments not not actually calling the function, in order to provide user feedback.
Sourcefn mut_call<'a>(
&mut self,
_func_name: &'static str,
_climber: &mut Climber<'a>,
_retcall: RetValCallback<'a>,
) -> Result<(), CallError>
fn mut_call<'a>( &mut self, _func_name: &'static str, _climber: &mut Climber<'a>, _retcall: RetValCallback<'a>, ) -> Result<(), CallError>
Perform an optional method call for a certain function which may modify the underlying value, with the return value provided to the callback. The arguments are parsed from the Token tracker in the Climber parameter.
Depending on the state of the Climber, we may just parsing the arguments not not actually calling the function, in order to provide user feedback.
Sourcefn mut_assign<'a, 'b>(
&mut self,
_tokens: &mut Tracker<'a, 'b>,
_probe_only: bool,
) -> Result<(), AssignError>
fn mut_assign<'a, 'b>( &mut self, _tokens: &mut Tracker<'a, 'b>, _probe_only: bool, ) -> Result<(), AssignError>
Assign a new value to this object. probe_only determines whether the implementation would
only parse the new value and not actually assign it. This is in order to provide user
feedback for the parsing bits.