Skip to main content

Platform

Struct Platform 

Source
pub struct Platform { /* private fields */ }
Expand description

The service registry: route name → manager + worker pool. Cheap to clone.

Implementations§

Source§

impl Platform

Source

pub fn new() -> Self

Source

pub fn get_instance() -> Platform

The process-wide platform (Java Platform.getInstance()), created on first use. Platform::new() remains available for isolated registries (tests); the lifecycle (AppStarter) uses this shared one.

Source

pub fn name() -> String

The application name (Java platform.getName()): application.name, else application — Java’s primary key and default. The Java spring.application.name fallback is retired with the other Spring names (maintainer decision, 2026-07-19; Spring is not ported).

Source

pub fn origin() -> &'static str

This process’s unique origin id (Java platform.getOrigin(), simplified: a uuid per process; Java’s optional appId derivation is not ported until something needs it).

Source

pub fn register( &self, route: &str, function: Arc<dyn ComposableFunction>, instances: usize, ) -> Result<(), AppError>

Register a function at a route with instances concurrent workers (Java platform.register(route, lambda, instances)).

Source

pub fn register_private( &self, route: &str, function: Arc<dyn ComposableFunction>, instances: usize, ) -> Result<(), AppError>

Register a PRIVATE function (Java platform.registerPrivate): callable only inside this application instance — Event over HTTP rejects it with 403. Engine internals register this way (increment 60).

Source

pub fn is_private(&self, route: &str) -> Option<bool>

Whether a registered route is private (Java ServiceDef.isPrivateFunction); None when the route is not registered.

Source

pub fn register_with_options( &self, route: &str, function: Arc<dyn ComposableFunction>, instances: usize, options: FunctionOptions, ) -> Result<(), AppError>

Register with explicit options (increment E-3 extends the increment-10 zero-trace flag with the event-interceptor mode).

Source

pub fn has_route(&self, route: &str) -> bool

True when the route is registered locally (Java hasRoute).

Source

pub fn release(&self, route: &str) -> bool

Release a route (Java release): signals the manager to stop; workers exit as their channels close; the elastic queue is destroyed. Returns whether the route existed.

Source

pub fn register_route_pool( &self, prefix: &str, function: Arc<dyn ComposableFunction>, count: usize, ) -> Result<Vec<String>, AppError>

Register a route pool — a set of private singleton routes {prefix}.{n} for n = 0 to count-1 (Java Platform.registerRoutePool). Each member runs with one worker, so it is a strict FIFO lane; a caller may check out a lane for exclusive use to preserve event order while other lanes serve concurrent traffic. One function instance is shared across all members — it must be stateless, the same contract as a multi-instance function.

Registering an existing pool RELOADS it: the previous member set is released first, with a warning in the application log. This API covers registration only — lane checkout and return are the caller’s concern. Route pools are always private.

Source

pub fn release_route_pool(&self, prefix: &str) -> bool

Release a route pool — removes all its members and the pool itself (Java Platform.releaseRoutePool). Returns whether the pool existed.

Source

pub fn routes(&self) -> Vec<String>

Registered route names (sorted, for stable output).

Source

pub fn instances(&self, route: &str) -> Option<usize>

Worker count for a route, if registered.

Trait Implementations§

Source§

impl Clone for Platform

Source§

fn clone(&self) -> Platform

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Platform

Source§

fn default() -> Platform

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V