Crate gravel_ffi

Crate gravel_ffi 

Source
Expand description

This is the interface library between the main gravel application and individual plugins.

[abi_stable] is used to facilitate safe FFI across compiler versions.

Modules§

logging
Plumbing for using the log crate across FFI-boundaries.
paths
Defines useful functions for working with common paths.
prelude
This module re-exports the types needed to write plugins.

Structs§

HitCache
Container for hits than can be re-used.
PluginConfigAdapter
Abstracts config deserialization from plugins, allowing differing configuration for different plugin instances.
PluginDefinition
Holds metadata and a factory function for a plugin.
PluginLib
[RootModule] for a plugin. It is auto-implemented using the macros.
PluginLibRef
This is the pointer to the prefix of PluginLib.
PluginMetadata
Holds metadata about a plugin.
ProviderResult
A collection of hits returned by a provider.
QueryResult
A Collection of scored hits returned by the FrontendContext.
ScoredHit
Wraps an ArcDynHit with scoring metadata.
SimpleHit
Standard implementation of Hit using closures.
StaticHitCache
Container for unchanging hits.

Enums§

ActionKind
FrontendExitStatus
This is returned when a Frontend exits and tells gravel what to do.
FrontendMessage
Represents actions the Frontend should take.

Constants§

MAX_SCORE
The maximum score a Hit can have.
MIN_SCORE
The minimum score a Hit can have.

Traits§

Frontend
Abstracts functionality required for a frontend.
FrontendContext
Context object providing core functionality to the Frontend.
FrontendContextExt
FrontendInner
This trait is auto-implemented with the crate::gravel_frontend macro.
Hit
This is the trait for hits returned from crate::Providers.
HitActionContext
Abstracts interaction between a hit action and the frontend.
Provider
Abstracts functionality required for a provider.
ProviderInner
This trait is auto-implemented with the crate::gravel_provider macro.

Functions§

clone_hit_arc
Clones an ArcDynHit, as this is not straightforward.

Type Aliases§

ArcDynHit
FFI-safe Hit trait object.
BoxDynFrontend
FFI-safe FrontendInner trait object.
BoxDynFrontendContext
FFI-safe FrontendContext trait object.
BoxDynProvider
FFI-safe ProviderInner trait object.
FrontendExitStatusNe
Non-exhaustive wrapper around FrontendExitStatus.
FrontendMessageNe
Non-exhaustive wrapper around FrontendMessage.
RefDynHitActionContext
FFI-safe reference to a HitActionContext trait object.

Attribute Macros§

gravel_frontend
Automatically implements the necessary FFI-glue for plugins to work.
gravel_provider
Automatically implements the necessary FFI-glue for plugins to work.