A model for evolutionary rescue through plant mating system