Struct ghastoolkit::codeql::cli::CodeQL
source · pub struct CodeQL { /* private fields */ }
Expand description
CodeQL CLI Wrapper to make it easier to run CodeQL commands
Implementations§
source§impl CodeQL
impl CodeQL
sourcepub fn init() -> CodeQLBuilder
pub fn init() -> CodeQLBuilder
Initialize a new CodeQL Builder instance
sourcepub fn find_codeql() -> Option<PathBuf>
pub fn find_codeql() -> Option<PathBuf>
Find CodeQL CLI on the system
sourcepub fn database<'a>(
&'a self,
db: &'a CodeQLDatabase
) -> CodeQLDatabaseHandler<'_, '_>
pub fn database<'a>( &'a self, db: &'a CodeQLDatabase ) -> CodeQLDatabaseHandler<'_, '_>
Pass a CodeQLDatabase to the CodeQL CLI to return a CodeQLDatabaseHandler. This handler can be used to run queries and other operations on the database.
sourcepub fn get_languages(&self) -> Result<Vec<CodeQLLanguage>, GHASError>
pub fn get_languages(&self) -> Result<Vec<CodeQLLanguage>, GHASError>
Get the programming languages supported by the CodeQL CLI.
This function will return the primary languages supported by the CodeQL and exclude
any secondary languages (checkout get_secondary_languages()
).
§Example
use ghastoolkit::CodeQL;
let codeql = CodeQL::default();
let languages = codeql.get_languages()
.expect("Failed to get languages");
for language in languages {
println!("Language: {}", language.pretty());
// Do something with the language
}
sourcepub fn get_secondary_languages(&self) -> Result<Vec<CodeQLLanguage>, GHASError>
pub fn get_secondary_languages(&self) -> Result<Vec<CodeQLLanguage>, GHASError>
Get the secondary languages supported by the CodeQL CLI
sourcepub fn get_all_languages(&self) -> Result<Vec<CodeQLLanguage>, GHASError>
pub fn get_all_languages(&self) -> Result<Vec<CodeQLLanguage>, GHASError>
Get all languages supported by the CodeQL CLI
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CodeQL
impl RefUnwindSafe for CodeQL
impl Send for CodeQL
impl Sync for CodeQL
impl Unpin for CodeQL
impl UnwindSafe for CodeQL
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
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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>
Converts
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>
Converts
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 moresource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.