call.go 867 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package dbus
  2. import (
  3. "errors"
  4. )
  5. // Call represents a pending or completed method call.
  6. type Call struct {
  7. Destination string
  8. Path ObjectPath
  9. Method string
  10. Args []interface{}
  11. // Strobes when the call is complete.
  12. Done chan *Call
  13. // After completion, the error status. If this is non-nil, it may be an
  14. // error message from the peer (with Error as its type) or some other error.
  15. Err error
  16. // Holds the response once the call is done.
  17. Body []interface{}
  18. }
  19. var errSignature = errors.New("dbus: mismatched signature")
  20. // Store stores the body of the reply into the provided pointers. It returns
  21. // an error if the signatures of the body and retvalues don't match, or if
  22. // the error status is not nil.
  23. func (c *Call) Store(retvalues ...interface{}) error {
  24. if c.Err != nil {
  25. return c.Err
  26. }
  27. return Store(c.Body, retvalues...)
  28. }