Package: effect
Module: Schema
Encodes a typed input (the schema’s Type) against a schema, returning an
Effect that succeeds with the encoded value or fails with a
SchemaError.
When to use
Use when you need to encode input already typed as the schema’s Type in
an Effect whose failure channel is SchemaError.
Details
For unknown input use encodeUnknownEffect.
Options may be provided either when creating the encoder or when applying it;
application options override creation options.
See
SchemaParser.encodeEffect for the adapter that fails with SchemaIssue.Issue directlySignature
declare const encodeEffect: <S extends Constraint>(schema: S, options?: SchemaAST.ParseOptions) => (input: S["Type"], options?: SchemaAST.ParseOptions) => Effect.Effect<S["Encoded"], SchemaError, S["EncodingServices"]>
Since v4.0.0