baml.glob.Glob

A compiled glob pattern. Create one with `baml.glob.new(pattern)`.

Reference version

Signature

class baml.glob.Glob

A compiled glob pattern. Create one with baml.glob.new(pattern).

Source:<builtin>/baml/ns_glob/glob.bamlbytes 602–1226

Fields

_handle

$rust_type

Instance methods

function

matches

(self, path: string) -> bool throws never

Returns true if path matches this glob pattern.

Pure pattern matching against the already-compiled pattern — it touches no filesystem, so there is nothing for it to throw.

function

scan

(self, root: string | baml.glob.ScanOptions) -> string[] throws baml.errors.Io

Scans the filesystem and returns all paths matching this glob pattern. Pass a string root path or a ScanOptions object for more control.

Implementations

baml.Concrete for T

Source:<builtin>/baml/core.bamlbytes 763–795