"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-05 22:51:52.474065
"""

```python
from typing import Callable, Any


class FallbackExecutor:
    """
    A class that encapsulates a main function and its fallbacks.
    
    This allows for executing tasks with an option to switch to a backup plan in case of errors.
    """

    def __init__(self, primary_function: Callable[[], Any], *fallback_functions: Callable[[], Any]):
        """
        Initialize the FallbackExecutor.

        :param primary_function: The main function to execute first.
        :param fallback_functions: A sequence of functions that can be used as fallbacks if the primary fails.
        """
        self.primary_function = primary_function
        self.fallback_functions = list(fallback_functions)

    def run(self) -> Any:
        """
        Run the primary function. If it raises an exception, attempt to run a fallback.

        :return: The result of the executed function or None if no valid fallback is available.
        """
        try:
            return self.primary_function()
        except Exception as e:
            print(f"Primary function failed with error: {e}")
            for fallback in self.fallback_functions:
                try:
                    return fallback()
                except Exception as ef:
                    print(f"Fallback function failed with error: {ef}")
            print("All fallbacks exhausted.")
            return None


# Example usage
def main_function() -> str:
    """
    A sample main function that might fail.
    """
    raise ValueError("Main function error occurred.")

def backup_function1() -> str:
    """
    First fallback function.
    """
    return "Fallback 1 used."

def backup_function2() -> str:
    """
    Second fallback function.
    """
    return "Fallback 2 used."

if __name__ == "__main__":
    executor = FallbackExecutor(main_function, backup_function1, backup_function2)
    result = executor.run()
    print(f"Result: {result}")
```

This code defines a `FallbackExecutor` class that wraps around a main function and any number of fallback functions. It attempts to run the primary function first and switches to a fallback if an exception occurs during execution. An example usage scenario is provided at the bottom, demonstrating how to create instances of this class and handle potential errors in Python code.