pub struct Project {
pub package_name: String,
pub package_root: PathBuf,
pub workspace_root: PathBuf,
pub bin_names: Vec<String>,
pub has_lib: bool,
pub config: Config,
pub features: Features,
}Expand description
The Cargo package the CLI operates on, plus its Toasty configuration.
All migration files live under the package’s directory (Toasty.toml,
toasty/), so workspace members keep independent migration histories.
Fields§
§package_name: StringName of the selected package.
package_root: PathBufDirectory containing the package’s Cargo.toml.
workspace_root: PathBufThe workspace root directory.
bin_names: Vec<String>Bin target names declared by the package.
has_lib: boolWhether the package has a lib target.
config: ConfigConfiguration loaded from the package’s Toasty.toml (or defaults).
features: FeaturesCargo feature selection, applied to the schema build.
Implementations§
Source§impl Project
impl Project
Sourcepub fn locate(package: Option<&str>, features: Features) -> Result<Self>
pub fn locate(package: Option<&str>, features: Features) -> Result<Self>
Locates the target package via cargo metadata and loads its
configuration.
Sourcepub fn build_target(&self, bin: Option<&str>) -> Result<BuildTarget>
pub fn build_target(&self, bin: Option<&str>) -> Result<BuildTarget>
Picks the artifact to build for schema extraction.
A bin target is preferred; lib-only packages fall back to building the
lib as a cdylib. bin selects among multiple bin targets.
Sourcepub fn migrations_dir(&self) -> PathBuf
pub fn migrations_dir(&self) -> PathBuf
Directory holding generated migration SQL files.
Sourcepub fn snapshots_dir(&self) -> PathBuf
pub fn snapshots_dir(&self) -> PathBuf
Directory holding schema snapshot files.
Sourcepub fn history_file_path(&self) -> PathBuf
pub fn history_file_path(&self) -> PathBuf
Path of the migration history file.
Auto Trait Implementations§
impl Freeze for Project
impl RefUnwindSafe for Project
impl Send for Project
impl Sync for Project
impl Unpin for Project
impl UnsafeUnpin for Project
impl UnwindSafe for Project
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more