pub trait ServiceWrapper {
type Actions<T: Caller>;
const SERVICE: AccountNumber;
// Required method
fn with_caller<T: Caller>(caller: T) -> Self::Actions<T>;
// Provided methods
fn call() -> Self::Actions<ServiceCaller> { ... }
fn call_to(service: AccountNumber) -> Self::Actions<ServiceCaller> { ... }
fn call_from(sender: AccountNumber) -> Self::Actions<ServiceCaller> { ... }
fn call_from_to(
sender: AccountNumber,
service: AccountNumber,
) -> Self::Actions<ServiceCaller> { ... }
fn call_as(sender: AccountNumber) -> Self::Actions<RunAsCaller> { ... }
fn call_as_extend(
sender: AccountNumber,
allowed_actions: Vec<ServiceMethod>,
) -> Self::Actions<RunAsCaller> { ... }
fn rpc() -> Self::Actions<ServiceCaller> { ... }
fn pack() -> Self::Actions<ActionPacker> { ... }
fn pack_to(service: AccountNumber) -> Self::Actions<ActionPacker> { ... }
fn pack_from(sender: AccountNumber) -> Self::Actions<ActionPacker> { ... }
fn pack_from_to(
sender: AccountNumber,
service: AccountNumber,
) -> Self::Actions<ActionPacker> { ... }
}Required Associated Constants§
const SERVICE: AccountNumber
Required Associated Types§
Required Methods§
fn with_caller<T: Caller>(caller: T) -> Self::Actions<T>
Provided Methods§
Sourcefn call() -> Self::Actions<ServiceCaller>
fn call() -> Self::Actions<ServiceCaller>
Call another service.
This method returns an object which has methods (one per action) which call another service and return the result from the call. This method is only usable by services.
This method defaults sender to [psibase::get_sender] and service to Self::SERVICE.
Sourcefn call_to(service: AccountNumber) -> Self::Actions<ServiceCaller>
fn call_to(service: AccountNumber) -> Self::Actions<ServiceCaller>
Call another service.
This method returns an object which has methods (one per action) which call another service and return the result from the call. This method is only usable by services.
This method defaults sender to [psibase::get_sender].
Sourcefn call_from(sender: AccountNumber) -> Self::Actions<ServiceCaller>
fn call_from(sender: AccountNumber) -> Self::Actions<ServiceCaller>
Call another service.
This method returns an object which has methods (one per action) which call another service and return the result from the call. This method is only usable by services.
This method defaults service to Self::SERVICE.
Sourcefn call_from_to(
sender: AccountNumber,
service: AccountNumber,
) -> Self::Actions<ServiceCaller>
fn call_from_to( sender: AccountNumber, service: AccountNumber, ) -> Self::Actions<ServiceCaller>
Call another service.
This method returns an object which has methods (one per action) which call another service and return the result from the call. This method is only usable by services.
Sourcefn call_as(sender: AccountNumber) -> Self::Actions<RunAsCaller>
fn call_as(sender: AccountNumber) -> Self::Actions<RunAsCaller>
Call another service using runAs.
This method returns an object which has methods
(one per action) which call another service via runAs and return the result from the call.
The action will run with sender set to the provided account and service to Self::SERVICE.
This will fail unless certain conditions are met. See runAs documentation for more details.
Sourcefn call_as_extend(
sender: AccountNumber,
allowed_actions: Vec<ServiceMethod>,
) -> Self::Actions<RunAsCaller>
fn call_as_extend( sender: AccountNumber, allowed_actions: Vec<ServiceMethod>, ) -> Self::Actions<RunAsCaller>
Call another service using runAs.
This method returns an object which has methods
(one per action) which call another service via runAs and return the result from the call.
The action will run with sender set to the provided account and service to Self::SERVICE.
This will fail unless certain conditions are met. See runAs documentation for more details.
This method also accepts allowedActions for nested runAs calls.
Sourcefn rpc() -> Self::Actions<ServiceCaller>
fn rpc() -> Self::Actions<ServiceCaller>
Call another service in RPC mode.
This method returns an object which has methods (one per action) which call another service and return the result from the call. This method is only usable by services.
This method defaults sender to [psibase::get_sender] and service to Self::SERVICE.
Sourcefn pack() -> Self::Actions<ActionPacker>
fn pack() -> Self::Actions<ActionPacker>
Pack actions into psibase::Action.
This method returns an object which has methods
(one per action) which pack the action’s arguments using fracpack and
return a psibase::Action. The pack_* series of
functions is mainly useful to applications which push transactions
to blockchains.
This method defaults both sender and service to Self::SERVICE.
Sourcefn pack_to(service: AccountNumber) -> Self::Actions<ActionPacker>
fn pack_to(service: AccountNumber) -> Self::Actions<ActionPacker>
Pack actions into psibase::Action.
This method returns an object which has methods
(one per action) which pack the action’s arguments using fracpack and
return a psibase::Action. The pack_* series of
functions is mainly useful to applications which push transactions
to blockchains.
This method defaults sender to Self::SERVICE.
Sourcefn pack_from(sender: AccountNumber) -> Self::Actions<ActionPacker>
fn pack_from(sender: AccountNumber) -> Self::Actions<ActionPacker>
Pack actions into psibase::Action.
This method returns an object which has methods
(one per action) which pack the action’s arguments using fracpack and
return a psibase::Action. The pack_* series of
functions is mainly useful to applications which push transactions
to blockchains.
This method defaults service to Self::SERVICE.
Sourcefn pack_from_to(
sender: AccountNumber,
service: AccountNumber,
) -> Self::Actions<ActionPacker>
fn pack_from_to( sender: AccountNumber, service: AccountNumber, ) -> Self::Actions<ActionPacker>
Pack actions into psibase::Action.
This method returns an object which has methods
(one per action) which pack the action’s arguments using fracpack and
return a psibase::Action. The pack_* series of
functions is mainly useful to applications which push transactions
to blockchains.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".