code: func (sched *Scheduler) bind(assumed *v1.Pod, b *v1.Binding) error {
  	bindingStart := time.Now()
  	// If binding succeeded then PodScheduled condition will be updated in apiserver so that
  	// it's atomic with setting host.
  	err := sched.config.GetBinder(assumed).Bind(b)
  	if finErr := sched.config.SchedulerCache.FinishBinding(assumed); finErr != nil {
  		klog.Errorf("scheduler cache FinishBinding failed: %v", finErr)
  	}
  	if err != nil {
  		klog.V(1).Infof("Failed to bind pod: %v/%v", assumed.Namespace, assumed.Name)
  		if err := sched.config.SchedulerCache.ForgetPod(assumed); err != nil {
  			klog.Errorf("scheduler cache ForgetPod failed: %v", err)
  		}
  		sched.recordSchedulingFailure(assumed, err, SchedulerError,
  			fmt.Sprintf("Binding rejected: %v", err))
  		return err
  	}
  
  	metrics.BindingLatency.Observe(metrics.SinceInSeconds(bindingStart))
  	metrics.DeprecatedBindingLatency.Observe(metrics.SinceInMicroseconds(bindingStart))
  	metrics.SchedulingLatency.WithLabelValues(metrics.Binding).Observe(metrics.SinceInSeconds(bindingStart))
  	metrics.DeprecatedSchedulingLatency.WithLabelValues(metrics.Binding).Observe(metrics.SinceInSeconds(bindingStart))
  	sched.config.Recorder.Eventf(assumed, v1.EventTypeNormal, "Scheduled", "Successfully assigned %v/%v to %v", assumed.Namespace, assumed.Name, b.Target.Name)
  	return nil
  }
docs: // bind binds a pod to a given node defined in a binding object.  We expect this to run asynchronously, so we
  // handle binding metrics internally.