func (u *UnitStateAPI) State() (params.UnitStateResult, error) {
	var results params.UnitStateResults
	args := params.Entities{
		Entities: []params.Entity{{Tag: u.tag.String()}},
	}
	err := u.facade.FacadeCall("State", args, &results)
	if err != nil {
		return params.UnitStateResult{}, err
	}
	if len(results.Results) != 1 {
		return params.UnitStateResult{}, errors.Errorf("expected 1 result, got %d", len(results.Results))
	}
	result := results.Results[0]
	if result.Error != nil {
		return params.UnitStateResult{}, result.Error
	}
	return result, nil
}
// State returns the state persisted by the charm running in this unit
// and the state internal to the uniter for this unit.
State returns the state persisted by the charm running in this unit
and the state internal to the uniter for this unit.
// State returns the state persisted by the charm running in this unit // and the state internal to the uniter for this unit .
func (u *UnitStateAPI) State() (params.UnitStateResult, error) {
	var results params.UnitStateResults
	args := params.Entities{
		Entities: []params.Entity{{Tag: u.tag.String()}},
	}
	err := u.facade.FacadeCall("State", args, &results)
	if err != nil {
		return params.UnitStateResult{}, err
	}
	if len(results.Results) != 1 {
		return params.UnitStateResult{}, errors.Errorf("expected 1 result, got %d", len(results.Results))
	}
	result := results.Results[0]
	if result.Error != nil {
		return params.UnitStateResult{}, result.Error
	}
	return result, nil
}
func ( u * UnitStateAPI ) State ( ) ( params . UnitStateResult , error ) { var results params . UnitStateResults args := params . Entities { Entities : [ ] params . Entity { { Tag : u . tag . String ( ) } } , } err := u . facade . FacadeCall ( " " , args , & results ) if err != nil { return params . UnitStateResult { } , err } if len ( results . Results ) != 1 { return params . UnitStateResult { } , errors . Errorf ( " " , len ( results . Results ) ) } result := results . Results [ 0 ] if result . Error != nil { return params . UnitStateResult { } , result . Error } return result , nil }
State returns the state persisted by the charm running in this unit
and the state internal to the uniter for this unit.
State returns the state persisted by the charm running in this unit and the state internal to the uniter for this unit .