gleamrpc
Types
pub type GleamRPCError(error) {
GleamRPCError(error: error)
}
Constructors
-
GleamRPCError(error: error)
pub type Procedure(params, return) {
Procedure(
name: String,
router: option.Option(Router),
type_: ProcedureType,
params_type: convert.Converter(params),
return_type: convert.Converter(return),
)
}
Constructors
-
Procedure( name: String, router: option.Option(Router), type_: ProcedureType, params_type: convert.Converter(params), return_type: convert.Converter(return), )
pub type ProcedureCall(params, return, error, d) {
ProcedureCall(
procedure: Procedure(params, return),
server: ProcedureClient(params, return, error, d),
)
}
Constructors
-
ProcedureCall( procedure: Procedure(params, return), server: ProcedureClient(params, return, error, d), )
pub type ProcedureClient(params, return, error, d) {
ProcedureClient(
call: fn(
Procedure(params, return),
params,
fn(Result(return, GleamRPCError(error))) -> d,
) ->
d,
)
}
Constructors
-
ProcedureClient( call: fn( Procedure(params, return), params, fn(Result(return, GleamRPCError(error))) -> d, ) -> d, )
pub type ProcedureType {
Query
Mutation
}
Constructors
-
Query
-
Mutation
Functions
pub fn call(
procedure_call: ProcedureCall(a, b, c, d),
params: a,
callback: fn(Result(b, GleamRPCError(c))) -> d,
) -> d
pub fn params(
procedure: Procedure(a, b),
params_converter: Converter(a),
) -> Procedure(a, b)
pub fn returns(
procedure: Procedure(a, b),
return_converter: Converter(b),
) -> Procedure(a, b)
pub fn with_client(
procedure: Procedure(a, b),
server: ProcedureClient(a, b, c, d),
) -> ProcedureCall(a, b, c, d)