heros.inspect
=============

.. py:module:: heros.inspect


Attributes
----------

.. autoapisummary::

   heros.inspect.HERO_EVENT_ATTRIBUTE
   heros.inspect.HERO_METHOD_ATTRIBUTE
   heros.inspect.LOCAL_ONLY_ATTRIBUTE
   heros.inspect.FORCE_REMOTE_ATTRIBUTE
   heros.inspect.local_only
   heros.inspect.force_remote


Functions
---------

.. autoapisummary::

   heros.inspect._mark
   heros.inspect._is_marked
   heros.inspect.mark_hero_event
   heros.inspect.mark_hero_method
   heros.inspect.mark_local_only
   heros.inspect.mark_force_remote
   heros.inspect.is_hero_event
   heros.inspect.is_hero_method
   heros.inspect.is_local_only
   heros.inspect.is_force_remote


Module Contents
---------------

.. py:data:: HERO_EVENT_ATTRIBUTE
   :value: 'hero_event'


.. py:data:: HERO_METHOD_ATTRIBUTE
   :value: 'hero_method'


.. py:data:: LOCAL_ONLY_ATTRIBUTE
   :value: 'local_only'


.. py:data:: FORCE_REMOTE_ATTRIBUTE
   :value: 'force_remote'


.. py:function:: _mark(func: callable, marker: str) -> callable

   Mark a callable with a provided marker.

   :param func: callable to mark
   :param marker: attribute name at which to mark the callable

   :returns: The marked callable.


.. py:function:: _is_marked(func: callable, marker: str) -> bool

   Inspect if a callable is marked with a provided marker.

   :param func: callable to check
   :param marker: attribute name of the attribute to check

   :returns: The value of the marker.
             `False` if the marker is not present.


.. py:function:: mark_hero_event(func: callable) -> callable

   Mark a callable as a event.

   :param func: callable to mark

   :returns: The marked callable.


.. py:function:: mark_hero_method(func: callable) -> callable

   Mark a callable as a method of a (remote) hero.

   :param func: callable to mark

   :returns: The marked callable.


.. py:function:: mark_local_only(func: callable) -> callable

   Mark a callable is local only.

   :param func: callable to mark

   :returns: The marked callable.


.. py:data:: local_only

.. py:function:: mark_force_remote(func: callable) -> callable

   Mark a callable as force remote.

   :param func: callable to mark

   :returns: The marked callable.


.. py:data:: force_remote

.. py:function:: is_hero_event(func: callable) -> bool

   Check if a callable is a event.

   :param func: callable to check

   :returns: The value of the marker.
             `False` if the marker is not present.


.. py:function:: is_hero_method(func: callable) -> bool

   Check if a callable is a method of a (remote) hero.

   :param func: callable to check

   :returns: The value of the marker.
             `False` if the marker is not present.


.. py:function:: is_local_only(func: callable) -> bool

   Check if a callable is a local only.

   :param func: callable to check

   :returns: The value of the marker.
             `False` if the marker is not present.


.. py:function:: is_force_remote(func: callable) -> bool

   Check if a callable is a force remote.

   :param func: callable to check

   :returns: The value of the marker.
             `False` if the marker is not present.


