ServerFunction<I, O> class
final
One server-only RPC implementation.
Constructors
-
ServerFunction({required ServerFunctionHandler<
I, O> handler, String? id, ValueDecoder<I> ? decodeInput, HttpMethod method = HttpMethod.post, Iterable<Middleware> middleware = const <Middleware>[]}) - Creates a server function and its invocation policy.
Properties
-
decodeInput
→ ValueDecoder<
I> ? -
Optional decoder for function input.
final
-
handler
→ ServerFunctionHandler<
I, O> -
User implementation invoked for each request.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String?
-
Optional stable wire identifier consumed by the file-route compiler.
final
- method → HttpMethod
-
HTTP method accepted by this function.
final
-
middleware
→ List<
Middleware> -
Middleware applied before handler.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
execute(
Object? data, RequestContext request, String id, {ValueDecoder< Object?> ? generatedDecoder}) → FutureOr<Object?> -
Decodes
dataand invokes handler. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited