mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
feat(core): add Arguments::positional, returns an iterator over positional parameters
This commit is contained in:
parent
46f314103a
commit
367633a00a
@ -108,6 +108,11 @@ impl<'a, Db: Database> Arguments<'a, Db> {
|
||||
self.positional.len()
|
||||
}
|
||||
|
||||
/// Returns an iterator of the positional parameters.
|
||||
pub fn positional(&self) -> impl Iterator<Item = &Argument<'a, Db>> {
|
||||
self.positional.iter()
|
||||
}
|
||||
|
||||
/// Returns a reference to the argument at the location, if present.
|
||||
pub fn get<'x, I: ArgumentIndex<'a, Db>>(&'x self, index: &I) -> Option<&'x Argument<'a, Db>> {
|
||||
index.get(self)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user