# fromSchemaEncode

Creates a Guard that encodes a schema's Type to its Encoded representation.

## Signatures

```ts
export declare function fromSchemaEncode<S extends Schema.Top>(schema: S): Guard<S["Type"], S["Encoded"], Schema.SchemaError, S["EncodingServices"]>;
```

## Why

Schema encoding is the reverse direction of decoding and keeps encoding services and `SchemaError` visible in the Guard type.

## Ownership and lifetime

Construction acquires no resources; schema services and any scoped work follow each returned Effect invocation.

## Examples

```ts
import { fromSchemaEncode } from "@typed/guard"
import { Schema } from "effect"
const encoded = fromSchemaEncode(Schema.NumberFromString)
```
