Add documentation for GetArgumentPossibilities

This commit is contained in:
Anton Danilkin
2018-08-10 01:12:12 +03:00
parent b6ba5cf4f1
commit e2af5639c5

View File

@ -532,7 +532,13 @@ pub enum TypePosition {
Return, Return,
} }
/// Implemented on an AST type node to get equivalent list of syn types and type names that do not have unions.
/// For example, it turns `Promise<(sequence<object> or short)>` into
/// corresponding syn types and type names of `[Promise<sequence<object>>, short]`.
trait GetArgumentPossibilities<'src> { trait GetArgumentPossibilities<'src> {
/// Returns option that contains a value if the conversion succeeds.
/// The value is a vector of argument possibilities.
/// Each possibility is a tuple of converted argument (syn) types and type names
fn get_argument_possibilities(&self, record: &FirstPassRecord<'src>) -> Option<Vec<(syn::Type, String)>>; fn get_argument_possibilities(&self, record: &FirstPassRecord<'src>) -> Option<Vec<(syn::Type, String)>>;
} }
@ -945,7 +951,7 @@ impl<'src> FirstPassRecord<'src> {
/// `kind` is whether the function is a method, in which case we would need a `self` /// `kind` is whether the function is a method, in which case we would need a `self`
/// parameter. /// parameter.
/// ///
/// Return option that contains a value if the conversion succeeds. /// Returns option that contains a value if the conversion succeeds.
/// The value is a vector of argument variants. /// The value is a vector of argument variants.
/// Each variant is a vector of original arguments, converted argument types and type names. /// Each variant is a vector of original arguments, converted argument types and type names.
fn get_variants( fn get_variants(