Skip to main content

ServiceWrapper

Trait ServiceWrapper 

Source
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§

Required Associated Types§

Required Methods§

Source

fn with_caller<T: Caller>(caller: T) -> Self::Actions<T>

Provided Methods§

Source

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.

Source

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].

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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".

Implementors§

Source§

impl ServiceWrapper for AuthWrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = AuthActions<T>

Source§

impl ServiceWrapper for ServerWrapper

Source§

impl ServiceWrapper for psibase::services::accounts::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::auth_any::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::auth_delegate::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::auth_dyn::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::auth_sig::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::brotli_svc::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::chainmail::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::common_api::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::cpu_limit::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::credentials::service::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::db::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::diff_adjust::Service::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::dyn_ld::service::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::evaluations::Service::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::events::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::fractals::Service::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::guilds::Service::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::http_server::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::invite::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::nft::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::packages::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::producers::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::r_events::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::registry::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::setcode::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::sites::service::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::staged_tx::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::subgroups::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::symbol::Service::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::token_stream::Service::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::token_swap::Service::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::tokens::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::transact::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::verify_sig::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::virtual_server::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::x_admin::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::x_db::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::x_http::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::x_packages::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::x_sites::Wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = Actions<T>

Source§

impl ServiceWrapper for psibase::services::evaluations::Hooks::hooks_wrapper

Source§

impl ServiceWrapper for psibase::services::fractals::Hooks::hooks_wrapper

Source§

impl ServiceWrapper for psibase::services::invite::InviteHooks::hooks_wrapper

Source§

impl ServiceWrapper for int_wrapper

Source§

const SERVICE: AccountNumber = Self::SERVICE

Source§

type Actions<T: Caller> = int_actions<T>

Source§

impl ServiceWrapper for occu_wrapper