Godeps/_workspace/src/gopkg.in/mgo.v2/session.go
func (s *Session) Safe() (safe *Safe) {
	s.m.Lock()
	defer s.m.Unlock()
	if s.safeOp != nil {
		cmd := s.safeOp.query.(*getLastError)
		safe = &Safe{WTimeout: cmd.WTimeout, FSync: cmd.FSync, J: cmd.J}
		switch w := cmd.W.(type) {
		case string:
			safe.WMode = w
		case int:
			safe.W = w
		}
	}
	return
}
func (s *Session) Safe() (safe *Safe) {
	s.m.Lock()
	defer s.m.Unlock()
	if s.safeOp != nil {
		cmd := s.safeOp.query.(*getLastError)
		safe = &Safe{WTimeout: cmd.WTimeout, FSync: cmd.FSync, J: cmd.J}
		switch w := cmd.W.(type) {
		case string:
			safe.WMode = w
		case int:
			safe.W = w
		}
	}
	return
}
func ( s * Session ) Safe ( ) ( safe * Safe ) { s . m . Lock ( ) defer s . m . Unlock ( ) if s . safeOp != nil { cmd := s . safeOp . query . ( * getLastError ) safe = & Safe { WTimeout : cmd . WTimeout , FSync : cmd . FSync , J : cmd . J } switch w := cmd . W . ( type ) { case string : safe . WMode = w case int : safe . W = w } } return }
// Safe returns the current safety mode for the session.
Safe returns the current safety mode for the session .